<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

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

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

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

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

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity=60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

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

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

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

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

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

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

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

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

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

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

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

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

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

----
Also see [[AdvancedOptions]]
<<importTiddlers>>
Click the picture to start animation
(:graph({height:300,scales:[-4.5,4.5,-4.5,4.5],coords:"polar"})

dynamic.goforit = function(){
if(dynamic.animate==true) dynamic.timer = setInterval("dynamic.roll()",50);
else clearInterval(dynamic.timer);
dynamic.animate=!dynamic.animate;
}

dynamic.roll=function(){
dynamic.time+=0.05;
p.push([3*cos(dynamic.time)-cos(3*dynamic.time), 3*sin(dynamic.time)-sin(3*dynamic.time)]);
path(p,{stroke:"red",strokewidth:2,id:"neph"});
var cs= [3*cos(dynamic.time),3*sin(dynamic.time)];
line(p[p.length-1],cs,{stroke:"green",id:"axe",marker:{type:"*-*",stroke:"green"}});
circle(cs,1,{stroke:"black",id:"rev"});
if(dynamic.time>2*PI) {p=[[2,0]]; dynamic.time=0; dynamic.animate=true; clearInterval(dynamic.timer);}
}

dynamic.time=0;
dynamic.animate=true;
setAction("mousedown",dynamic.goforit);
grid();
axes();
circle([0,0],2);
circle([0,0],3,{stroke:"grey"});
circle([3,0],1,{stroke:"black",id:"rev"});
line([2,0],[3,0],{stroke:"green",id:"axe",marker:"*-*",markerstroke:"green"});
p=[[2,0]];
:)
Click the button to start/stop animation
(:graph({pos:"center",height:300,scales:[-2,2,-1,3],borderwidth:1,coords:"none"})
dynamic.goforit = function(){
SVG.locked = !SVG.locked;
if(dynamic.animate==true){
dynamic.timer = setInterval("dynamic.roll()",100);
} else {
clearInterval(dynamic.timer);
}
dynamic.animate=!dynamic.animate;
return false;
}

dynamic.roll=function(){
dynamic.time+=0.1;
var theta = PI/4*sin(sqrt(4.9)*dynamic.time);
rotate("line",theta,{center:[0,2],replace:true});
}

dynamic.time=0;
dynamic.animate=true;
rect([-1.5,2],[1.5,2.25],{fill:"red",stroke:"red"});

line([0,2],[0,0],{id:"line",marker:"--*",size:40,strokewidth:2,stroke:"yellow"});
button([SVG.xmax-0.75,SVG.ymin],[SVG.xmax,SVG.ymin+0.3],"start",dynamic.goforit,{fill:"green",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"yellow"});
:)
1. If I try to close an arc, it doesn't seem to work at all when specifying the arc with start, end, and radius. If I specify a closed arc with center, startangle, endangle, and radius, the arc is closed but the closing path passes through the center co-ordinate. I wasn't expecting that.

2. If I specify an arc using center, startangle, endangle, and radius, then the start and end points are swapped.

Here is some example code to show these things.

Closed and filled arcs drawn using ''start'', ''end'', and ''radius''.
(:graph({height:200,width:240,scales:[-0.5,5.5,0.5,5.5]})
setOptions({closed:true,fill:"orange"});
grid();
var a=[1,1]; var b=[2,2];
arc({start:[3,3],end:[4,4],radius:1,sweep:0,largearc:1});
arc({start:[2,1],end:[3,2],radius:1,sweep:0,largearc:0,closed:false,stroke:"red"});
arc({start:[0,1],end:[1,2],radius:1,sweep:1,largearc:0,stroke:"red",strokedasharray:"2,2"});
arc({start:[1,3],end:[2,4],radius:1,sweep:1,largearc:1,strokedasharray:"2,2"});
:)
Closed and filled arcs drawn using ''center'', ''startangle'', ''endangle'', and ''radius''.
(:graph({height:200,width:240,scales:[-0.5,5.5,0.5,5.5]})
setOptions({closed:true,fill:"orange"});
grid();
var a=[1,1]; var b=[2,2];
arc({center:[3,4],startangle:3*PI/2,endangle:2*PI,radius:1,sweep:0,largearc:1});
arc({center:[3,1],startangle:PI/2,endangle:PI,radius:1,sweep:1,largearc:0,closed:false,stroke:"red"});
arc({center:[1,1],startangle:PI/2,endangle:PI,radius:1,sweep:0,largearc:0,stroke:"red",strokedasharray:"2,2"});
arc({center:[1,4],startangle:3*PI/2,endangle:2*PI,radius:1,sweep:1,largearc:1,strokedasharray:"2,2"});
:)
Closed and filled sectors drawn using ''center'', ''startangle'', ''endangle'', and ''radius'' (sectors are always closed).
(:graph({height:200,width:240,scales:[-0.5,5.5,0.5,5.5]})
setOptions({fill:"orange"});
grid();
var a=[1,1]; var b=[2,2];
sector({center:[3,4],startangle:3*PI/2,endangle:2*PI,radius:1,sweep:0,largearc:1});
sector({center:[3,1],startangle:PI/2,endangle:PI,radius:1,sweep:1,largearc:0,stroke:"red"});
sector({center:[1,1],startangle:PI/2,endangle:PI,radius:1,sweep:0,largearc:0,stroke:"red",strokedasharray:"2,2"});
sector({center:[1,4],startangle:3*PI/2,endangle:2*PI,radius:1,sweep:1,largearc:1,strokedasharray:"2,2"});
:)


Comparison of sweep settings when using ''center'', ''startangle'', ''endangle'' and ''radius'' (with a similar center point for each sweep setting).

(:graph({height:150,width:450,scales:[0.5,12.5,0.5,4.5]})
grid();
var a=2; var b=2; var c=[a,b]; var d=0.25;
var n=PI/2; var e=0; var s=PI*1.5; var w=PI;
setOptions({stroke:"red",sweep:0,largearc:0,markerstroke:"red"});
arc({center:[a-d,b+d],startangle:n,endangle:w,radius:1,marker:"-*>"});
arc({center:[a-d,b-d],startangle:w,endangle:s,radius:1,marker:"-*>"});
arc({center:[a+d,b-d],startangle:s,endangle:e,radius:1,marker:"-*>"});
arc({center:[a+d,b+d],startangle:e,endangle:n,radius:1,marker:"-*>"});
text([a,3.8],"sweep:0");
text([a-1,b+1],"n-w");
text([a-1,b-1],"w-s");
text([a+1,b-1],"s-e");
text([a+1,b+1],"e-n");

var a=5; var b=2; var c=[a,b]; var d=0.25;
var n=PI/2; var e=0; var s=PI*1.5; var w=PI;
setOptions({stroke:"red",sweep:1,largearc:0,markerstroke:"red"});
arc({center:[a-d,b+d],startangle:n,endangle:w,radius:1,marker:"-*>"});
arc({center:[a-d,b-d],startangle:w,endangle:s,radius:1,marker:"-*>"});
arc({center:[a+d,b-d],startangle:s,endangle:e,radius:1,marker:"-*>"});
arc({center:[a+d,b+d],startangle:e,endangle:n,radius:1,marker:"-*>"});
text([a,3.8],"sweep:1");
text([a-1,b+1],"n-w",{pos:"se"});
text([a-1,b-1],"w-s",{pos:"ne"});
text([a+1,b-1],"s-e",{pos:"nw"});
text([a+1,b+1],"e-n",{pos:"sw"});

var a=8; var b=2; var c=[a,b]; var d=0.25;
setOptions({stroke:"blue",sweep:0,largearc:0,markerstroke:"blue"});
arc({center:[a-d,b+d],startangle:w,endangle:n,radius:1,marker:"-*>"});
arc({center:[a-d,b-d],startangle:s,endangle:w,radius:1,marker:"-*>"});
arc({center:[a+d,b-d],startangle:e,endangle:s,radius:1,marker:"-*>"});
arc({center:[a+d,b+d],startangle:n,endangle:e,radius:1,marker:"-*>"});
text([a,3.8],"sweep:0");
text([a-1,b+1],"w-n",{pos:"se"});
text([a-1,b-1],"s-w",{pos:"ne"});
text([a+1,b-1],"e-s",{pos:"nw"});
text([a+1,b+1],"n-e",{pos:"sw"});

var a=11; var b=2; var c=[a,b]; var d=0.25;
setOptions({stroke:"blue",sweep:1,largearc:0,markerstroke:"blue"});
arc({center:[a-d,b+d],startangle:w,endangle:n,radius:1,marker:"-*>"});
arc({center:[a-d,b-d],startangle:s,endangle:w,radius:1,marker:"-*>"});
arc({center:[a+d,b-d],startangle:e,endangle:s,radius:1,marker:"-*>"});
arc({center:[a+d,b+d],startangle:n,endangle:e,radius:1,marker:"-*>"});
text([a,3.8],"sweep:1");
text([a-1,b+1],"w-n");
text([a-1,b-1],"s-w");
text([a+1,b-1],"e-s");
text([a+1,b+1],"n-e");
:)
Comparison of sweep settings when using ''start'', ''end'' and ''radius'' (with a common start point for each sweep setting).
(:graph({height:117,width:200,scales:[-0.5,5.5,0.5,4]})
grid();
var a=1; var b=2; var st=[a,b];
setOptions({stroke:"red",sweep:0,largearc:0,markerstroke:"red"});
arc({start:st,end:[a-1,b+1],radius:1,marker:"-*>"});
arc({start:st,end:[a-1,b-1],radius:1,marker:"-*>"});
arc({start:st,end:[a+1,b-1],radius:1,marker:"-*>"});
arc({start:st,end:[a+1,b+1],radius:1,marker:"-*>"});
text([a,3.5],"sweep:0");
var a=4; var b=2; var st=[a,b];
setOptions({stroke:"red",sweep:1,largearc:0,markerstroke:"red",strokedasharray:"2,2"});
arc({start:st,end:[a-1,b+1],radius:1,marker:"-*>"});
arc({start:st,end:[a-1,b-1],radius:1,marker:"-*>"});
arc({start:st,end:[a+1,b-1],radius:1,marker:"-*>"});
arc({start:st,end:[a+1,b+1],radius:1,marker:"-*>"});
text([a,3.5],"sweep:1");
:)
[[AttachFilePlugin]] reads binary data from locally-stored files (e.g., images, PDFs, mp3's, etc.) and converts it to base64-encoded text that is stored in tiddlers tagged with<<tag attachment>>. [[AttachFilePluginFormatters]] allows you to use those tiddlers in place of the external path/file references that are normally part of the image and external links wiki syntax.

[[FileDropPlugin]] and [[FileDropPluginConfig]] allow you to quickly create attachment tiddlers simply by dragging files directly from your system's desktop folder display and dropping it onto an open TiddlyWiki document.  Text files are automatically created as simple tiddlers, while binary files are automatically encoded and attached.
/***
|Name|AttachFilePlugin|
|Source|http://www.TiddlyTools.com/#AttachFilePlugin|
|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|
|Version|4.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|AttachFilePluginFormatters, AttachFileMIMETypes|
|Overrides||
|Description|Store binary files as base64-encoded tiddlers with fallback links for separate local and/or remote file storage|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
!!!!!Documentation
>see [[AttachFilePluginInfo]]
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Revisions
<<<
2009.06.04 [4.0.0] changed attachment storage format to use //sections// instead of embedded substring markers.
|please see [[AttachFilePluginInfo]] for additional revision details|
2005.07.20 [1.0.0] Initial Release
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePlugin= {major: 4, minor: 0, revision: 0, date: new Date(2009,6,4)};

// shadow tiddler
config.shadowTiddlers.AttachFile="<<attach inline>>";

// add 'attach' backstage task (insert before built-in 'importTask')
if (config.tasks) { // for TW2.2b or above
	config.tasks.attachTask = {
		text: "attach",
		tooltip: "Attach a binary file as a tiddler",
		content: "<<attach inline>>"
	}
	config.backstageTasks.splice(config.backstageTasks.indexOf("importTask"),0,"attachTask");
}

config.macros.attach = {
// // lingo
//{{{
	label: "attach file",
	tooltip: "Attach a file to this document",
	linkTooltip: "Attachment: ",

	typeList: "AttachFileMIMETypes",

	titlePrompt: " enter tiddler title...",
	MIMEPrompt: "<option value=''>select MIME type...</option><option value='editlist'>[edit list...]</option>",
	localPrompt: " enter local path/filename...",
	URLPrompt: " enter remote URL...",

	tiddlerErr: "Please enter a tiddler title",
	sourceErr: "Please enter a source path/filename",
	storageErr: "Please select a storage method: embedded, local or remote",
	MIMEErr: "Unrecognized file format.  Please select a MIME type",
	localErr: "Please enter a local path/filename",
	URLErr: "Please enter a remote URL",
	fileErr: "Invalid path/file or file not found",

	tiddlerFormat: '!usage\n{{{%0}}}\n%0\n!notes\n%1\n!type\n%2\n!file\n%3\n!url\n%4\n!data\n%5\n',

//}}}
// // macro definition
//{{{
	handler:
	function(place,macroName,params) {
		if (params && !params[0])
			{ createTiddlyButton(place,this.label,this.tooltip,this.toggleAttachPanel); return; }
		var id=params.shift();
		this.createAttachPanel(place,id+"_attachPanel",params);
		document.getElementById(id+"_attachPanel").style.position="static";
		document.getElementById(id+"_attachPanel").style.display="block";
	},
//}}}
//{{{
	createAttachPanel:
	function(place,panel_id,params) {
		if (!panel_id || !panel_id.length) var panel_id="_attachPanel";
		// remove existing panel (if any)
		var panel=document.getElementById(panel_id); if (panel) panel.parentNode.removeChild(panel);
		// set styles for this panel
		setStylesheet(this.css,"attachPanel");
		// create new panel
		var title=""; if (params && params[0]) title=params.shift();
		var types=this.MIMEPrompt+this.formatListOptions(store.getTiddlerText(this.typeList)); // get MIME types
		panel=createTiddlyElement(place,"span",panel_id,"attachPanel",null);
		var html=this.html.replace(/%id%/g,panel_id);
		html=html.replace(/%title%/g,title);
		html=html.replace(/%disabled%/g,title.length?"disabled":"");
		html=html.replace(/%IEdisabled%/g,config.browser.isIE?"disabled":"");
		html=html.replace(/%types%/g,types);
		panel.innerHTML=html;
		if (config.browser.isGecko) { // FF3 FIXUP
			document.getElementById("attachSource").style.display="none";
			document.getElementById("attachFixPanel").style.display="block";
		}
		return panel;
	},
//}}}
//{{{
	toggleAttachPanel:
	function (e) {
		if (!e) var e = window.event;
		var parent=resolveTarget(e).parentNode;
		var panel = document.getElementById("_attachPanel");
		if (panel==undefined || panel.parentNode!=parent)
			panel=config.macros.attach.createAttachPanel(parent,"_attachPanel");
		var isOpen = panel.style.display=="block";
		if(config.options.chkAnimate)
			anim.startAnimating(new Slider(panel,!isOpen,e.shiftKey || e.altKey,"none"));
		else
			panel.style.display = isOpen ? "none" : "block" ;
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
		return(false);
	},
//}}}
//{{{
	formatListOptions:
	function(text) {
		if (!text || !text.trim().length) return "";
		// get MIME list content from text
		var parts=text.split("\n----\n");
		var out="";
		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
			out +='<option value="%1">%0</option>'.format([label,value]);
		}
		return out;
	},
//}}}
// // interface definition
//{{{
	css:
	".attachPanel { display: none; position:absolute; z-index:10; width:35em; right:105%; top:0em;\
		background-color: #eee; color:#000; font-size: 8pt; line-height:110%;\
		border:1px solid black; border-bottom-width: 3px; border-right-width: 3px;\
		padding: 0.5em; margin:0em; -moz-border-radius:1em;-webkit-border-radius:1em; text-align:left }\
	.attachPanel form { display:inline;border:0;padding:0;margin:0; }\
	.attachPanel select { width:99%;margin:0px;font-size:8pt;line-height:110%;}\
	.attachPanel input  { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%}\
	.attachPanel textarea { width:98%;margin:0px;height:2em;font-size:8pt;line-height:110%}\
	.attachPanel table { width:100%;border:0;margin:0;padding:0;color:inherit; }\
	.attachPanel tbody, .attachPanel tr, .attachPanel td { border:0;margin:0;padding:0;color:#000; }\
	.attachPanel .box { border:1px solid black; padding:.3em; margin:.3em 0px; background:#f8f8f8; \
		-moz-border-radius:5px;-webkit-border-radius:5px; }\
	.attachPanel .chk { width:auto;border:0; }\
	.attachPanel .btn { width:auto; }\
	.attachPanel .btn2 { width:49%; }\
	",
//}}}
//{{{
	html:
	'<form>\
		attach from source file\
		<input type="file" id="attachSource" name="source" size="56"\
			onChange="config.macros.attach.onChangeSource(this)">\
		<div id="attachFixPanel" style="display:none"><!-- FF3 FIXUP -->\
			<input type="text" id="attachFixSource" style="width:90%"\
				title="Enter a path/file to attach"\
				onChange="config.macros.attach.onChangeSource(this);">\
			<input type="button" style="width:7%" value="..."\
				title="Enter a path/file to attach"\
				onClick="config.macros.attach.askForFilename(document.getElementById(\'attachFixSource\'));">\
		</div><!--end FF3 FIXUP-->\
		<div class="box">\
		<table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
			embed data <input type=checkbox class=chk name="useData" %IEdisabled% \
				onclick="if (!this.form.MIMEType.value.length)\
					this.form.MIMEType.selectedIndex=this.checked?1:0; ">&nbsp;\
		</td><td style="border:0">\
			<select size=1 name="MIMEType" \
				onchange="this.title=this.value; if (this.value==\'editlist\')\
					{ this.selectedIndex=this.form.useData.checked?1:0; story.displayTiddler(null,config.macros.attach.typeList,2); return; }">\
				<option value=""></option>\
				%types%\
			</select>\
		</td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
			local link <input type=checkbox class=chk name="useLocal"\
				onclick="this.form.local.value=this.form.local.defaultValue=this.checked?config.macros.attach.localPrompt:\'\';">&nbsp;\
		</td><td style="border:0">\
			<input type=text name="local" size=15 autocomplete=off value=""\
				onchange="this.form.useLocal.checked=this.value.length" \
				onkeyup="this.form.useLocal.checked=this.value.length" \
				onfocus="if (!this.value.length) this.value=config.macros.attach.localPrompt; this.select()">\
		</td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
			remote link <input type=checkbox class=chk name="useURL"\
				onclick="this.form.URL.value=this.form.URL.defaultValue=this.checked?config.macros.attach.URLPrompt:\'\';\">&nbsp;\
		</td><td style="border:0">\
			<input type=text name="URL" size=15 autocomplete=off value=""\
				onfocus="if (!this.value.length) this.value=config.macros.attach.URLPrompt; this.select()"\
				onchange="this.form.useURL.checked=this.value.length;"\
				onkeyup="this.form.useURL.checked=this.value.length;">\
		</td></tr></table>\
		</div>\
		<table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;vertical-align:top;width:1%;white-space:nowrap">\
			notes&nbsp;\
		</td><td style="border:0" colspan=2>\
			<textarea name="notes" style="width:98%;height:3.5em;margin-bottom:2px"></textarea>\
		</td><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
			attach as&nbsp;\
		</td><td style="border:0" colspan=2>\
			<input type=text name="tiddlertitle" size=15 autocomplete=off value="%title%"\
				onkeyup="if (!this.value.length) { this.value=config.macros.attach.titlePrompt; this.select(); }"\
				onfocus="if (!this.value.length) this.value=config.macros.attach.titlePrompt; this.select()" %disabled%>\
		</td></tr></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
			add tags&nbsp;\
		</td><td style="border:0">\
			<input type=text name="tags" size=15 autocomplete=off value="" onfocus="this.select()">\
		</td><td style="width:40%;text-align:right;border:0">\
			<input type=button class=btn2 value="attach"\
				onclick="config.macros.attach.onClickAttach(this)"><!--\
			--><input type=button class=btn2 value="close"\
				onclick="var panel=document.getElementById(\'%id%\'); if (panel) panel.parentNode.removeChild(panel);">\
		</td></tr></table>\
	</form>',
//}}}
// // control processing
//{{{
	onChangeSource:
	function(here) {
		var form=here.form;
		var list=form.MIMEType;
		var theFilename  = here.value;
		var theExtension = theFilename.substr(theFilename.lastIndexOf('.')).toLowerCase();
		// if theFilename is in current document folder, remove path prefix and use relative reference
		var h=document.location.href; folder=getLocalPath(decodeURIComponent(h.substr(0,h.lastIndexOf("/")+1)));
		if (theFilename.substr(0,folder.length)==folder) theFilename='./'+theFilename.substr(folder.length);
		else theFilename='file:///'+theFilename; // otherwise, use absolute reference
		theFilename=theFilename.replace(/\\/g,"/"); // fixup: change \ to /
		form.useLocal.checked = true;
		form.local.value = theFilename;
		form.useData.checked = !form.useData.disabled;
		list.selectedIndex=1;
		for (var i=0; i<list.options.length; i++) // find matching MIME type
			if (list.options[i].value.indexOf(theExtension)!=-1) { list.selectedIndex = i; break; }
		if (!form.tiddlertitle.disabled)
			form.tiddlertitle.value=theFilename.substr(theFilename.lastIndexOf('/')+1); // get tiddlername from filename
	},
//}}}
//{{{
	onClickAttach:
	function (here) {
		clearMessage();
		// get input values
		var form=here.form;
		var src=form.source; if (config.browser.isGecko) src=document.getElementById("attachFixSource");
		src=src.value!=src.defaultValue?src.value:"";
		var when=(new Date()).formatString(config.macros.timeline.dateFormat);
		var title=form.tiddlertitle.value;
		var local = form.local.value!=form.local.defaultValue?form.local.value:"";
		var url = form.URL.value!=form.URL.defaultValue?form.URL.value:"";
		var notes = form.notes.value;
		var tags = "attachment excludeMissing "+form.tags.value;
		var useData=form.useData.checked;
		var useLocal=form.useLocal.checked;
		var useURL=form.useURL.checked;
		var mimetype = form.MIMEType.value.length?form.MIMEType.options[form.MIMEType.selectedIndex].text:"";
		// validate checkboxes and get filename
		if (useData) {
			if (src.length) { if (!theLocation) var theLocation=src; }
			else { alert(this.sourceErr); src.focus(); return false; }
		}
		if (useLocal) {
			if (local.length) { if (!theLocation) var theLocation = local; }
			else { alert(this.localErr); form.local.focus(); return false; }
		}
		if (useURL) {
			if (url.length) { if (!theLocation) var theLocation = url; }
			else { alert(this.URLErr); form.URL.focus(); return false; }
		}
		if (!(useData||useLocal||useURL))
			{ form.useData.focus(); alert(this.storageErr); return false; }
		if (!theLocation)
			{ src.focus(); alert(this.sourceErr); return false; }
		if (!title || !title.trim().length || title==this.titlePrompt)
			{ form.tiddlertitle.focus(); alert(this.tiddlerErr); return false; }
		// if not already selected, determine MIME type based on filename extension (if any)
		if (useData && !mimetype.length && theLocation.lastIndexOf('.')!=-1) {
			var theExt = theLocation.substr(theLocation.lastIndexOf('.')).toLowerCase();
			var theList=form.MIMEType;
			for (var i=0; i<theList.options.length; i++)
				if (theList.options[i].value.indexOf(theExt)!=-1)
					{ var mimetype=theList.options[i].text; theList.selectedIndex=i; break; }
		}
		// attach the file
		return this.createAttachmentTiddler(src, when, notes, tags, title,
			useData, useLocal, useURL, local, url, mimetype);
	},
	getMIMEType:
	function(src,def) {
		var ext = src.substr(src.lastIndexOf('.')).toLowerCase();
		var list=store.getTiddlerText(this.typeList);
		if (!list || !list.trim().length) return def;
		// get MIME list content from tiddler
		var parts=list.split("\n----\n");
		for (var p=0; p<parts.length; p++) {
			var lines=parts[p].split("\n");
			var mime=lines.shift(); // 1st line=MIME type
			var match=lines.shift(); // 2nd line=matching extensions
			if (match.indexOf(ext)!=-1) return mime;
		}
		return def;
	},
	createAttachmentTiddler:
	function (src, when, notes, tags, title, useData, useLocal, useURL, local, url, mimetype, noshow) {
		if (useData) { // encode the data
			if (!mimetype.length) {
				alert(this.MIMEErr);
				form.MIMEType.selectedIndex=1; form.MIMEType.focus();
				return false;
			}
			var d = this.readFile(src); if (!d) { return false; }
			displayMessage('encoding '+src);
			var encoded = this.encodeBase64(d);
			displayMessage('file size='+d.length+' bytes, encoded size='+encoded.length+' bytes');
		}
		var usage=(mimetype.substr(0,5)=="image"?'[img[%0]]':'[[%0|%0]]').format([title]);
		var theText=this.tiddlerFormat.format([
			usage, notes.length?notes:'//none//', mimetype,
			useLocal?local.replace(/\\/g,'/'):'', useURL?url:'',
			useData?('data:'+mimetype+';base64,'+encoded):'' ]);
		store.saveTiddler(title,title,theText,config.options.txtUserName,new Date(),tags);
		var panel=document.getElementById("attachPanel"); if (panel) panel.style.display="none";
		if (!noshow) { story.displayTiddler(null,title); story.refreshTiddler(title,null,true); }
		displayMessage('attached "'+title+'"');
		return true;
	},
//}}}
// // base64 conversion
//{{{
	encodeBase64:
	function (d) {
		if (!d) return null;
		// encode as base64
		var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
		var out="";
		var chr1,chr2,chr3="";
		var enc1,enc2,enc3,enc4="";
		for (var count=0,i=0; i<d.length; ) {
			chr1=d.charCodeAt(i++);
			chr2=d.charCodeAt(i++);
			chr3=d.charCodeAt(i++);
			enc1=chr1 >> 2;
			enc2=((chr1 & 3) << 4) | (chr2 >> 4);
			enc3=((chr2 & 15) << 2) | (chr3 >> 6);
			enc4=chr3 & 63;
			if (isNaN(chr2)) enc3=enc4=64;
			else if (isNaN(chr3)) enc4=64;
			out+=keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);
			chr1=chr2=chr3=enc1=enc2=enc3=enc4="";
		}
		return out;
	},
	decodeBase64: function(input) {
		var out="";
		var chr1,chr2,chr3;
		var enc1,enc2,enc3,enc4;
		var i = 0;
		// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
		input=input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
		do {
			enc1=keyStr.indexOf(input.charAt(i++));
			enc2=keyStr.indexOf(input.charAt(i++));
			enc3=keyStr.indexOf(input.charAt(i++));
			enc4=keyStr.indexOf(input.charAt(i++));
			chr1=(enc1 << 2) | (enc2 >> 4);
			chr2=((enc2 & 15) << 4) | (enc3 >> 2);
			chr3=((enc3 & 3) << 6) | enc4;
			out=out+String.fromCharCode(chr1);
			if (enc3!=64) out=out+String.fromCharCode(chr2);
			if (enc4!=64) out=out+String.fromCharCode(chr3);
		} while (i<input.length);
		return out;
	},
//}}}
// // I/O functions
//{{{
	readFile: // read local BINARY file data
	function(filePath) {
		if(!window.Components) { return null; }
		try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
		catch(e) { alert("access denied: "+filePath); return null; }
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		try { file.initWithPath(filePath); } catch(e) { alert("cannot read file - invalid path: "+filePath); return null; }
		if (!file.exists()) { alert("cannot read file - not found: "+filePath); return null; }
		var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
		inputStream.init(file, 0x01, 00004, null);
		var bInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);
		bInputStream.setInputStream(inputStream);
		return(bInputStream.readBytes(inputStream.available()));
	},
//}}}
//{{{
	writeFile:
	function(filepath,data) {
		// TBD: decode base64 and write BINARY data to specified local path/filename
		return(false);
	},
//}}}
//{{{
	askForFilename: // for FF3 fixup
	function(target) {
		var msg=config.messages.selectFile;
		if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
		// get local path for current document
		var path=getLocalPath(document.location.href);
		var p=path.lastIndexOf("/"); if (p==-1) p=path.lastIndexOf("\\"); // Unix or Windows
		if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
		var file=""
		var result=window.mozAskForFilename(msg,path,file,true); // FF3 FIXUP ONLY
		if (target && result.length) // set target field and trigger handling
			{ target.value=result; target.onchange(); }
		return result; 
	}
};
//}}}
//{{{
if (window.mozAskForFilename===undefined) { // also defined by CoreTweaks (for ticket #604)
	window.mozAskForFilename=function(msg,path,file,mustExist) {
		if(!window.Components) return false;
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
			var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
			var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
			picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
			var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
			thispath.initWithPath(path);
			picker.displayDirectory=thispath;
			picker.defaultExtension='';
			picker.defaultString=file;
			picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
			if (picker.show()!=nsIFilePicker.returnCancel)
				var result=picker.file.persistentDescriptor;
		}
		catch(ex) { displayMessage(ex.toString()); }
		return result;
	}
}
//}}}
/***
|Name|AttachFilePluginFormatters|
|Source|http://www.TiddlyTools.com/#AttachFilePluginFormatters|
|Version|4.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1.3|
|Type|plugin|
|Requires||
|Overrides|'image' and 'prettyLink' formatters, TiddlyWiki.prototype.getRecursiveTiddlerText|
|Description|run-time library for displaying attachment tiddlers|

This plugin provides "stand-alone" processing for //rendering// attachment tiddlers created by [[AttachFilePlugin]].   Attachment tiddlers are tagged with<<tag attachment>>and contain binary file content (e.g., jpg, gif, pdf, mp3, etc.) that has been stored directly as base64 text-encoded data or can be loaded from external files stored on a local filesystem or remote web server.

NOTE: This plugin does not include the "control panel" and supporting functions needed to //create// new attachment tiddlers.  Those features are provided by [[AttachFilePlugin]], which can be installed while building your document, and then safely omitted to reduce the overall file size when you publish your finished document (assuming you don't intend to create any additional attachment tiddlers in that document)
!!!!!Formatters
<<<
This plugin extends the behavior of the following TiddlyWiki core "wikify()" formatters:
* embedded images: {{{[img[tooltip|image]]}}}
* linked embedded images: {{{[img[tooltip|image][link]]}}}
* external/"pretty" links: {{{[[label|link]]}}}
''Please refer to AttachFilePlugin (source: http://www.TiddlyTools.com/#AttachFilePlugin) for additional information.''
<<<
!!!!!Revisions
<<<
2009.06.04 [4.0.0] changed attachment storage format to use //sections// instead of embedded substring markers.
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.10.29 [3.7.0] more code reduction: removed upload handling from AttachFilePlugin (saves ~7K!)
2007.10.28 [3.6.0] removed duplicate formatter code from AttachFilePlugin (saves ~10K!) and updated documentation accordingly.  This plugin ([[AttachFilePluginFormatters]]) is now //''required''// in order to display attached images/binary files within tiddler content.
2006.05.20 [3.4.0] through 2007.03.01 [3.5.3] sync with AttachFilePlugin
2006.05.13 [3.2.0] created from AttachFilePlugin v3.2.0
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePluginFormatters= {major: 4, minor: 0, revision: 0, date: new Date(2009,6,4)};
//}}}

//{{{
if (config.macros.attach==undefined) config.macros.attach= { };
//}}}
//{{{
if (config.macros.attach.isAttachment==undefined) config.macros.attach.isAttachment=function (title) {
	var tiddler = store.getTiddler(title);
	if (tiddler==undefined || tiddler.tags==undefined) return false;
	return (tiddler.tags.indexOf("attachment")!=-1);
}
//}}}

//{{{
// test for local file existence - returns true/false without visible error display
if (config.macros.attach.fileExists==undefined) config.macros.attach.fileExists=function(f) {
	if(window.Components) { // MOZ
		try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
		catch(e) { return false; } // security access denied
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		try { file.initWithPath(f); }
		catch(e) { return false; } // invalid directory
		return file.exists();
	}
	else { // IE
		var fso = new ActiveXObject("Scripting.FileSystemObject");
		return fso.FileExists(f);
	}
}
//}}}

//{{{
if (config.macros.attach.getAttachment==undefined) config.macros.attach.getAttachment=function(title) {

	// extract embedded data, local and remote links (if any)
	var text=store.getTiddlerText(title,'');
	var embedded=store.getTiddlerText(title+'##data','').trim();
	var locallink=store.getTiddlerText(title+'##file','').trim();
	var remotelink=store.getTiddlerText(title+'##url','').trim();

	// backward-compatibility for older attachments (pre 4.0.0)
	var startmarker="---BEGIN_DATA---\n";
	var endmarker="\n---END_DATA---";
	var pos=0; var endpos=0;
	if ((pos=text.indexOf(startmarker))!=-1 && (endpos=text.indexOf(endmarker))!=-1)
		embedded="data:"+(text.substring(pos+startmarker.length,endpos)).replace(/\n/g,'');
	if ((pos=text.indexOf("/%LOCAL_LINK%/"))!=-1)
		locallink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));
	if ((pos=text.indexOf("/%REMOTE_LINK%/"))!=-1)
		remotelink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));

	// if there is a data: URI defined (not supported by IE)
	if (embedded.length && !config.browser.isIE) return embedded;

	// document is being served remotely... use remote URL (if any)  (avoids security alert)
	if (remotelink.length && document.location.protocol!="file:")
		return remotelink;  

	// local link only... return link without checking file existence (avoids security alert)
	if (locallink.length && !remotelink.length) 
		return locallink; 

	// local link, check for file exist... use local link if found
	if (locallink.length) { 
		locallink=locallink.replace(/^\.[\/\\]/,''); // strip leading './' or '.\' (if any)
		if (this.fileExists(getLocalPath(locallink))) return locallink;
		// maybe local link is relative... add path from current document and try again
		var pathPrefix=document.location.href;  // get current document path and trim off filename
		var slashpos=pathPrefix.lastIndexOf("/"); if (slashpos==-1) slashpos=pathPrefix.lastIndexOf("\\"); 
		if (slashpos!=-1 && slashpos!=pathPrefix.length-1) pathPrefix=pathPrefix.substr(0,slashpos+1);
		if (this.fileExists(getLocalPath(pathPrefix+locallink))) return locallink;
	}

	// no embedded data, no local (or not found), fallback to remote URL (if any)
	if (remotelink.length) return remotelink;

	// attachment URL doesn't resolve, just return input as is
	return title;
}
//}}}
//{{{
if (config.macros.attach.init_formatters==undefined) config.macros.attach.init_formatters=function() {
	if (this.initialized) return;

	// find the formatter for "image" and replace the handler
	for (var i=0; i<config.formatters.length && config.formatters[i].name!="image"; i++);
	if (i<config.formatters.length)	config.formatters[i].handler=function(w) {
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link
			{
			var e = w.output;
			if(lookaheadMatch[5])
				{
				var link = lookaheadMatch[5];
				// ELS -------------
				var external=config.formatterHelpers.isExternalLink(link);
				if (external)
					{
					if (config.macros.attach.isAttachment(link))
						{
						e = createExternalLink(w.output,link);
						e.href=config.macros.attach.getAttachment(link);
						e.title = config.macros.attach.linkTooltip + link;
						}
					else
						e = createExternalLink(w.output,link);
					}
				else 
					e = createTiddlyLink(w.output,link,false,null,w.isStatic);
				// ELS -------------
				addClass(e,"imageLink");
				}
			var img = createTiddlyElement(e,"img");
			if(lookaheadMatch[1])
				img.align = "left";
			else if(lookaheadMatch[2])
				img.align = "right";
			if(lookaheadMatch[3])
				img.title = lookaheadMatch[3];
			img.src = lookaheadMatch[4];
			// ELS -------------
			if (config.macros.attach.isAttachment(lookaheadMatch[4]))
				img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);
			// ELS -------------
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
//}}}
//{{{
	// find the formatter for "prettyLink" and replace the handler
	for (var i=0; i<config.formatters.length && config.formatters[i].name!="prettyLink"; i++);
	if (i<config.formatters.length)	{
		config.formatters[i].handler=function(w) {
			this.lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
				var e;
				var text = lookaheadMatch[1];
				if(lookaheadMatch[3]) {
					// Pretty bracketted link
					var link = lookaheadMatch[3];
					if (config.macros.attach.isAttachment(link)) {
						e = createExternalLink(w.output,link);
						e.href=config.macros.attach.getAttachment(link);
						e.title=config.macros.attach.linkTooltip+link;
					}
					else e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))
						? createExternalLink(w.output,link)
						: createTiddlyLink(w.output,link,false,null,w.isStatic);
				} else {
					e = createTiddlyLink(w.output,text,false,null,w.isStatic);
				}
				createTiddlyText(e,text);
				w.nextMatch = this.lookaheadRegExp.lastIndex;
			}
		}
	} // if "prettyLink" formatter found
	this.initialized=true;
}
//}}}
//{{{
config.macros.attach.init_formatters(); // load time init
//}}}
//{{{
if (TiddlyWiki.prototype.coreGetRecursiveTiddlerText==undefined) {
	TiddlyWiki.prototype.coreGetRecursiveTiddlerText = TiddlyWiki.prototype.getRecursiveTiddlerText;
	TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth) {
		return config.macros.attach.isAttachment(title)?
			config.macros.attach.getAttachment(title):this.coreGetRecursiveTiddlerText.apply(this,arguments);
	}
}
//}}}
/***
|Name|AttachFilePluginInfo|
|Source|http://www.TiddlyTools.com/#AttachFilePlugin|
|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|
|Version|4.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Documentation for AttachFilePlugin|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Syntax
<<<
''To display the attach file control panel, simply view the [[AttachFile]] shadow tiddler that is automatically created by the plugin, and contains an instance of the inline control panel.''.  Or, you can write:
{{{
<<attach inline>>
}}}
in any tiddler to display the control panel embedded within that tiddler.  Note: you can actually use any unique identifier in place of the "inline" keyword.  Each unique id creates a separate instance of the controls.  If the same ID is used in more than one tiddler, then the control panel is automatically moved to the most recently rendered location.  Or, you can write:
{{{
<<attach>>
}}}
(with no ID parameter) in SidebarOptions.  This adds a command link that opens the controls as a floating panel, positioned directly to the left of the sidebar.
<<<
!!!!!Usage
<<<
Binary file content can be stored in three different locations:
#embedded in the attachment tiddler (encoded as base64)
#on your filesystem (a 'local link' path/filename)
#on a web server (a 'remote link' URL)
The plugin creates an "attachment tiddler" for each file you attach.  Regardless of where you store the binary content, your document can refer to the attachment tiddler rather than using a direct file or URL reference in your embedded image or external links, so that changing document locations will not require updating numerous tiddlers or copying files from one system to another.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
When you attach a file, a tiddler (tagged with<<tag attachment>>) is generated (using the source filename as the tiddler's title).  The tiddler contains //''base64 text-encoded binary data''//, surrounded by {{{/%...%/}}} comment markers (so they are not visible when viewing the tiddler).  The tiddler also includes summary details about the file: when it was attached, by whom, etc. and, if the attachment is an image file (jpg, gif, or png), the image is automatically displayed below the summary information.
>Note: although you can edit an attachment tiddler, ''don't change any of the encoded content below the attachment header'', as it has been prepared for use in the rest of your document, and even changing a single character can make the attachment unusable.  //If needed, you ''can'' edit the header information or even the MIME type declaration in the attachment data, but be very careful not to change any of the base64-encoded binary data.//
With embedded data, your TW document can be completely self-contained...unfortunately, embedding just a few moderately-sized binary files using base64 text-encoding can dramatically increase the size of your document.   To avoid this problem, you can create attachment tiddlers that define external local filesystem (file://) and/or remote web server (http://) 'reference' links, without embedding the binary data directly in the tiddler (i.e., uncheck "embed data" in the 'control panel').

These links provide an alternative source for the binary data: if embedded data is not found (or you are running on Internet Explorer, which does not currently support using embedded data), then the plugin tries the local filesystem reference.  If a local file is not found, then the remote reference (if any) is used.  This "fallback" approach also lets you 'virtualize' the external links in your document, so that you can access very large binary content such as PDFs, MP3's, and even *video* files, by using just a 'remote reference link' without embedding any data or downloading huge files to your hard disk.

Of course, when you //do// download an attached file, the local copy will be used instead of accessing a remote server each time, thereby saving bandwidth and allowing you to 'go mobile' without having to edit any tiddlers to alter the link locations...
<<<
!!!!!Syntax / Examples
<<<
To embed attached files as images or link to them from other tiddlers, use the standard ~TiddlyWiki image syntax ({{{[img[tooltip|filename]]}}}), linked image syntax ({{{[img[tooltip|filename][tiddlername]]}}}) , or "external link" syntax ({{{[[text|URL]]}}}), replacing the filename or URL that is normally entered with the title of an attachment tiddler.

embedded image data:
>{{{[img[Meow|AttachFileSample]]}}}
>[img[Meow|AttachFileSample]]
embedded image data with link to larger remote image:
>{{{[img[click for larger view|AttachFileSample][AttachFileSample2]]}}}
>[img[click for larger view|AttachFileSample][AttachFileSample2]]
'external' link to embedded image data:
>{{{[[click to view attachment|AttachFileSample]]}}}
>[[click to view attachment|AttachFileSample]]
'external' link to remote image:
>{{{[[click to view attachment|AttachFileSample2]]}}}
>[[click to view attachment|AttachFileSample2]]
regular ~TiddlyWiki links to attachment tiddlers:
>{{{[[AttachFileSample]]}}} [[AttachFileSample]]
>{{{[[AttachFileSample2]]}}} [[AttachFileSample2]]
<<<
!!!!!Defining MIME types
<<<
When you select a source file, a ''[[MIME|http://en.wikipedia.org/wiki/MIME]]'' file type is automatically suggested, based on filename extension.  The AttachFileMIMETypes tiddler defines the list of MIME types that will be recognized by the plugin.  Each MIME type definition consists of exactly two lines of text: the official MIME type designator (e.g., "text/plain", "image/gif", etc.), and a space-separated list of file extensions associated with that type.  List entries are separated by "----" (horizontal rules).
<<<
!!!!!Known Limitations
<<<
Internet Explorer does not support the data: URI scheme, and cannot use the //embedded// data to render images or links.  However, you can still use the local/remote link definitions to create file attachments that are stored externally.  In addition, while it is relatively easy to read local //text// files, reading binary files is not directly supported by IE's FileSystemObject (FSO) methods, and other file I/O techniques are subject to security barriers or require additional MS proprietary technologies (like ASP or VB) that make implementation more difficult.  As a result, you cannot //create// new attachment tiddlers using IE.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your document:
* [[AttachFilePlugin]] (tagged with <<tag systemConfig>>)
* [[AttachFilePluginFormatters]] ("runtime distribution library") (tagged with <<tag systemConfig>>)
* [[AttachFileSample]] and [[AttachFileSample2]] //(tagged with <<tag attachment>>)//
* [[AttachFileMIMETypes]] //(defines binary file types)//
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
<<<
!!!!!Revisions
<<<
2009.06.04 [4.0.0] changed attachment storage format to use //sections// instead of embedded substring markers.
2008.07.21 [3.9.0] Fixup for FireFox 3: use HTML with separate text+button control instead of type='file' control
2008.05.12 [3.8.1] automatically add 'attach' task to backstage (moved from BackstageTweaks)
2008.04.09 [3.8.0] in onChangeSource(), if source matches current document folder, use relative reference for local link.  Also, disable 'embed' when using IE (which //still// doesn't support data: URI)
2008.04.07 [3.7.3] fixed typo in HTML for 'local file link' so that clicking in input field doesn't erase current path/file (if any)
2008.04.07 [3.7.2] auto-create AttachFile shadow tiddler for inline interface
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.12.03 [3.7.1] in createAttachmentTiddler(), added optional "noshow" flag to suppress display of newly created tiddlers.
2007.10.29 [3.7.0] code reduction: removed support for built-in upload to server... on-line hosting of binary attachments is left to the document author, who can upload/host files using 3rd-party web-based services (e.g. www.flickr.com, ) or stand-alone applications (e.g., FTP).
2007.10.28 [3.6.0] code reduction: removed duplicate definition of image and prettyLink formatters.  Rendering of attachment tiddlers now //requires// installation of AttachFilePluginFormatters
2007.03.01 [3.5.3] use apply() to invoke hijacked function
2007.02.25 [3.5.2] in hijack of "prettyLink", fix version check for TW2.2 compatibility (prevent incorrect use of fallback handler)
2007.01.09 [3.5.1] onClickAttach() refactored to create separate createAttachmentTiddler() API for use with FileDropPluginHandlers
2006.11.30 [3.5.0] in getAttachment(), for local references, add check for file existence and fallback to remote URL if local file not found.  Added fileExists() to encapsulate FF vs. IE local file test function (IE FSO object code is TBD).
2006.11.29 [3.4.8] in hijack for PrettyLink, 'simple bracketed link' opens tiddler instead of external link to attachment
2006.11.29 [3.4.7] in readFile(), added try..catch around initWithPath() to handle invalid/non-existent paths better.
2006.11.09 [3.4.6] REAL FIX for TWv2.1.3: incorporate new TW2.1.3 core "prettyLink" formatter regexp handling logic and check for version < 2.1.3 with fallback to old plugin code.  Also, cleanup table layout in HTML (added "border:0" directly to table elements to override stylesheet)
2006.11.08 [3.4.5] TEMPORARY FIX for TWv2.1.3: disable hijack of wikiLink formatter due to changes in core wikiLink regexp definition.  //Links to attachments are broken, but you can still use {{{[img[TiddlerName]]}}} to render attachments as images, as well as {{{background:url('[[TiddlerName]]')}}} in CSS declarations for background images.//
2006.09.10 [3.4.4] update formatters for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)
2006.07.24 [3.4.3] in prettyLink formatter, added check for isShadowTiddler() to fix problem where shadow links became external links.
2006.07.13 [3.4.2] in getAttachment(), fixed stripping of newlines so data: used in CSS will work
2006.05.21 [3.4.1] in getAttachment(), fixed substring() to extract data: URI (was losing last character, which broken rendering of SOME images)
2006.05.20 [3.4.0] hijack core getRecursiveTiddlerText() to support rendering attachments in stylesheets (e.g. {{{url([[AttachFileSample]])}}})
2006.05.20 [3.3.6] add "description" feature to easily include notes in attachment tiddler (you can always edit to add them later... but...)
2006.05.19 [3.3.5] add "attach as" feature to change default name for attachment tiddlers.  Also, new optional param to specify tiddler name (disables editing)
2006.05.16 [3.3.0] completed XMLHttpRequest handling for GET or POST to configurable server scripts
2006.05.13 [3.2.0] added interface for upload feature.  Major rewrite of code for clean object definitions.  Major improvements in UI interaction and validation.
2006.05.09 [3.1.1] add wikifer support for using attachments in links from "linked image" syntax: {{{[img[tip|attachment1][attachment2]]}}}
2006.05.09 [3.1.0] lots of code changes: new options for attachments that use embedded data and/or links to external files (local or remote)
2006.05.03 [3.0.2] added {{{/%...%/}}} comments around attachment data to hide it when viewing attachment tiddler.
2006.02.05 [3.0.1] wrapped wikifier hijacks in initAttachmentFormatters() function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals
2005.12.27 [3.0.0] Update for TW2.0.  Automatically add 'excludeMissing' tag to attachments
2005.12.16 [2.2.0] Dynamically create/remove attachPanel as needed to ensure only one instance of interface elements exists, even if there are multiple instances of macro embedding.
2005.11.20 [2.1.0] added wikifier handler extensions for "image" and "prettyLink" to render tiddler attachments
2005.11.09 [2.0.0] begin port from old ELS Design adaptation based on ~TW1.2.33
2005.07.20 [1.0.0] Initial release (as adaptation)
<<<
!usage
{{{[img[AttachFileSample]]}}}
[img[AttachFileSample]]
!notes
example of encoded data attachment
!type
image/gif
!file
./images/meow.gif
!url
http://www.TiddlyTools.com/images/meow.gif
!data
data:image/gif;base64,R0lGODlhOABQAPcAAAAACAAAEAAICAgICAgLDBAQCAQQGRAIEBgICBAQEBAQGBAYFBoOEhwUFCEYEBgYGA4cIBkgGyEcHCEhISkYGCkcHCEpHCklIRAgMRkmNSElKSEpNikeKykpKSExQiE5QjEhJTEpITEpKSkpMSkxISk1KTExITExKSktNTEpMTEpOTExMSk5MSkxOSkxQik5PTkrKTkxMTE8KTFCMTExOTExQjE5PTFCPTk3MzlCMTkxQjk5QkI0MzlGPUg9M01JNi88TTlEUkI8REJCSkZDRFBDQkY/UFA/TjNMUkNOS1JKSkpWRj1KWEpKWj9OXEVZZlhMRlVLVVpSUlReUFdSYFVhX1JSa1VfbmBbU11ia2dcV3FjXVpldWVkb2tnb3tnbGZ1ZHV6aWVwe3d5c2N4iXN3gntzgHeBiYd2dYWHeoh/jIKLkJWEfZmUh5CNlJ+VkICPn46XpZiSo5WfoJycnKaemaGcqKWlpZWnraWtqa2qoq2lrZavvKW4xK2lta2ws/8A/7WcjLWllLWlpbWlrb2tnMatnLWtpbWtrb2trbWttb2ttbWtvbW1pca1pbW1ra21va21xrW1tbW1vbW1xrW9tb21rb21tb21vb21xr29rb29tca9sca1vc69rda9ra29wa3GxrW9vbW9xq29zrHGyrPB0rXG1r29vb29xr29zr3Gvb3Gxr3Gzr3G1sa9vcbGtc7GtdbGtcbGvc7GvdbGvd7Gvca9xsa9zsbGxsbGzsbG1s7DyNbGxtbGzs7G1rjQ2MbO0sbO3sbW1s7Owc7OzsbW3sbe3s7O1s7W0tbQx+HUzNDQ29bW1tvb1ufa1sPW6dDW4dbW3trY4sni7dbk797e3tbx9N7n3ufe3t7e597n597i7+fe597s9N73++fn3ufn5+fn7+fv5+fv7+/e5+/r4vfr4ufn9+fv9+fv/+/n7+/v8/Pz7/fv9+/v/+f3++f//+/39+/3/+//9+////f37/f39/f3//f/9/f////37//39//3////9////yH5BAEAAIAALAAAAAA4AFAAQAj+AAEJHEiwoMGDCBMqXIiwiA8tXbxIgXHhgY+FICSIiCFFihIeXRgm9OKlDJMqYs506UIDRIUKD7w8kLCiAw0q0ao8WCFhwgQqDx7E+EJHm0gpUaI0ibKDBo0dXeakazEkxYUOGjRMSQOmQw874eR9IHNPXrFba5Y8CLNDyYULGlZQRVjtzJCmTnew2AGp2j19gAGTC6ctnLvDZfWR07AjCJAd4fTduxctFapbiDKTQ7gjSZcsT6PQqLmCxhA78v4GnuxOHuGzeei8kVLkh5I1b9y80XPp0q1s+lK7E3eQjSIvbqJAEiPGjR0/c9REqyavtTx9rVtn09asmJsvbMb+uLlcrFn3YsqsiRM33M3CDlkUsWMnT978cM206Y/WjH+187cEGOArqKCiCCJ00DEHHXXkIdJBEgQVlEsS1iThAwlg+EAXcNgBySiQQILKJWOM8YYy2Tyo4oqA5HELMtxxVwyLNA5UxAUxxPBWjTjGIIIWNSKUhhddUFFFU0O89BZjQ9DQwYUPVKABCEJg8cYZK5aRxRNM0JDCCimkQMUONXUAwlVOKbGDGHhAMEczgemjTV2jXeCTBqZFoZASVDDRxGildTbHX3zUgJeTZ0Cimj5kBLHDEEM0IU59cd6TDmHm7WFQNHDAwcVoT5m2Qg2tAJPYau6wY01/2ohTjDb+Z91hhiK3FMiILnkcWIw1iLlz0BuPquHEFaDWtEMVclyXWpz1pUNONdKkkkoWyEGSqyKXvYJeNtmEo6pRCEkyaX3ykMPOYOWSw41+2rDTGjndNoMMMsXoUkw05SFzXnlnFaiIikpOIIEUbrzaSit+RPFWByK4ocoordzC74iKKHLGFmm4kQciQSIkgQQIIEAAAQ+Q/IDIIieQAAFROPcHI9heUodh2ujT8c0CzcEdt8Ph7DONGgwxxs+A7BADEUT4SOMEMWyBBRYiEA2ID16oYYYZDsXwQGNOMHGFFUz4ucMFND2qRBdmeDEE0Uq0IccWSuDQwdwXXrBCkxVFKOH+VVB8UceMNHohxhVNipDCEBqkoIGUTu70AA4P3PUEYG6cEQXiM0lwwRBryKNiF1dcwYQQDK+wQxZijGYmnk+tsEIVGrgTZ6VniMHUCHZ3EAWQCWlRxe+X47BCy8UEc08GcmfVwVUxLDHFECPoE01TTWhjTRQimBBDEW64QUYTZczBhBcJCTFEFKODSkMUZcAJWDWMjDJHGW4089df3DiRBRDgwzE7YPLgji5uIQmEzIMaeHgU+nbwqCaEaFEAXI82rqOav8gDLgOzjj5c9YpbXEIR2bjHLQ5yBjdw4QxjGs0OOvA6MQSjGrNLjX2akQ1U0KEMXlACDYh0uS3M4Q3+CeoAHbKBmHuE4yBJ6EEXUveomiBuCKhwA3AqOJmypIMb+ILEH1ChhTXoIUEbqwMiXsELZThjOOEgB8cO4gYqKOEMDNxhFKjQBFmFw4IAZM25uJOKMWyhi35gxFk6WAxnqOcw5wKcQdAgJz84shrVcIMfRpEOSMqjGtGoTnVSJY78dIcRf2ADFPwgsbM0Q2LmaRVmGNKGYmzSPvYxFzsqOZ12dSsbACrlq85Sq1sQ6EBrfBAReHI1baTjUuGIhjZ0UZkC3cI89CqPeQrkBzq4IQ1nWMOCCsijoPhgBUKoQstokJUJQOkBSlADJVqRimKgghEwe4MW0KCxZvisIif+QwCUMnShkD2ABmaQAyQoMYoCXYINdCgGcKRmEAkRQAErI4DKgiIHP/wBEoy4hDvN0wxfMXRFo7CXNYh4j492TBG7VJVJV1oQKDBUCzi6WZQuUAai+UAEPvDRBWikEaTxIGo/EwIP/igFH0hARZoTwRC+8AUtFEFqPlCCFryghZtSRE8H6cIOHnABH0iBWl4wwxGgupIiKUEIPqjAqKhihSY4igYjMGcHUrCDKIS1hFKTAlVFAwIq1W19NMCnhCRQgRBAAQ28SIPP1nCGNBTDaXfZQQoq8LGgYAVSILjQBC6wAyEQAQ11SFGNuvC7P+2ACXO4i+kipNYHdIBMppn+hxteRyYqCEwCOJDCHDyqIixoQQxuleyXojA3rFxgBK57ixcmcNozAOYeeAjCGWZiN7hM4AmjUFEVmpCFJrjuSxEhE1ZAYLq7KQFS0RjU/+5xhjI0YQcauEBesKoQM2QBUp113dzm4CjFZaVM8RWCGwA4u3sAowmq1cAE8GQF+iJECXNkwg6E11kmuCEdGSATCLISlyqAwXkQSI0TuACHdBTjDh0Agwmw0EAyiWElCilCEvDrlKfsoAzC0Ecc9uI6DXDVxxPwwgjuAQc8NSEa3UiDMnghu3v8oXZ3QIYX/KCQIdCxKYGiQhei8dw5tHEIXqjCHGAImHR8QAhAuEL+FsrwP8E0QxdwVogC71JjIXShFdcJDH6sUQxFQJAccHCvE87Qh0WVJRrhCJCBFEKNK0yYgZ3NwgrcAIl0zK414qAPAPPsXQvBSR7TrNiBJKGPNyAkGsbgA1NcxwLXuQEPwrA0s9wRDms8N1XuOOYQJLCF/ESDPwOsVR7glCoSliEOZWCgapNwJDm0AoKSqc49FEGFMtyhVqhIWArWoAgF5WEPLmqDfGTXM4M8oQxXSF2kxpSFHbTADX/wS6XIBatmSKILQzAcpMIkhTSo4Q1pGGM2NqmYg1xhd2sYTQqcdAEqJMENmSywJtnBnVsoopomagMQGVSHQVziFc1AETn+qmNPg1CBCkFwQxC+RKa71bUMsnvuZDRZrmog45138HKu6FCxzGhrVdkQRzhEexAiZRMFe2nSClB3B21AsIrycNav34lDN9wiDwW6TBmdEQ720NoaCTmDGqgghnbvQA7ppt8twnKq+rwLktHIgxbaAIU1+AEVxSgGL3hRSF5tkFt3QEgsdOyGO1zUDWVgxK/1lQ53jbwsnNzOKf2giDdAgQ54zzu/aLgePi9kMqZIRzBGMYpfV6PxlaxGu7BjH3FkwxqrwvYYftDO7jxTl2dBRBsYcongkKtcs4w63AszmGaIA1ZnyTtHzaN5iQVIEXpwj0iw4Abr1OdcFKcPu/T+I/lc8rJftapYbOrAItNhQRHyyLS5CMOffb0qGvqqV949WDE63MEN2qRDbGgUg+WtQARbdnr/cUq6wAg5NwfK1H7TdAl+kAd54AYYswYJ8gpBQllcNTdj4AWMEAxyAAE+JiFKIB6jcAvBUC8jAjNugAUmQgfBVCNBAVsLVwVZwAQPYE5Q8hZ/MAqM0AonqAiDoAXioQdEFyTnVIRBoTIJoAAg0AVyYAeRACIjgghh8AaoMFI+gyEhgwAJoE9QQgBaqAAvWAaBdBmXcQd1ACdl8VE6kk8ZsoVJCFEJMGl2MAdzADOv8AYdpQ+8wFIDUTIj44VBAQgeQlC1ogvNgAouykAHFMiHCkEJqtAK0rQqjKgipWcNvyE7k6gip8QOXTeEmcgQbAAI3VByNBIQAAA7
!usage
{{{[img[AttachFileSample2]]}}}
[img[AttachFileSample2]]
!notes
example of external attachment (no embedded data)
!type
image/jpg
!file
./images/meow2.jpg
!url
http://www.TiddlyTools.com/images/meow2.jpg
!data
!General functions
|!Function|!Argument|!Default value|!Unit|!Example|
|setPicture(options)||||
setScales(xmin,xmax,ymin,ymax)
setOptions(atr)
!Drawing functions

++++ grid(options)
|!Argument|!Default value|!Unit|
|dx| 1| IU|
|dy| dx or 3 for polar grid| IU|
|stroke| grey|
|strokewidth| 0.25| px|
|strokeopacity| 1| %/100|
|strokedasharray| none| px|
====
++++ axes(options)
|!Argument|!Default value|!Unit|
|origin| [0,0]| IU|
|dx| 1| IU|
|dy| dx| IU|
|ticklabels| true||
|marker| none||
|stroke| black||
|strokewidth| 0.5| px|
|strokeopacity| 1| %/100|
|strokedasharray| none| px|
====
++++ line(p,q,options)
|!Argument|!Default value|!Unit|
|''p''| | IU|
|''q''| | IU|
|>|>|stroke options|
|>|>|marker options|
|>|>|label options|
====
++++ path(plist,options)
|!Argument|!Default value|!Unit|
|''plist''| | IU|
|closed| false||
|curve| none||
|>|>|stroke options|
|>|>|fill options|
|>|>|marker options|
|>|>|label options|
====
++++ curve(plist,options)
|!Argument|!Default value|!Unit|
|''plist''| | IU|
|closed| false||
|>|>|stroke options|
|>|>|fill options|
|>|>|marker options|
|>|>|label options|
====
++++ vector(p,q,options)
|!Argument|!Default value|!Unit|
|''p''| | IU|
|''q''| | IU|
|>|>|stroke options|
|>|>|label options|
====
++++ circle(center,radius,options)
|!Argument|!Default value|!Unit|
|''center''| | IU|
|''radius''| | IU|
|>|>|stroke options|
|>|>|fill options|
====
++++ loop(p,options)
|!Argument|!Default value|!Unit|
|''p''| | IU|
|direction| [1,0]| IU|
|>|>|stroke options|
|>|>|fill options|
====
++++ arc(options)
|!Argument|!Default value|!Unit|
|''center''| | IU|
|''radius''| | IU|
|>|>|stroke options|
|>|>|fill options|
====
++++ ellipse(center,rx,ry,options)
|!Argument|!Default value|!Unit|
|''center''| | IU|
|''rx''| | IU|
|''ry''| | IU|
|>|>|stroke options|
|>|>|fill options|
====
++++ polygon(plist,options)
|!Argument|!Default value|!Unit|
|''plist''| | IU|
|curve| none||
|>|>|stroke options|
|>|>|fill options|
|>|>|marker options|
|>|>|label options|
====
++++ rect(p,q,options)
|!Argument|!Default value|!Unit|
|''p''| | IU|
|''q''| | IU|
|>|>|stroke options|
|>|>|fill options|
====
++++ text(p,st,options)
|!Argument|!Default value|!Unit|
|''p''| | IU|
|''st''| | IU|
|pos| E||
|fontsize| 12|?|
|fontstyle| normal|?|
|fontfamily| serif||
|fontweight| normal||
|>|>|stroke options|
|>|>|fill options|
====

image(url,options)
dot(p,options)

plot(fun,options)
area(fun1,fun2,options)
polarPlot(fun,options)
parametricPlot(fun1,fun2,options)
slopeField(fun,options)
!Transformations
rotate(id,angle,options)
translate(id,delta,options)
!Dynamic features
setAction(evt,fun)
getPosition(evt)
getAngle(evt,p)
getDistance(evt,p)
setText(st,id)
updatePicture()
$\mathbf{Bold} + xyz$
$abc + \mathbf{Bold} + xyz$

$\mathit{Italic} + xyz$
$abc+\mathit{Italic} + xyz$

$\mathbb{Blackboard} + xyz$
$abc+\mathbb{Blackboard} + xyz$
(:graph({scales:[-3*PI/2,2*PI],coords:"none",borderwidth:5})
 area(sin,cos,{min:-3*PI/4,max:5*PI/4,fill:"blue"});
:)
(:graph({width:540,height:270,scales:[-10,360,-10,90],borderwidth:2,stroke:"white"})

var x, y;

axes({dx:30,dy:10,stroke:"yellow",marker:">"});
for(j=0;j<181;j++){
 x=j*2        // range 0-360
 y=j/2        // range 0-90
 ma=[x, y]  // (x,y) pair
 mb=1       // fill opacity
 mc=0.7     // size
 d="#0f0"   // color
 circle(ma,mc,{stroke:"none",fill:d,fillopacity:mb})
}
:)

(:graph({width:540,height:270,scales:[-20,370,-10,100],borderwidth:2,borderstroke:"white"})
axes({dx:30,dy:10,stroke:"yellow",marker:">",fontfill:"orange"});
dynamic.a = [];
for(dynamic.j=0;dynamic.j<181;dynamic.j++){
 dynamic.a.push([dynamic.j*2,dynamic.j/2]);
}
dynamic.mb=1;       // fill opacity
dynamic.mc=3;     // size
dynamic.d="#0f0";   // color
path(dynamic.a,{stroke:"none",marker:"-o-",size:dynamic.mc,markerstroke:"none",markerfill:"#0f0",markerfillopacity:dynamic.mb});
:)
/***
|Name|CalendarPlugin|
|Source|http://www.TiddlyTools.com/#CalendarPlugin|
|Version|1.5.0|
|Author|Eric Shulman|
|Original Author|SteveRumsby|
|License|unknown|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|display monthly and yearly calendars|
NOTE: For //enhanced// date popup display, optionally install [[DatePlugin]] and [[ReminderMacros]]
!!!Usage:
<<<
|{{{<<calendar>>}}}|full-year calendar for the current year|
|{{{<<calendar year>>}}}|full-year calendar for the specified year|
|{{{<<calendar year month>>}}}|one month calendar for the specified month and year|
|{{{<<calendar thismonth>>}}}|one month calendar for the current month|
|{{{<<calendar lastmonth>>}}}|one month calendar for last month|
|{{{<<calendar nextmonth>>}}}|one month calendar for next month|
|{{{<<calendar +n>>}}}<br>{{{<<calendar -n>>}}}|one month calendar for a month +/- 'n' months from now|
<<<
!!!Configuration:
<<<
|''First day of week:''<br>{{{config.options.txtCalFirstDay}}}|<<option txtCalFirstDay>>|(Monday = 0, Sunday = 6)|
|''First day of weekend:''<br>{{{config.options.txtCalStartOfWeekend}}}|<<option txtCalStartOfWeekend>>|(Monday = 0, Sunday = 6)|

<<option chkDisplayWeekNumbers>> Display week numbers //(note: Monday will be used as the start of the week)//
|''Week number display format:''<br>{{{config.options.txtWeekNumberDisplayFormat }}}|<<option txtWeekNumberDisplayFormat >>|
|''Week number link format:''<br>{{{config.options.txtWeekNumberLinkFormat }}}|<<option txtWeekNumberLinkFormat >>|
<<<
!!!Revisions
<<<
2009.04.31 [1.5.0] rewrote onClickCalendarDate() (popup handler) and added config.options.txtCalendarReminderTags.  Partial code reduction/cleanup.  Assigned true version number (1.5.0)
2008.09.10 added '+n' (and '-n') param to permit display of relative months (e.g., '+6' means 'six months from now', '-3' means 'three months ago'.  Based on suggestion from Jean.
2008.06.17 added support for config.macros.calendar.todaybg
2008.02.27 in handler(), DON'T set hard-coded default date format, so that *customized* value (pre-defined in config.macros.calendar.journalDateFmt is used.
2008.02.17 in createCalendarYear(), fix next/previous year calculation (use parseInt() to convert to numeric value).  Also, use journalDateFmt for date linking when NOT using [[DatePlugin]].
2008.02.16 in createCalendarDay(), week numbers now created as TiddlyLinks, allowing quick creation/navigation to 'weekly' journals (based on request from Kashgarinn)
2008.01.08 in createCalendarMonthHeader(), 'month year' heading is now created as TiddlyLink, allowing quick creation/navigation to 'month-at-a-time' journals
2007.11.30 added 'return false' to onclick handlers (prevent IE from opening blank pages)
2006.08.23 added handling for weeknumbers (code supplied by Martin Budden (see 'wn**' comment marks).  Also, incorporated updated by Jeremy Sheeley to add caching for reminders (see [[ReminderMacros]], if installed)
2005.10.30 in config.macros.calendar.handler(), use 'tbody' element for IE compatibility.  Also, fix year calculation for IE's getYear() function (which returns '2005' instead of '105'). Also, in createCalendarDays(), use showDate() function (see [[DatePlugin]], if installed) to render autostyled date with linked popup.  Updated calendar stylesheet definition: use .calendar class-specific selectors, add text centering and margin settings
2006.05.29 added journalDateFmt handling
<<<
!!!Code
***/
//{{{
version.extensions.CalendarPlugin= { major: 1, minor: 5, revision: 0, date: new Date(2009,5,31)};
//}}}
//{{{
if(config.options.txtCalFirstDay == undefined)
	config.options.txtCalFirstDay = 0;
if(config.options.txtCalStartOfWeekend == undefined)
	config.options.txtCalStartOfWeekend = 5;
if(config.options.chkDisplayWeekNumbers == undefined)
	config.options.chkDisplayWeekNumbers = false;
if(config.options.chkDisplayWeekNumbers)
	config.options.txtCalFirstDay = 0;
if(config.options.txtWeekNumberDisplayFormat == undefined)
	config.options.txtWeekNumberDisplayFormat = 'w0WW';
if(config.options.txtWeekNumberLinkFormat == undefined)
	config.options.txtWeekNumberLinkFormat = 'YYYY-w0WW';
if(config.options.txtCalendarReminderTags == undefined)
	config.options.txtCalendarReminderTags = 'reminder';

config.macros.calendar = {
	monthnames:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
	daynames:['M','T','W','T','F','S','S'],
	todaybg:'#ccccff',
	weekendbg:'#c0c0c0',
	monthbg:'#e0e0e0',
	holidaybg:'#ffc0c0',
	journalDateFmt:'DD MMM YYYY',
	monthdays:[31,28,31,30,31,30,31,31,30,31,30,31],
	holidays:[ ] // for customization see [[CalendarPluginConfig]]
};
//}}}
//{{{
function calendarIsHoliday(date)
{
	var longHoliday = date.formatString('0DD/0MM/YYYY');
	var shortHoliday = date.formatString('0DD/0MM');
	for(var i = 0; i < config.macros.calendar.holidays.length; i++) {
		if(   config.macros.calendar.holidays[i]==longHoliday
		   || config.macros.calendar.holidays[i]==shortHoliday)
			return true;
	}
	return false;
}
//}}}
//{{{
config.macros.calendar.handler = function(place,macroName,params) {
	var calendar = createTiddlyElement(place, 'table', null, 'calendar', null);
	var tbody = createTiddlyElement(calendar, 'tbody');
	var today = new Date();
	var year = today.getYear();
	if (year<1900) year+=1900;

 	// get journal format from SideBarOptions (ELS 5/29/06 - suggested by MartinBudden)
	var text = store.getTiddlerText('SideBarOptions');
	var re = new RegExp('<<(?:newJournal)([^>]*)>>','mg'); var fm = re.exec(text);
	if (fm && fm[1]!=null) { var pa=fm[1].readMacroParams(); if (pa[0]) this.journalDateFmt = pa[0]; }

	var month=-1;
	if (params[0] == 'thismonth') {
		var month=today.getMonth();
	} else if (params[0] == 'lastmonth') {
		var month = today.getMonth()-1; if (month==-1) { month=11; year--; }
	} else if (params[0] == 'nextmonth') {
		var month = today.getMonth()+1; if (month>11) { month=0; year++; }
	} else if (params[0]&&'+-'.indexOf(params[0].substr(0,1))!=-1) {
		var month = today.getMonth()+parseInt(params[0]);
		if (month>11) { year+=Math.floor(month/12); month%=12; };
		if (month<0)  { year+=Math.floor(month/12); month=12+month%12; }
	} else if (params[0]) {
		year = params[0];
		if(params[1]) month=parseInt(params[1])-1;
		if (month>11) month=11; if (month<0) month=0;
	}

	if (month!=-1) {
		cacheReminders(new Date(year, month, 1, 0, 0), 31);
		createCalendarOneMonth(tbody, year, month);
	} else {
		cacheReminders(new Date(year, 0, 1, 0, 0), 366);
		createCalendarYear(tbody, year);
	}
	window.reminderCacheForCalendar = null;
}
//}}}
//{{{
// cache used to store reminders while the calendar is being rendered
// it will be renulled after the calendar is fully rendered.
window.reminderCacheForCalendar = null;
//}}}
//{{{
function cacheReminders(date, leadtime)
{
	if (window.findTiddlersWithReminders == null) return;
	window.reminderCacheForCalendar = {};
	var leadtimeHash = [];
	leadtimeHash [0] = 0;
	leadtimeHash [1] = leadtime;
	var t = findTiddlersWithReminders(date, leadtimeHash, null, 1);
	for(var i = 0; i < t.length; i++) {
		//just tag it in the cache, so that when we're drawing days, we can bold this one.
		window.reminderCacheForCalendar[t[i]['matchedDate']] = 'reminder:' + t[i]['params']['title']; 
	}
}
//}}}
//{{{
function createCalendarOneMonth(calendar, year, mon)
{
	var row = createTiddlyElement(calendar, 'tr');
	createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon]+' '+year, true, year, mon);
	row = createTiddlyElement(calendar, 'tr');
	createCalendarDayHeader(row, 1);
	createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}
//{{{
function createCalendarMonth(calendar, year, mon)
{
	var row = createTiddlyElement(calendar, 'tr');
	createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon]+' '+ year, false, year, mon);
	row = createTiddlyElement(calendar, 'tr');
	createCalendarDayHeader(row, 1);
	createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}
//{{{
function createCalendarYear(calendar, year)
{
	var row;
	row = createTiddlyElement(calendar, 'tr');
	var back = createTiddlyElement(row, 'td');
	var backHandler = function() {
		removeChildren(calendar);
		createCalendarYear(calendar, parseInt(year)-1);
		return false; // consume click
	};
	createTiddlyButton(back, '<', 'Previous year', backHandler);
	back.align = 'center';
	var yearHeader = createTiddlyElement(row, 'td', null, 'calendarYear', year);
	yearHeader.align = 'center';
	yearHeader.setAttribute('colSpan',config.options.chkDisplayWeekNumbers?22:19);//wn**
	var fwd = createTiddlyElement(row, 'td');
	var fwdHandler = function() {
		removeChildren(calendar);
		createCalendarYear(calendar, parseInt(year)+1);
		return false; // consume click
	};
	createTiddlyButton(fwd, '>', 'Next year', fwdHandler);
	fwd.align = 'center';
	createCalendarMonthRow(calendar, year, 0);
	createCalendarMonthRow(calendar, year, 3);
	createCalendarMonthRow(calendar, year, 6);
	createCalendarMonthRow(calendar, year, 9);
}
//}}}
//{{{
function createCalendarMonthRow(cal, year, mon)
{
	var row = createTiddlyElement(cal, 'tr');
	createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon], false, year, mon);
	createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+1], false, year, mon);
	createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+2], false, year, mon);
	row = createTiddlyElement(cal, 'tr');
	createCalendarDayHeader(row, 3);
	createCalendarDayRows(cal, year, mon);
}
//}}}
//{{{
function createCalendarMonthHeader(cal, row, name, nav, year, mon)
{
	var month;
	if (nav) {
		var back = createTiddlyElement(row, 'td');
		back.align = 'center';
		back.style.background = config.macros.calendar.monthbg;

		var backMonHandler = function() {
			var newyear = year;
			var newmon = mon-1;
			if(newmon == -1) { newmon = 11; newyear = newyear-1;}
			removeChildren(cal);
			cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);
			createCalendarOneMonth(cal, newyear, newmon);
			return false; // consume click
		};
		createTiddlyButton(back, '<', 'Previous month', backMonHandler);
		month = createTiddlyElement(row, 'td', null, 'calendarMonthname')
		createTiddlyLink(month,name,true);
		month.setAttribute('colSpan', config.options.chkDisplayWeekNumbers?6:5);//wn**
		var fwd = createTiddlyElement(row, 'td');
		fwd.align = 'center';
		fwd.style.background = config.macros.calendar.monthbg; 

		var fwdMonHandler = function() {
			var newyear = year;
			var newmon = mon+1;
			if(newmon == 12) { newmon = 0; newyear = newyear+1;}
			removeChildren(cal);
			cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);
			createCalendarOneMonth(cal, newyear, newmon);
			return false; // consume click
		};
		createTiddlyButton(fwd, '>', 'Next month', fwdMonHandler);
	} else {
		month = createTiddlyElement(row, 'td', null, 'calendarMonthname', name)
		month.setAttribute('colSpan',config.options.chkDisplayWeekNumbers?8:7);//wn**
	}
	month.align = 'center';
	month.style.background = config.macros.calendar.monthbg;
}
//}}}
//{{{
function createCalendarDayHeader(row, num)
{
	var cell;
	for(var i = 0; i < num; i++) {
		if (config.options.chkDisplayWeekNumbers) createTiddlyElement(row, 'td');//wn**
		for(var j = 0; j < 7; j++) {
			var d = j + (config.options.txtCalFirstDay - 0);
			if(d > 6) d = d - 7;
			cell = createTiddlyElement(row, 'td', null, null, config.macros.calendar.daynames[d]);
			if(d == (config.options.txtCalStartOfWeekend-0) || d == (config.options.txtCalStartOfWeekend-0+1))
				cell.style.background = config.macros.calendar.weekendbg;
		}
	}
}
//}}}
//{{{
function createCalendarDays(row, col, first, max, year, mon) {
	var i;
	if (config.options.chkDisplayWeekNumbers){
		if (first<=max) {
			var ww = new Date(year,mon,first);
			var td=createTiddlyElement(row, 'td');//wn**
			var link=createTiddlyLink(td,ww.formatString(config.options.txtWeekNumberLinkFormat),false);
			link.appendChild(document.createTextNode(
				ww.formatString(config.options.txtWeekNumberDisplayFormat)));
		}
		else createTiddlyElement(row, 'td');//wn**
	}
	for(i = 0; i < col; i++)
		createTiddlyElement(row, 'td');
	var day = first;
	for(i = col; i < 7; i++) {
		var d = i + (config.options.txtCalFirstDay - 0);
		if(d > 6) d = d - 7;
		var daycell = createTiddlyElement(row, 'td');
		var isaWeekend=((d==(config.options.txtCalStartOfWeekend-0)
			|| d==(config.options.txtCalStartOfWeekend-0+1))?true:false);
		if(day > 0 && day <= max) {
			var celldate = new Date(year, mon, day);
			// ELS 10/30/05 - use <<date>> macro's showDate() function to create popup
			// ELS 05/29/06 - use journalDateFmt 
			if (window.showDate) showDate(daycell,celldate,'popup','DD',
				config.macros.calendar.journalDateFmt,true, isaWeekend);
			else {
				if(isaWeekend) daycell.style.background = config.macros.calendar.weekendbg;
				var title = celldate.formatString(config.macros.calendar.journalDateFmt);
				if(calendarIsHoliday(celldate))
					daycell.style.background = config.macros.calendar.holidaybg;
				var now=new Date();
				if ((now-celldate>=0) && (now-celldate<86400000)) // is today?
					daycell.style.background = config.macros.calendar.todaybg;
				if(window.findTiddlersWithReminders == null) {
					var link = createTiddlyLink(daycell, title, false);
					link.appendChild(document.createTextNode(day));
				} else
					var button = createTiddlyButton(daycell, day, title, onClickCalendarDate);
			}
		}
		day++;
	}
}
//}}}
//{{{
// Create a pop-up containing:
// * a link to a tiddler for this date
// * a 'new tiddler' link to add a reminder for this date
// * links to current reminders for this date
// NOTE: this code is only used if [[ReminderMacros]] is installed AND [[DatePlugin]] is //not// installed.
function onClickCalendarDate(ev) { ev=ev||window.event;
	var d=new Date(this.getAttribute('title')); var date=d.formatString(config.macros.calendar.journalDateFmt);
	var p=Popup.create(this);  if (!p) return;
	createTiddlyLink(createTiddlyElement(p,'li'),date,true);
	var rem='\\n\\<\\<reminder day:%0 month:%1 year:%2 title: \\>\\>';
	rem=rem.format([d.getDate(),d.getMonth()+1,d.getYear()+1900]);
	var cmd="<<newTiddler label:[[new reminder...]] prompt:[[add a new reminder to '%0']]"
		+" title:[[%0]] text:{{store.getTiddlerText('%0','')+'%1'}} tag:%2>>";
	wikify(cmd.format([date,rem,config.options.txtCalendarReminderTags]),p);
	createTiddlyElement(p,'hr');
	var t=findTiddlersWithReminders(d,[0,31],null,1);
	for(var i=0; i<t.length; i++) {
		var link=createTiddlyLink(createTiddlyElement(p,'li'), t[i].tiddler, false);
		link.appendChild(document.createTextNode(t[i]['params']['title']));
	}
	Popup.show(); ev.cancelBubble=true; if (ev.stopPropagation) ev.stopPropagation(); return false;
}
//}}}
//{{{
function calendarMaxDays(year, mon)
{
	var max = config.macros.calendar.monthdays[mon];
	if(mon == 1 && (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0)) max++;
	return max;
}
//}}}
//{{{
function createCalendarDayRows(cal, year, mon)
{
	var row = createTiddlyElement(cal, 'tr');
	var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
	if(first1 < 0) first1 = first1 + 7;
	var day1 = -first1 + 1;
	var first2 = (new Date(year, mon+1, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
	if(first2 < 0) first2 = first2 + 7;
	var day2 = -first2 + 1;
	var first3 = (new Date(year, mon+2, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
	if(first3 < 0) first3 = first3 + 7;
	var day3 = -first3 + 1;

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

	while(day1 <= max1 || day2 <= max2 || day3 <= max3) {
		row = createTiddlyElement(cal, 'tr');
		createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
		createCalendarDays(row, 0, day2, max2, year, mon+1); day2 += 7;
		createCalendarDays(row, 0, day3, max3, year, mon+2); day3 += 7;
	}
}
//}}}
//{{{
function createCalendarDayRowsSingle(cal, year, mon)
{
	var row = createTiddlyElement(cal, 'tr');
	var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
	if(first1 < 0) first1 = first1+ 7;
	var day1 = -first1 + 1;
	var max1 = calendarMaxDays(year, mon);
	while(day1 <= max1) {
		row = createTiddlyElement(cal, 'tr');
		createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
	}
}
//}}}
//{{{
setStylesheet('.calendar, .calendar table, .calendar th, .calendar tr, .calendar td { text-align:center; } .calendar, .calendar a { margin:0px !important; padding:0px !important; }', 'calendarStyles');
//}}}
// // override cookie settings for CalendarPlugin:
//{{{
config.options.txtCalFirstDay=6;
config.options.txtCalStartOfWeekend=5;
//}}}

// // override internal default settings for CalendarPlugin:
//{{{
config.macros.calendar.journalDateFmt="DDD MMM 0DD YYYY";
//}}}
There are several ways to change the font style of math expressions.
!1. Globally
!!a) Setting a plugin option on start
Change and uncomment the following three lines in MathSVGPluginComp. Save and reload the TW.
//{{{
MSVG.mathColor = "green"; //font color
MSVG.mathFontSize = ""; //font size
MSVG.mathFontFamily = ""; //font family
//}}}
!!b) Using CSS
Change and include the following code in your StyleSheet.
//{{{
mstyle{
 color: red;
 font-size: 150%;
 font-family: "Bitstream Vera Serif", "Times New Roman", serif
}
//}}}
!2. Locally
!!a) Affecting a single tiddler
Change and include the following code in your StyleSheet,
//{{{
#tiddlerMoreLaTeX mstyle{
 color: red;
 font-size: 150%;
}
//}}}
to change the style of all math expressions in the tiddler MoreLaTeX.
!!b) Affecting custom expressions
Change and include the following code in your StyleSheet,
//{{{
.myMath mstyle{
 font-family: "Bitstream Vera Sans";
 background: blue;
 color: yellow;
 font-size: 120%
}
//}}}
to change the style of all math expressions marked with the //myMath// custom CSS class, as in the tiddler  LaTeXExamples.
/***
|Name|CheckboxPlugin|
|Source|http://www.TiddlyTools.com/#CheckboxPlugin|
|Documentation|http://www.TiddlyTools.com/#CheckboxPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Add checkboxes to your tiddler content|
This plugin extends the TiddlyWiki syntax to allow definition of checkboxes that can be embedded directly in tiddler content.  Checkbox states are preserved by:
* by setting/removing tags on specified tiddlers,
* or, by setting custom field values on specified tiddlers,
* or, by saving to a locally-stored cookie ID,
* or, automatically modifying the tiddler content (deprecated)
When an ID is assigned to the checkbox, it enables direct programmatic access to the checkbox DOM element, as well as creating an entry in TiddlyWiki's config.options[ID] internal data.  In addition to tracking the checkbox state, you can also specify custom javascript for programmatic initialization and onClick event handling for any checkbox, so you can provide specialized side-effects in response to state changes.
!!!!!Documentation
>see [[CheckboxPluginInfo]]
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to [[CheckboxPluginInfo]]
2008.01.05 [2.4.0] set global "window.place" to current checkbox element when processing checkbox clicks.  This allows init/beforeClick/afterClick handlers to reference RELATIVE elements, including using "story.findContainingTiddler(place)".  Also, wrap handlers in "function()" so "return" can be used within handler code.
|please see [[CheckboxPluginInfo]] for additional revision details|
2005.12.07 [0.9.0] initial BETA release
<<<
!!!!!Code
***/
//{{{
version.extensions.CheckboxPlugin = {major: 2, minor: 4, revision:0 , date: new Date(2008,1,5)};
//}}}
//{{{
config.checkbox = { refresh: { tagged:true, tagging:true, container:true } };
config.formatters.push( {
	name: "checkbox",
	match: "\\[[xX_ ][\\]\\=\\(\\{]",
	lookahead: "\\[([xX_ ])(=[^\\s\\(\\]{]+)?(\\([^\\)]*\\))?({[^}]*})?({[^}]*})?({[^}]*})?\\]",
	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) {
			// get params
			var checked=(lookaheadMatch[1].toUpperCase()=="X");
			var id=lookaheadMatch[2];
			var target=lookaheadMatch[3];
			if (target) target=target.substr(1,target.length-2).trim(); // trim off parentheses
			var fn_init=lookaheadMatch[4];
			var fn_clickBefore=lookaheadMatch[5];
			var fn_clickAfter=lookaheadMatch[6];
			var tid=story.findContainingTiddler(w.output);  if (tid) tid=tid.getAttribute("tiddler");
			var srctid=w.tiddler?w.tiddler.title:null;
			config.macros.checkbox.create(w.output,tid,srctid,w.matchStart+1,checked,id,target,config.checkbox.refresh,fn_init,fn_clickBefore,fn_clickAfter);
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} );
config.macros.checkbox = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!(tiddler instanceof Tiddler)) { // if no tiddler passed in try to find one
			var here=story.findContainingTiddler(place);
			if (here) tiddler=store.getTiddler(here.getAttribute("tiddler"))
		}
		var srcpos=0; // "inline X" not applicable to macro syntax
		var target=params.shift(); if (!target) target="";
		var defaultState=params[0]=="checked"; if (defaultState) params.shift();
		var id=params.shift(); if (id && !id.length) id=null;
		var fn_init=params.shift(); if (fn_init && !fn_init.length) fn_init=null;
		var fn_clickBefore=params.shift();
		if (fn_clickBefore && !fn_clickBefore.length) fn_clickBefore=null;
		var fn_clickAfter=params.shift();
		if (fn_clickAfter && !fn_clickAfter.length) fn_clickAfter=null;
		var refresh={ tagged:true, tagging:true, container:false };
		this.create(place,tiddler.title,tiddler.title,0,defaultState,id,target,refresh,fn_init,fn_clickBefore,fn_clickAfter);
	},
	create: function(place,tid,srctid,srcpos,defaultState,id,target,refresh,fn_init,fn_clickBefore,fn_clickAfter) {
		// create checkbox element
		var c = document.createElement("input");
		c.setAttribute("type","checkbox");
		c.onclick=this.onClickCheckbox;
		c.srctid=srctid; // remember source tiddler
		c.srcpos=srcpos; // remember location of "X"
		c.container=tid; // containing tiddler (may be null if not in a tiddler)
		c.tiddler=tid; // default target tiddler 
		c.refresh = {};
		c.refresh.container = refresh.container;
		c.refresh.tagged = refresh.tagged;
		c.refresh.tagging = refresh.tagging;
		place.appendChild(c);
		// set default state
		c.checked=defaultState;
		// track state in config.options.ID
		if (id) {
			c.id=id.substr(1); // trim off leading "="
			if (config.options[c.id]!=undefined)
				c.checked=config.options[c.id];
			else
				config.options[c.id]=c.checked;
		}
		// track state in (tiddlername|tagname) or (fieldname@tiddlername)
		if (target) {
			var pos=target.indexOf("@");
			if (pos!=-1) {
				c.field=pos?target.substr(0,pos):"checked"; // get fieldname (or use default "checked")
				c.tiddler=target.substr(pos+1); // get specified tiddler name (if any)
				if (!c.tiddler || !c.tiddler.length) c.tiddler=tid; // if tiddler not specified, default == container
				if (store.getValue(c.tiddler,c.field)!=undefined)
					c.checked=(store.getValue(c.tiddler,c.field)=="true"); // set checkbox from saved state
			} else {
				var pos=target.indexOf("|"); if (pos==-1) var pos=target.indexOf(":");
				c.tag=target;
				if (pos==0) c.tag=target.substr(1); // trim leading "|" or ":"
				if (pos>0) { c.tiddler=target.substr(0,pos); c.tag=target.substr(pos+1); }
				if (!c.tag.length) c.tag="checked";
				var t=store.getTiddler(c.tiddler);
				if (t && t.tags)
					c.checked=t.isTagged(c.tag); // set checkbox from saved state
			}
		}
		// trim off surrounding { and } delimiters from init/click handlers
		if (fn_init) c.fn_init="(function(){"+fn_init.trim().substr(1,fn_init.length-2)+"})()";
		if (fn_clickBefore) c.fn_clickBefore="(function(){"+fn_clickBefore.trim().substr(1,fn_clickBefore.length-2)+"})()";
		if (fn_clickAfter) c.fn_clickAfter="(function(){"+fn_clickAfter.trim().substr(1,fn_clickAfter.length-2)+"})()";
		c.init=true; c.onclick(); c.init=false; // compute initial state and save in tiddler/config/cookie
	},
	onClickCheckbox: function(event) {
		window.place=this;
		if (this.init && this.fn_init) // custom function hook to set initial state (run only once)
			{ try { eval(this.fn_init); } catch(e) { displayMessage("Checkbox init error: "+e.toString()); } }
		if (!this.init && this.fn_clickBefore) // custom function hook to override changes in checkbox state
			{ try { eval(this.fn_clickBefore) } catch(e) { displayMessage("Checkbox onClickBefore error: "+e.toString()); } }
		if (this.id)
			// save state in config AND cookie (only when ID starts with 'chk')
			{ config.options[this.id]=this.checked; if (this.id.substr(0,3)=="chk") saveOptionCookie(this.id); }
		if (this.srctid && this.srcpos>0 && (!this.id || this.id.substr(0,3)!="chk") && !this.tag && !this.field) {
			// save state in tiddler content only if not using cookie, tag or field tracking
			var t=store.getTiddler(this.srctid); // put X in original source tiddler (if any)
			if (t && this.checked!=(t.text.substr(this.srcpos,1).toUpperCase()=="X")) { // if changed
				t.set(null,t.text.substr(0,this.srcpos)+(this.checked?"X":"_")+t.text.substr(this.srcpos+1),null,null,t.tags);
				if (!story.isDirty(t.title)) story.refreshTiddler(t.title,null,true);
				store.setDirty(true);
			}
		}
		if (this.field) {
			if (this.checked && !store.tiddlerExists(this.tiddler))
				store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
			// set the field value in the target tiddler
			store.setValue(this.tiddler,this.field,this.checked?"true":"false");
			// DEBUG: displayMessage(this.field+"@"+this.tiddler+" is "+this.checked);
		}
		if (this.tag) {
			if (this.checked && !store.tiddlerExists(this.tiddler))
				store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
			var t=store.getTiddler(this.tiddler);
			if (t) {
				var tagged=(t.tags && t.tags.indexOf(this.tag)!=-1);
				if (this.checked && !tagged) { t.tags.push(this.tag); store.setDirty(true); }
				if (!this.checked && tagged) { t.tags.splice(t.tags.indexOf(this.tag),1); store.setDirty(true); }
			}
			// if tag state has been changed, update display of corresponding tiddlers (unless they are in edit mode...)
			if (this.checked!=tagged) {
				if (this.refresh.tagged) {
					if (!story.isDirty(this.tiddler)) // the TAGGED tiddler in view mode
						story.refreshTiddler(this.tiddler,null,true); 
					else // the TAGGED tiddler in edit mode (with tags field)
						config.macros.checkbox.refreshEditorTagField(this.tiddler,this.tag,this.checked);
				}
				if (this.refresh.tagging)
					if (!story.isDirty(this.tag)) story.refreshTiddler(this.tag,null,true); // the TAGGING tiddler
			}
		}
		if (!this.init && this.fn_clickAfter) // custom function hook to react to changes in checkbox state
			{ try { eval(this.fn_clickAfter) } catch(e) { displayMessage("Checkbox onClickAfter error: "+e.toString()); } }
		// refresh containing tiddler (but not during initial rendering, or we get an infinite loop!) (and not when editing container)
		if (!this.init && this.refresh.container && this.container!=this.tiddler)
			if (!story.isDirty(this.container)) story.refreshTiddler(this.container,null,true); // the tiddler CONTAINING the checkbox
		return true;
	},
	refreshEditorTagField: function(title,tag,set) {
		var tagfield=story.getTiddlerField(title,"tags");
		if (!tagfield||tagfield.getAttribute("edit")!="tags") return; // if no tags field in editor (i.e., custom template)
		var tags=tagfield.value.readBracketedList();
		if (tags.contains(tag)==set) return; // if no change needed
		if (set) tags.push(tag); // add tag
		else tags.splice(tags.indexOf(tag),1); // remove tag
		for (var t=0;t<tags.length;t++) tags[t]=String.encodeTiddlyLink(tags[t]);
		tagfield.value=tags.join(" "); // reassemble tag string (with brackets as needed)
		return;
	}
}
//}}}
|Name|CheckboxPluginInfo|
|Source|http://www.TiddlyTools.com/#CheckboxPlugin|
|Documentation|http://www.TiddlyTools.com/#CheckboxPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|documentation for CheckboxPlugin|
This plugin extends the TiddlyWiki syntax to allow definition of checkboxes that can be embedded directly in tiddler content.  Checkbox states are preserved by:
* setting/removing tags on specified tiddlers,
* or, setting custom field values on specified tiddlers,
* or, saving to a locally-stored cookie ID,
* or, automatically modifying the tiddler source content (deprecated).
When an ID is assigned to the checkbox, it enables direct programmatic access to the checkbox DOM element, as well as creating an entry in TiddlyWiki's config.options[ID] internal data.  In addition to tracking the checkbox state, you can also specify custom javascript for programmatic initialization and onClick event handling for any checkbox, so you can provide specialized side-effects in response to state changes.
!!!!!Inline (wiki syntax) Usage
<<<
//{{{
[ ]or[_] and [x]or[X]
//}}}
Simple checkboxes using 'Inline X' storage.  The current unchecked/checked state is indicated by the character between the {{{[}}} and {{{]}}} brackets ("_" means unchecked, "X" means checked).  When you click on a checkbox, the current state is retained by directly modifying the tiddler content to place the corresponding "_" or "X" character in between the brackets.
>//''NOTE: 'Inline X' syntax has been deprecated...''  This storage format only works properly for checkboxes that are directly embedded and accessed from content in a single tiddler.  However, if that tiddler is 'transcluded' into another (by using the {{{<<tiddler TiddlerName>>}}} macro), the 'Inline X' will be ''erroneously stored in the containing tiddler's source content, resulting in corrupted content in that tiddler.''  For anything but the most simple of "to do list" uses, you should select from the various alternative storage methods described below...//
//{{{
[x=id]
//}}}
Assign an optional ID to the checkbox so you can use {{{document.getElementByID("id")}}} to manipulate the checkbox DOM element, as well as tracking the current checkbox state in {{{config.options["id"]}}}.  If the ID starts with "chk" the checkbox state will also be saved in a cookie, so it can be automatically restored whenever the checkbox is re-rendered (overrides any default {{{[x]}}} or {{{[_]}}} value).  If a cookie value is kept, the "_" or "X" character in the tiddler content remains unchanged, and is only applied as the default when a cookie-based value is not currently defined.
//{{{
[x(title|tag)] or [x(title:tag)]
//}}}
Initializes and tracks the current checkbox state by setting or removing a particular tag value from a specified tiddler.  If you omit the tiddler title (and the | or : separator), the specified tag is assigned to the current tiddler.  If you omit the tag value, as in {{{(title|)}}}, the default tag, {{{checked}}}, is assumed.  Omitting both the title and tag, {{{()}}}, tracks the checkbox state by setting the "checked" tag on the current tiddler.  When tag tracking is used, the "_" or "X" character in the tiddler content remains unchanged, and is not used to set or track the checkbox state.  If a tiddler title named in the tag does not exist, the checkbox state defaults to the "inline X" value.  If this value is //checked//, or is subsequently changed to //checked//, it will automatically create the missing tiddler and then add the tag to it.  //''NOTE: beginning with version 2.1.2 of this plugin, the "|" separator is the preferred separator between the title and tag name, as it avoids syntactic ambiguity when ":" is used within tiddler titles or tag names.''//
//{{{
[x(field@tiddler)]
//}}}
Initializes and tracks the current checkbox state by setting a particular custom field value from a specified tiddler.  If you omit the tiddler title (but not the "@" separator), the specified field on the current tiddler is used.  If you omit the field name, as in {{{(@tiddler)}}}, a default fieldname of {{{checked}}} is assumed.  Omitting both the field and the tiddler title, {{{(@)}}}, defaults to setting the "checked" field on the current tiddler.  When field tracking is used, the "_" or "X" character in the tiddler content remains unchanged, and is not used to set or track the checkbox state.  If the tiddler title named in the parameter does not exist, the checkbox state defaults to the "inline X" value.  If this value is //checked// or is subsequently changed to //checked//, it will automatically create the missing tiddler and then add the field to it.
//{{{
[x{javascript}{javascript}{javascript}]
//}}}
You can define optional javascript code segments to add custom initialization and/or 'onClick' handlers to a checkbox.  The current checkbox state (and it's other DOM attributes) can be set or read from within these code segments by reference to a globally-defined context object, "place" (which can also be referenced as "window.place").

The first code segment will be executed when the checkbox is initially displayed, so that you can programmatically determine it's starting checked/unchecked state.  The second code segment (if present) is executed whenever the checkbox is clicked, but //before the regular checkbox processing in performed// ("onClickBefore"), so that you can apply programmed responses or intercept and override the checkbox state based on custom logic.  The third code segment (if present) is executed whenver the checkbox is clicked, //after the regular checkbox processing has completed// ("onClickAfter"), so that you can include "side-effect" processing based on the checkbox state just applied.

>Note: if you want to use the default checkbox initialization processing with a custom onClickBefore/After function, use this syntax:
>{{{[x(tag){}{javascript}]}}} or {{{[x(tag){}{}{javascript}]}}}
<<<
!!!!!Macro usage
<<<
In addition to embedded checkboxes using the wiki syntax described above, a ''macro-based syntax'' is also provided, for use in templates where wiki syntax cannot be directly used.  This macro syntax can also be used in tiddler content, as an alternative to the wiki syntax.  When embedded in [[PageTemplate]], [[ViewTemplate]], or [[EditTemplate]] (or custom alternative templates), use the following macro syntax:
//{{{
<span macro="checkbox target checked id onInit onClickBefore onClickAfter"></span>
//}}}
or, when embedded in tiddler content, use the following macro syntax:
//{{{
<<checkbox target checked id onInit onClickBefore onClickAfter>>
//}}}
where:
''target''
>is either a tag reference (e.g., ''tagname|tiddlername'') or a field reference (e.g. ''fieldname@tiddlername''), as described above.
''checked'' (optional)
>is a keyword that sets the initial state of the checkbox to "checked".  When omitted, the default checkbox state is "unchecked".
''id'' (optional)
>specifies an internal config.options.* ID, as described above.  If the ID begins with "chk", a cookie-based persistent value will be created to track the checkbox state in between sessions.
''onInit'' (optional)
>contains a javascript event handler to be performed when the checkbox is initially rendered (see details above).
''onClickBefore'' and/or ''onClickAfter'' (optional)
>contains a javascript event handler to be performed each time the checkbox is clicked (see details above).  //note: to use the default onInit handler with a custom onClickBefore/After handler, use "" (empty quotes) or {} (empty function) as a placeholder for the onInit and/or onClickBefore parameters//
<<<
!!!!!Examples
<<<
''checked and unchecked static default ("inline X") values:''
//{{{
[X] label
[_] label
//}}}
>[X] label
>[_] label
''document-based value (id='demo', no cookie):''
//{{{
[_=demo] label
//}}}
>[_=demo] label
''cookie-based value  (id='chkDemo'):''





//{{{
[_=chkDemo] label
//}}}
>[_=chkDemo] label
''tag-based value (TogglyTagging):''
//{{{
[_(CheckboxPluginInfo|demotag)]
[_(CheckboxPluginInfo|demotag){place.refresh.tagged=place.refresh.container=false}]
//}}}
>[_(CheckboxPluginInfo|demotag)] toggle 'demotag' (and refresh tiddler display)
>[_(CheckboxPluginInfo|demotag){place.refresh.tagged=place.refresh.container=false}] toggle 'demotag' (no refresh)
''field-based values:''
//{{{
[_(demofield@CheckboxPluginInfo)] demofield@CheckboxPluginInfo
[_(demofield@)] demofield@ (equivalent to demonfield@ current tiddler)
[_(checked@CheckboxPluginInfo)] checked@CheckboxPluginInfo
[_(@CheckboxPluginInfo)] @CheckboxPluginInfo
[_(@)] @ (equivalent to checked@ current tiddler)
//}}}
>[_(demofield@CheckboxPluginInfo)] demofield@CheckboxPluginInfo
>[_(demofield@)] demofield@ (current tiddler)
>[_(checked@CheckboxPluginInfo)] checked@CheckboxPluginInfo
>[_(@CheckboxPluginInfo)] @CheckboxPluginInfo
>[_(@)] toggle field: @ (defaults to "checked@here")
>click to view current: <<toolbar fields>>
''custom init and onClick functions:''
//{{{
[X{place.checked=true}{alert(place.checked?"on":"off")}] message box with checkbox state
//}}}
>[X{place.checked=true}{alert(place.checked?"on":"off")}] message box with checkbox state
''retrieving option values:''
>config.options['demo']=<script>return config.options['demo']?"true":"false";</script>
>config.options['chkDemo']=<script>return config.options['chkDemo']?"true":"false";</script>
<<<
!!!!!Configuration
<<<
Normally, when a checkbox state is changed, the affected tiddlers are automatically re-rendered, so that any checkbox-dependent dynamic content can be updated.  There are three possible tiddlers to be re-rendered, depending upon where the checkbox is placed, and what kind of storage method it is using.
*''container'': the tiddler in which the checkbox is displayed. (e.g., this tiddler)
*''tagged'': the tiddler that is being tagged (e.g., "~MyTask" when tagging "~MyTask:done")
*''tagging'': the "tag tiddler" (e.g., "~done" when tagging "~MyTask:done")
You can set the default refresh handling for all checkboxes in your document by using the following javascript syntax either in a systemConfig plugin, or as an inline script.  (Substitute true/false values as desired):
{{{config.checkbox.refresh = { tagged:true, tagging:true, container:true };}}}

You can also override these defaults for any given checkbox by using an initialization function to set one or more of the refresh options.  For example:
{{{[_{place.refresh.container=false}]}}}
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to [[CheckboxPluginInfo]]
2008.01.05 [2.4.0] set global "window.place" to current checkbox element when processing checkbox clicks.  This allows init/beforeClick/afterClick handlers to reference RELATIVE elements, including using "story.findContainingTiddler(place)".  Also, wrap handlers in "function()" so "return" can be used within handler code.
2008.01.02 [2.3.0] split optional custom onClick handling into separate onClickBefore and onClickAfter handlers.  The onClickBefore handler permits interception of the click BEFORE the checkbox is set.  onClickAfter allows follow-on 'side-effect' processing to occur AFTER the checkbox is set.
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.08.06 [2.2.5] supress automatic refresh of any tiddler that is currently being edited.  Ensures that current tiddler edit sessions are not prematurely discarded (losing any changes).  However, if checkbox changes a tag on a tiddler being edited, update the "tags" input field (if any) so that saving the edited tiddler correctly reflects any changes due to checkbox activity... see refreshEditorTagField().
2007.07.13 - 2.2.4 in handler(), fix srctid reference (was "w.tiddler", should have been "w.tiddler.title").  This fixes broken 'inline X' plus fatal macro error when using PartTiddlerPlugin.  Thanks to cmari for reporting the problem and UdoBorkowski for finding the code error.
2007.06.21 - 2.2.3 suppress automatic refresh of tiddler when using macro-syntax to prevent premature end of tiddler editing session.
2007.06.20 - 2.2.2 fixed handling for 'inline X' when checkboxes are contained in a 'trancluded' tiddler.  Now, regardless of where an inline X checkbox appears, the X will be placed in the originating source tiddler, rather than the tiddler in which the checkbox appears.
2007.06.17 - 2.2.1 Refactored code to add checkbox //macro// syntax for use in templates (e.g., {{{macro="checkbox ..."}}}. Also, code cleanup of existing tag handling.
2007.06.16 - 2.2.0 added support for tracking checkbox states using tiddler fields via "(fieldname@tiddlername)" syntax.
2006.05.04 - 2.1.3 fix use of findContainingTiddler() to check for a non-null return value, so that checkboxes won't crash when used outside of tiddler display context (such as in header, sidebar or mainmenu)
2006.03.11 - 2.1.2 added "|" as delimiter to tag-based storage syntax (e.g. "tiddler|tag") to avoid parsing ambiguity when tiddler titles or tag names contain ":".   Using ":" as a delimiter is still supported but is deprecated in favor of the new "|" usage.  Based on a problem reported by JeffMason.
2006.02.25 - 2.1.0 added configuration options to enable/disable forced refresh of tiddlers when toggling tags
2006.02.23 - 2.0.4 when toggling tags, force refresh of the tiddler containing the checkbox.
2006.02.23 - 2.0.3 when toggling tags, force refresh of the 'tagged tiddler' so that tag-related tiddler content (such as "to-do" lists) can be re-rendered.
2006.02.23 - 2.0.2 when using tag-based storage, allow use [[ and ]] to quote tiddler or tag names that contain spaces:
{{{[x([[Tiddler with spaces]]:[[tag with spaces]])]}}}
2006.01.10 - 2.0.1 when toggling tags, force refresh of the 'tagging tiddler'.  For example, if you toggle the "systemConfig" tag on a plugin, the corresponding "systemConfig" TIDDLER will be automatically refreshed (if currently displayed), so that the 'tagged' list in that tiddler will remain up-to-date.
2006.01.04 - 2.0.0 update for ~TW2.0
2005.12.27 - 1.1.2 Fix lookAhead regExp handling for {{{[x=id]}}}, which had been including the "]" in the extracted ID.  
Added check for "chk" prefix on ID before calling saveOptionCookie()
2005.12.26 - 1.1.2 Corrected use of toUpperCase() in tiddler re-write code when comparing {{{[X]}}} in tiddler content with checkbox state. Fixes a problem where simple checkboxes could be set, but never cleared.
2005.12.26 - 1.1.0 Revise syntax so all optional parameters are included INSIDE the [ and ] brackets.  Backward compatibility with older syntax is supported, so content changes are not required when upgrading to the current version of this plugin.   Based on a suggestion by GeoffSlocock
2005.12.25 - 1.0.0 added support for tracking checkbox state using tags ("TogglyTagging")
Revised version number for official post-beta release.
2005.12.08 - 0.9.3 support separate 'init' and 'onclick' function definitions.
2005.12.08 - 0.9.2 clean up lookahead pattern
2005.12.07 - 0.9.1 only update tiddler source content if checkbox state is actually different.  Eliminates unnecessary tiddler changes (and 'unsaved changes' warnings)
2005.12.07 - 0.9.0 initial BETA release
<<<
/%
|Name|CheckboxToggleTag|
|Source|http://www.TiddlyTools.com/#CheckboxToggleTag|
|Version|1.3.4|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|script|
|Requires|transcluded HTML|
|Overrides||
|Description|toggle betwen two alternative tag values using HTML checkbox|

Usage:
	<<tiddler CheckboxToggleTag with: tag1 tag2 TiddlerName>> text label goes here
where:
	tag1 is the tag to use when the checkbox is set
	tag2 is the tag to use when the checkbox is cleared
	TiddlerName (optional) is the tiddler to be tagged

%/<html><input type="checkbox" onclick="
	/* ONCLICK: toggle onTag/offTag based on checkbox state */
	store.suspendNotifications();
	var tid=this.getAttribute('tid');
	var ontag=this.getAttribute('onTag');
	var offtag=this.getAttribute('offTag');
	if (ontag && ontag.length)  store.setTiddlerTag(tid,this.checked,ontag);
	if (offtag && offtag.length) store.setTiddlerTag(tid,!this.checked,offtag);
	store.resumeNotifications();
	store.notify(tid,true);
	var here=story.findContainingTiddler(this);
	if (here) story.refreshTiddler(here.getAttribute('tiddler'),null,true);
	return false;
"><hide linebreaks></html><<tiddler {{
	/* ONINIT: save onTag/offTag and init checkbox based on current tag value (if any) */
	var tid="$3";
	if (tid=="$"+"3") {
		var here=story.findContainingTiddler(place);
		if (here) tid=here.getAttribute('tiddler');
	}
	if (store.tiddlerExists(tid)) {
		var c=place.lastChild.firstChild;
		if ("$1"!="$"+"1") c.setAttribute('onTag',"$1");
		if ("$2"!="$"+"2") c.setAttribute('offTag',"$2");
		c.setAttribute('tid',tid);
		c.checked=store.getTiddler(tid).isTagged(c.getAttribute('onTag'));
	}
'';}}>>
Click to start simulation.
(:graph({width:300,height:200,scales:[-10,110,-1.5,1.5],coords:'none',borderwidth:5, borderstroke:"orange"})
dynamic.goforit = function(e){
refresh();
success=0;
time=0;
if(animate==1) timer = setInterval("dynamic.roll()",50);
else clearInterval(timer);
animate++;
animate %= 2;
}

dynamic.roll=function(){
time++;
if(time>limit) {animate=1; clearInterval(timer); return;}
dynamic.sd=1./sqrt(20);
dynamic.mean=rnormal(0,dynamic.sd);
dynamic.liminf=dynamic.mean-1.96*dynamic.sd;
dynamic.limsup=dynamic.mean+1.96*dynamic.sd;
color="red";
if(dynamic.liminf<0 && dynamic.limsup>0){
success++;
color="green";
}
covering=success/time;
line([time,dynamic.liminf],[time,dynamic.limsup],{stroke:color});
text([limit*0.95,1.2],covering.toFixed(2),{id:"success",fill:"blue"});
}

limit=100;
animate=1;
setAction("mousedown",dynamic.goforit);
grid({dx:limit/20,dy:0.5});
axes({dx:limit/4,dy:1});
:)
/***
enables QuickEdit toolbar by default 
***/
/*{{{*/
config.options.chkShowQuickEdit=true;
/*}}}*/
Full credit should go to [[Peter Jipsen|http://www1.chapman.edu/~jipsen/]] for his ~ASCIIMathML and ASCIISVG scripts and to [[Douglas Woodall|http://www.maths.nottingham.ac.uk/personal/drw/]] for his ~LaTeX version. I'm also grateful to several users of those scripts that provided suggestions and fixes that I shamelessly used in my code.

I am also thankful to Andrew ~McLachlan for his help testing the plugin and his many suggestions. 
(:graph
curve([[0,0],[1,1],[0,2],[3,1]],{marker:'oso',markerfill:"yellow"});
:)
[[MathNotebook]] [[GettingStarted]]
(:graph({scales:[-1.5,3.5,-.6,2]})
 axes();
 area("pow(x,3)","0.01",{min:0, max:1, stroke:"none",fill:"#ddd",points:50});
 setOptions({stroke:"blue"});
 plot("pow(x,3)")
 text([2,0.5],"$=\\int_0^1 x^3\\,dx=\\frac{1}{4}$")
:)
Ecco qui un esempio di integrale definito. Vedi anche [[GraphicWithMath]]
(:graph({width:600,height:135,scales:[-6.75,6.75,-1.5,1.5]})
dynamic.update = function(evt) {
  var y = sin(x);
  line([x,0],[x,y],{id:"x1id",stroke:"red",strokewidth:3,label:"$\\theta$",pos:(y<0)?"n":"s"});
  line([-5+cos(x),y],[-5+cos(x),0],{id:"x2id",stroke:"red",strokewidth:3});
  path([[x,y],[-5+cos(x),y]],{id:"xdid",stroke:"red",strokewidth:1,strokedasharray:"10,10"});
  text([-5+.3*cos(x/2),.3*sin(x/2)],"$\\theta$",{id:"xaid"});
  path([[-5,0],[-5+cos(x),y]],{id:"rid",stroke:"green"});
  text([x+0.1,y/2],"$\\sin\\theta$",{pos:"e",id:"l1id"});
  text([-5+cos(x)-0.1,y/2],"$\\sin\\theta$",{pos:"w",id:"l2id"});
  if (x<0) arc({start:[-5+.4*cos(x),.4*sin(x)],end:[-5+.4,0],radius:.4,id:"aid",stroke:"green"});
  else if (x< PI) arc({start:[-5+.4,0],end:[-5+.4*cos(x),.4*sin(x)],radius:.4,id:"aid",stroke:"green"});
  else arc({start:[-5+.4,0],end:[-5+.4*cos(x),.4*sin(x)],radius:.4,id:"aid",largearc:1,stroke:"green"}); 
  var gx = SVG.mouse[0];
  if (gx>-PI && gx<=2*PI) x = gx;
};

grid();
axes({marker:">"});
setAction("mousemove",dynamic.update);
plot("sin(x)",{min:-PI,max:2*PI});
x= .5;
circle([-5,0],1);
text([PI,0],"$\\pi$",{pos:"n"});
text([2*PI,0],"$2\\pi$",{pos:"n"});
text([-PI,0],"$-\\pi$",{pos:"n"});
dynamic.update();
:)
$n = \frac{s^2 \left(t_{\alpha(2),\nu} + t_{\beta(1),\nu}\right)^2}{\delta^2}$
{{center{
Secant line of $\left\{\begin{array}{l l}
x^2, & \textrm{if } x < 1 \\
x^2+1, & \textrm{if } x \ge 1
\end{array}\right.$  at $a=1$
}}}
(:graph({pos:"center",width:250,height:250,scales:[-2.5,2.5,-0.7,3]})
dynamic.click = function() {
  a=SVG.mouse[0];
  fa2 = f2(a);
  setOptions({stroke:"blue"});
  line([a,fa2],[a,0],{id:"apos",marker:"*-*",markerstroke:"blue",label:["P","a"],pos:["w","n"],strokedasharray: "10,10"});
  m = (f2(a+0.01)-fa2)/0.01;
  c = fa2-m*a;
  if (a!=1) plot("m*x+c",{min:-2.5,max:2.5,id:"tangent",points:2,strokedasharray:"none", stroke:"red", strokewidth:2});
};

dynamic.update = function() {
  fb2 = f2(b);
  setOptions({stroke: "green"});
  line([b,fb2],[b,0],{id:"xpos",marker:"*-*",markerstroke:"green",label:["Q","x"],pos:["e","n"],strokedasharray: "10,10"});
  if (abs(b-a)>0.000001) m = (fb2-fa2)/(b-a);
  else m = (f2(a+0.01)-fa2)/0.01;
  c = fa2-m*a;
  plot("m*x+c",{min:-2.5,max:2.5,id:"secant",points:2,strokedasharray:"none", strokewidth:2});
  text([-2.5,-0.6],"slope = "+m.toFixed(2),{pos:"ne",id:"slope"});
  b = SVG.mouse[0];
};

axes();
setAction("mousemove",dynamic.update);
setAction("click",dynamic.click);
f2=function(x){return (x < 1?x*x:x*x+1)};
plot(f2,{steps:[1],leftMarkers:"o",rightMarkers:"*"});
a = 1;
b = 0.8;
dynamic.click();
dynamic.update();
:)
TiddlyWiki FireFox TiddlyTools TiddlyTech HowTo $1
/***
|Name|DisableWikiLinksPlugin|
|Source|http://www.TiddlyTools.com/#DisableWikiLinksPlugin|
|Version|1.6.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Tiddler.prototype.autoLinkWikiWords, 'wikiLink' formatter|
|Options|##Configuration|
|Description|selectively disable TiddlyWiki's automatic ~WikiWord linking behavior|
This plugin allows you to disable TiddlyWiki's automatic ~WikiWord linking behavior, so that WikiWords embedded in tiddler content will be rendered as regular text, instead of being automatically converted to tiddler links.  To create a tiddler link when automatic linking is disabled, you must enclose the link text within {{{[[...]]}}}.
!!!!!Usage
<<<
You can block automatic WikiWord linking behavior for any specific tiddler by ''tagging it with<<tag excludeWikiWords>>'' (see configuration below) or, check a plugin option to disable automatic WikiWord links to non-existing tiddler titles, while still linking WikiWords that correspond to existing tiddlers titles or shadow tiddler titles.  You can also block specific selected WikiWords from being automatically linked by listing them in [[DisableWikiLinksList]] (see configuration below), separated by whitespace.  This tiddler is optional and, when present, causes the listed words to always be excluded, even if automatic linking of other WikiWords is being permitted.  

Note: WikiWords contained in default ''shadow'' tiddlers will be automatically linked unless you select an additional checkbox option lets you disable these automatic links as well, though this is not recommended, since it can make it more difficult to access some TiddlyWiki standard default content (such as AdvancedOptions or SideBarTabs)
<<<
!!!!!Configuration
<<<
<<option chkDisableWikiLinks>> Disable ALL automatic WikiWord tiddler links
<<option chkAllowLinksFromShadowTiddlers>> ... except for WikiWords //contained in// shadow tiddlers
<<option chkDisableNonExistingWikiLinks>> Disable automatic WikiWord links for non-existing tiddlers
Disable automatic WikiWord links for words listed in: <<option txtDisableWikiLinksList>>
Disable automatic WikiWord links for tiddlers tagged with: <<option txtDisableWikiLinksTag>>
<<<
!!!!!Revisions
<<<
2008.07.22 [1.6.0] hijack tiddler changed() method to filter disabled wiki words from internal links[] array (so they won't appear in the missing tiddlers list)
2007.06.09 [1.5.0] added configurable txtDisableWikiLinksTag (default value: "excludeWikiWords") to allows selective disabling of automatic WikiWord links for any tiddler tagged with that value.
2006.12.31 [1.4.0] in formatter, test for chkDisableNonExistingWikiLinks
2006.12.09 [1.3.0] in formatter, test for excluded wiki words specified in DisableWikiLinksList
2006.12.09 [1.2.2] fix logic in autoLinkWikiWords() (was allowing links TO shadow tiddlers, even when chkDisableWikiLinks is TRUE).  
2006.12.09 [1.2.1] revised logic for handling links in shadow content
2006.12.08 [1.2.0] added hijack of Tiddler.prototype.autoLinkWikiWords so regular (non-bracketed) WikiWords won't be added to the missing list
2006.05.24 [1.1.0] added option to NOT bypass automatic wikiword links when displaying default shadow content (default is to auto-link shadow content)
2006.02.05 [1.0.1] wrapped wikifier hijack in init function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals
2005.12.09 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.DisableWikiLinksPlugin= {major: 1, minor: 6, revision: 0, date: new Date(2008,7,22)};

if (config.options.chkDisableNonExistingWikiLinks==undefined) config.options.chkDisableNonExistingWikiLinks= false;
if (config.options.chkDisableWikiLinks==undefined) config.options.chkDisableWikiLinks=false;
if (config.options.txtDisableWikiLinksList==undefined) config.options.txtDisableWikiLinksList="DisableWikiLinksList";
if (config.options.chkAllowLinksFromShadowTiddlers==undefined) config.options.chkAllowLinksFromShadowTiddlers=true;
if (config.options.txtDisableWikiLinksTag==undefined) config.options.txtDisableWikiLinksTag="excludeWikiWords";

// find the formatter for wikiLink and replace handler with 'pass-thru' rendering
initDisableWikiLinksFormatter();
function initDisableWikiLinksFormatter() {
	for (var i=0; i<config.formatters.length && config.formatters[i].name!="wikiLink"; i++);
	config.formatters[i].coreHandler=config.formatters[i].handler;
	config.formatters[i].handler=function(w) {
		// supress any leading "~" (if present)
		var skip=(w.matchText.substr(0,1)==config.textPrimitives.unWikiLink)?1:0;
		var title=w.matchText.substr(skip);
		var exists=store.tiddlerExists(title);
		var inShadow=w.tiddler && store.isShadowTiddler(w.tiddler.title);
		// check for excluded Tiddler
		if (w.tiddler && w.tiddler.isTagged(config.options.txtDisableWikiLinksTag))
			{ w.outputText(w.output,w.matchStart+skip,w.nextMatch); return; }
		// check for specific excluded wiki words
		var t=store.getTiddlerText(config.options.txtDisableWikiLinksList);
		if (t && t.length && t.indexOf(w.matchText)!=-1)
			{ w.outputText(w.output,w.matchStart+skip,w.nextMatch); return; }
		// if not disabling links from shadows (default setting)
		if (config.options.chkAllowLinksFromShadowTiddlers && inShadow)
			return this.coreHandler(w);
		// check for non-existing non-shadow tiddler
		if (config.options.chkDisableNonExistingWikiLinks && !exists)
			{ w.outputText(w.output,w.matchStart+skip,w.nextMatch); return; }
		// if not enabled, just do standard WikiWord link formatting
		if (!config.options.chkDisableWikiLinks)
			return this.coreHandler(w);
		// just return text without linking
		w.outputText(w.output,w.matchStart+skip,w.nextMatch)
	}
}

Tiddler.prototype.coreAutoLinkWikiWords = Tiddler.prototype.autoLinkWikiWords;
Tiddler.prototype.autoLinkWikiWords = function()
{
	// if all automatic links are not disabled, just return results from core function
	if (!config.options.chkDisableWikiLinks)
		return this.coreAutoLinkWikiWords.apply(this,arguments);
	return false;
}

Tiddler.prototype.disableWikiLinks_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
	this.disableWikiLinks_changed.apply(this,arguments);
	// remove excluded wiki words from links array
	var t=store.getTiddlerText(config.options.txtDisableWikiLinksList,"").readBracketedList();
	if (t.length) for (var i=0; i<t.length; i++)
		if (this.links.contains(t[i]))
			this.links.splice(this.links.indexOf(t[i]),1);
};
//}}}
(:graph
grid();
axes();
plot("1/x",{steps:[0]});
plot("pow(1/x,2)",{steps:[0],stroke:"red"});
:)
(:graph({height:200,scales:[-0.6,6,-1.2,8],borderwidth:1,coords:"none"})
axes();
var a=[[1,3],[2,5],[3,6],[4,2],[5,7]];
var b=[3,5,6,2,7];
path(a,{marker:"ooo",markerfill:"yellow",stroke:"none",label:b,pos:"n"});
:)
(:graph({width:400,height:300,coords:"none"})
grid();
setOptions({size:30,marker:"*",markerstroke:"orange",markerstrokeopacity:0.5});
dot([2,2],{label:"NE",pos:"ne"});
dot([-2,2],{label:"NW",pos:"nw"});
dot([-2,-2],{label:"SW",pos:"sw"});
dot([2,-2],{label:"SE",pos:"se"});
dot([2,0],{label:"E",pos:"re"});
dot([-2,0],{label:"W",pos:"w"});
dot([0,2],{label:"N",pos:"n"});
dot([0,-2],{label:"S",pos:"s"});
:)
(:graph({scales:[-6,6],coords:"polar"})
dynamic.moveit = function() {
  dynamic.angle = getAngle();
  parametricPlot("dynamic.a*cos(x)","dynamic.b*sin(x)",{max:dynamic.angle,id:"ell",stroke:"darkorange",strokewidth:4});
  path([[-dynamic.c,0],[dynamic.a*cos(dynamic.angle),dynamic.b*sin(dynamic.angle)],[dynamic.c,0]],{id:"gen",stroke:"blue",strokewidth:2,strokedasharray:"10,10"});
}

setAction("mousemove",dynamic.moveit);
axes({ticklabels:false});
dynamic.a = 5;
dynamic.b = 3;
dynamic.c = sqrt(dynamic.a*dynamic.a-dynamic.b*dynamic.b);
dot([-dynamic.c,0],{marker:{type:"*"},label:"$F_1$",pos:"S"});
dot([dynamic.c,0],{marker:{type:"*"},label:"$F_2$",pos:"S"});
:)
(:graph({pos:"right",width:250,height:250,scales:[-2.5,2.5],coords:false})
var fn = "-pow(x,3)+2*x"; /*change this if you like*/
dynamic.update = function() {
  fb1 = g(b1);
  setOptions({stroke:"green"});
  line([b1,fb1],[b1,0],{id:"xpos",marker:"*-*",markerstroke:"green",label:["Q","x"],pos:["e","n"],strokedasharray: "10,10"});
  if (abs(b1-a1)>0.000001) m1 = (fb1-fa1)/(b1-a1);
  else m1 = (g(a1+0.01)-fa1)/0.01;
  c1 = fa1-m1*a1;
  plot("m1*x+c1",{min:-2.5,max:2.5,id:"secant",strokewidth: 2,points:2});
  text([-2.5,-2.4],"slope = "+m1.toFixed(2),{id:"slope",pos:"NE"});
  b1 = SVG.mouse[0];
};

axes();
eval("g = function(x) { return "+fn+" }");
setAction("mousemove",dynamic.update)
plot(g);
a1 = 0.5;
b1 = 0.8;
fa1 = g(a1);
line([a1,fa1],[a1,0],{marker:"*-*",label:["P","a"],pos:["w","n"],strokedasharray: "10,10"});
m1 = (g(a1+0.01)-fa1)/0.01;
c1 = fa1-m1*a1;
plot("m1*x+c1",{min:-2.5,max:2.5,stroke:"red",points:2});
dynamic.update();
:)
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div macro='tiddler QuickEditToolbar'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='preview hide  text 10'></div>
<div class='editor' macro='edit tags'></div>
<div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
Click to start/stop drawing a new path
(:graph({coords:"none",pan:false})
dynamic.update = function(evt){
if((dynamic.draw%2)==0) {
dynamic.path =[];
} else {
dynamic.path.push(SVG.mouse);
path(dynamic.path,{id:"drawing"+dynamic.draw});
}
}

dynamic.reset = function(evt){
dynamic.draw++;
}

setAction("mousemove",dynamic.update);
setAction("mousedown",dynamic.reset);
dynamic.path =[];
dynamic.draw = 0;
:)
$\begin{eqnarray}
\frac{d}{dt}(\vec v \cdot \vec v)&=&\frac{d}{dt}(c^2)\\
\vec v\cdot\frac{d\vec v}{dt}+\frac{d\vec v}{dt}\cdot \vec v &=& 0\\
2\vec v\cdot\frac{d\vec v}{dt}&=&0
\end{eqnarray}$
!SVG examples: <<tag svg>>
!SVG examples with dynamic features: <<tag dynamic>>
!Math notation examples: <<tag latex>>
The plugin is not loaded by TW.
(:graph({pos:"center",width:200,height:200,scales:[-1.1,1.1],coords: 'none'})
a = []
n = 9
 for (i = 0; i < n; i++)
 a[i] = [cos(PI/4*(-1)*i+PI/2),
 sin(PI/4*(-1)*i+PI/2)]
path([a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],
 a[0],a[4],a[5],a[1],a[2],a[6],a[7],a[3]])
path(a,{marker:"oo",markerfill:"orange"})
:)
(:graph({width:250,height:250,scales:[-10,10]})
axes({dx:2});
polarPlot("x/PI",{min:0,max:10*PI,stroke:"red"});
:)
(:graph({pos:"inline",width:200,height:200,scales:[-2,2]})
setOptions({stroke:'red'});
polarPlot("2*sin(5*x)",{min:0, max:PI})
:)(:graph({pos:"inline",width:200,height:200,scales:[-2,2]})
setOptions({stroke:'red'});
polarPlot("2*sin(3/5*x)",{min:0,max:5*PI})
:)(:graph({pos:"inline",width:200,height:200,scales:[-2,2]})
setOptions({stroke:'red'});
polarPlot("2*sin(PI*x)",{min:0,max:14*PI,points:1000})
:)
(:graph({width:200,height:150,coords:"none",scales:[-2.5,2.5,-2.5,2.5]})
grid();
polygon([[-1,1],[-1,-1],[1,-1],[1,1]],{stroke:"blue",strokewidth:1,
marker:"ooo",size:12,markerstroke:"orange",markerstrokewidth:0.5,markerfill:"green",markerfillopacity:0.3,markerstrokeopacity:0.3, fill:"fuchsia",fillopacity:0.5, label:["1","2","3","4"],pos:["nw","sw","se","ne"],
fontsize:40,fontweight:"bold",fontfill:"red",fontfillopacity:0.9,fontstroke:"brown",fontstrokewidth:1});
:)
I am a researcher in physics, in the Department of Energy, University of Florence, Florence, Italy. I am also a member of the Center for the Study of Complex Dynamics (CSDC), same University, and the experiment TO61 (Physics and Biology) of the Italian Nattional Institute of Nuclear Physics (INFN). I teach general physics and statistical physics (with various flavors: equilibrium, diffusion, dynamical systems, cellular automata, physics of complexity, physics of information, etc.) in various engineering courses. 

I am interested in several subjects: chaos, entropy and synchronization, dynamical and statistical properties of discrete systems (cellular automata, lattice gas, coupled maps), theory of evolution, modeling of social systems, psychology and cognitive sciences, modeling of complex physical systems like fluids, granular systems, geophysical systems, etc. 

I am also involved in developing innovative web tools for teaching, in particular [[detachable learning objects]]. 

More informations about me at http://francobagnoli.complexworld.net (and don't forget to explore the whole site http://www.complexworld.net)
 
A famous result due to [[Euler|http://www-groups.dcs.st-and.ac.uk/~history/Mathematicians/Euler.html]] in ~LaTeX: $\sum_{n=1}^{+\infty}{\frac1{n^2}=\frac{\pi^2}6$
and again as a centered equation using {{{$$ ... $$}}}$$\sum_{n=1}^{+\infty} \frac{1}{n^2}=\frac{\pi^2}{6}.$$
or using {{{\[ ... \]}}} \[\sum_{n=1}^{+\infty} \frac{1}{n^2}=\frac{\pi^2}{6}.\]
Here is a graph of $x-\frac{x^3}{6}$ and $\sin(x)$

(:graph({width:300,height:150,scales:[-6.29,6.29]})
grid({dx:1,stroke:"green"});
axes({marker:">"});
plot("sin(x)",{stroke:"red"})
plot("x-pow(x,3)/6",{min:-4,max:4,stroke:"blue", strokedasharray:"10,10"})
text([-2,-2.5],"Close friends near 0!",{id:"rot",fontsize:18,fontfill:"orange"});
rotate("rot",PI/18,{center:[-5,-3]});
:)
and a diagram illustrating why Pythagoras' Theorem holds:

(:graph({width:400,height:150,scales:[-4,4,1,4],coords:"none"})
setOptions({fill:"yellow"});
rect([1,1],[4,4])
rect([-4,1],[-1,4])
setOptions({fill:"red"});
rect([-2,1],[-1,2])
setOptions({fill:"blue"});
rect([-4,2],[-2,4])
setOptions({fill:"green"});
path([[1,2],[2,4],[4,3],[3,1],[1,2]])
setOptions({fill:"none"});
path([[-4,1],[-2,2],[-1,4]])
:)
(:graph({width:300,height:300,scales:[-5,5,-5,5]})
image('figuras/moon.jpg',{point:[0,0]})
axes();
plot("cos(x)")
:)
(:graph
axes();
plot("Gamma(x)");
:)
{{{
-------------------OO---------
--------------------OO--------
-------------------O----------
------------------------------
--------------------------O---
--------------------------O-O-
--------------------------OO--
------------------------------
------OO----------------------
-----OO-----------------------
-------O----------------------
------------------------------
-------------------------O----
--------------------------OO--
-------------------------OO---
----OOO-----------------------
------O-----------------------
-----O------------------------
------------------------------
-----------O-O----------------
-----------OO-----------------
------------O-----------------
------------------------------
--------------------OOO-------
--------------------O---------
---------------------O--------
------------------------------
-----------O------------------
------------O-----------------
----------OOO-----------------
}}}
{{{
--------------------------------------
------------------------O-------------
----------------------O-O-------------
------------OO------OO------------OO--
-----------O---O----OO------------OO--
OO--------O-----O---OO----------------
OO--------O---O-OO----O-O-------------
----------O-----O-------O-------------
-----------O---O----------------------
------------OO------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
-------------------------------------#
-------------------------------------#
-----------------------------------###
}}}
(:graph({width:120,height:120,scales:[-0.5,1.5,-0.5,1.5],coords:"none"})
a=[0,1];
b=[1,1];
c=[1,0];
d=[0,0];
path([b,d,a,c]);
path([a,b,c,d],{marker:"ooo",markerfill:"yellow",label:["a","b","c","d"],pos:["nw","ne","se","sw"]});
text([.5,-0.5],"$K_4$",{pos:"n"})
:)
|!Marker text |!Marker|!Description|
| {{{s}}} | (:graph({pos:"inline",height:12,width:20}) dot([0,0],{marker:"s",size:10}); :) | Open square (can be filled using {{{markerfill}}}) |
| {{{S}}} | (:graph({pos:"inline",height:12,width:20}) dot([0,0],{marker:"S",size:10}); :) | Filled square (using {{{markerstroke}}} colour, {{{markerfill}}} is ignored) |
(:graph({scales:[-1.5,3.5,-.6,2]})
 axes();
 area("pow(x,2)","0.01",{min:0, max:1, stroke:"none",fill:"#ddd",points:50});
 setOptions({stroke:"blue"});
 plot("pow(x,2)")
 text([2,0.5],"$=\\int_0^1 x^2\\,dx=\\frac{1}{3}$")
:)
/***
|Name|HTMLFormattingPlugin|
|Source|http://www.TiddlyTools.com/#HTMLFormattingPlugin|
|Documentation|http://www.TiddlyTools.com/#HTMLFormattingPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~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
<<<
2009.01.05 [2.4.0] in wikifyTextNodes(), pass w.highlightRegExp and w.tiddler to wikify() so that search term highlighting and tiddler-relative macro processing will work
| 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.HTMLFormattingPlugin= {major: 2, minor: 4, revision: 0, date: new Date(2009,1,5)};

// 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];
			// if <nowiki> is present, just let browser handle it!
			if (html.indexOf('<nowiki>')!=-1)
				createTiddlyElement(w.output,"span").innerHTML=html;
			else {
				// if <hide linebreaks> is present, suppress wiki-style literal handling of newlines
				if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(/\n/g,' ');
				// remove all \r's added by IE textarea and mask newlines and macro brackets
				html=html.replace(/\r/g,'').replace(/\n/g,'\\n').replace(/<</g,'%%(').replace(/>>/g,')%%');
				// create span, let browser parse HTML
				var e=createTiddlyElement(w.output,"span"); e.innerHTML=html;
				// then re-render text nodes as wiki-formatted content
				wikifyTextNodes(e,w);
			}
			w.nextMatch = this.lookaheadRegExp.lastIndex; // continue parsing
		}
	}
}

// wikify #text nodes that remain after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode,w)
{
	function unmask(s) { return s.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(/\\n/g,'\n'); }
	switch (theNode.nodeName.toLowerCase()) {
		case 'style': case 'option': case 'select':
			theNode.innerHTML=unmask(theNode.innerHTML);
			break;
		case 'textarea':
			theNode.value=unmask(theNode.value);
			break;
		case '#text':
			var txt=unmask(theNode.nodeValue);
			var newNode=createTiddlyElement(null,"span");
			theNode.parentNode.replaceChild(newNode,theNode);
			wikify(txt,newNode,highlightHack,w.tiddler);
			break;
		default:
			for (var i=0;i<theNode.childNodes.length;i++)
				wikifyTextNodes(theNode.childNodes.item(i),w); // recursion
			break;
	}
}
//}}}
|Name|HTMLFormattingPluginInfo|
|Source|http://www.TiddlyTools.com/#HTMLFormattingPlugin|
|Documentation|http://www.TiddlyTools.com/#HTMLFormattingPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for HTMLFormattingPlugin|
The ~HTMLFormatting plugin allows you to freely ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.
!!!!!Usage
<<<
The shorthand Wiki-style formatting syntax of ~TiddlyWiki is very convenient and enables most content to be reasonably well presented. However, there are times when tried-and-true HTML formatting syntax allows more more precise control of the content display.

When a tiddler is about to be displayed, ~TiddlyWiki looks for tiddler content contained within {{{<html>}}} and {{{</html>}}} markers.  When present, the TiddlyWiki core simply passes this content directly to the browser's internal "rendering engine" to process as ~HTML-formatted content.  However, TiddlyWiki does not also process the HTML source content for any embedded wiki-formatting syntax it may contain.  This means that while you can use HTML formatted content, you cannot mix wiki-formatted content within the HTML formatting.

This plugin extends the TiddlyWiki core processing so that, after the HTML formatting has been processed, all the pieces of text occuring within the HTML block are then processed one piece at a time, so that normal wiki-style formatting can be applied to the individual text pieces.

Note: To bypass this extended processing for a specific section of HTML content, embed ''{{{<nowiki>}}}'' //anywhere// inside the {{{<html>...</html>}}} delimiters, and wiki formatting will not be applied to that content.
<<<
!!!!!Line breaks
<<<
One major difference between Wiki formatting and HTML formatting is how "line breaks" are processed. Wiki formatting treats all line breaks as literal content to be displayed //as-is//. However, because HTML normally ignores line breaks and actually processes them as simple "word separators" instead, many people who write HTML include extra line breaks in their documents, just to make the "source code" easier to read.

Even though you can use HTML tags within your tiddler content, the default treatment for line breaks still follows the Wiki-style rule (i.e., all new lines are displayed as-is). When adding HTML content to a tiddler (especially if you cut-and-paste it from another web page), you should take care to avoid adding extra line breaks to the text.

If removing all the extra line breaks from your HTML content would be a big hassle, you can quickly //override the default Wiki-style line break rule// so that the line breaks use the standard HTML rules, by placing ''{{{<hide linebreaks>}}}'' //anywhere// within the HTML content.  This automatically converts all line breaks to spaces before rendering the content, so that the literal line breaks will be processed as simple word-breaks instead.

Note: this does //not// alter the actual tiddler content that is stored in the document, just the manner in which it is displayed. Any line breaks contained in the tiddler will still be there when you edit its content. Also, to include a literal line break when the ''<{{{hide linebreaks}}}>'' tag is present, you will need to use a ''<{{{br}}}>'' or ''<{{{p}}}>'' HTML tag instead of simply typing a line break.
<<<
!!!!!How it works
<<<
The TW core support for HTML does not let you put ANY wiki-style syntax (including TW macros) *inside* the {{{<html>...</html>}}} block.  Everything between {{{<html>}}} and {{{</html>}}} is handed to the browser for processing and that is it.

However, not all wiki syntax can be safely passed through the browser's parser. Specifically, any TW macros inside the HTML will get 'eaten' by the browser since the macro brackets, {{{<<...>>}}} use the "<" and ">" that normally delimit the HTML/XML syntax recognized by the browser's parser.

Similarly, you can't use InlineJavascript within the HTML because the {{{<script>...</script>}}} syntax will also be consumed by the browser and there will be nothing left to process afterward.  Note: unfortunately, even though the browser removes the {{{<script>...</script>}}} sequence, it doesn't actually execute the embedded javascript code that it removes, so any scripts contained inside of <html> blocks in TW are currently being ignored. :-(

As a work-around to allow TW *macros* (but not inline scripts) to exist inside of <html> formatted blocks of content, the plugin first converts the {{{<<}}} and {{{>>}}} into "%%(" and ")%%", making them "indigestible" so they can pass unchanged through the belly of the beast (the browser's HTML parser).

After the browser has done its job, the wiki syntax sequences (including the "undigested" macros) are contained in #text nodes in the browser-generated DOM elements.  The plugin then recursively locates and processes each #text node, converts the %%( and )%% back into {{{<<}}} and {{{>>}}}, passes the result to wikify() for further rendering of the wiki-formatted syntax into a containing SPAN that replaces the previous #text node.  At the end of this process, none of the encoded %%( and )%% sequences remain in the rendered tiddler output.
<<<
!!!!!Revisions
<<<
2009.01.05 [2.4.0] in wikifyTextNodes(), pass w.highlightRegExp and w.tiddler to wikify() so that search term highlighting and tiddler-relative macro processing will work
2008.10.02 [2.3.0] added use of {{{<nowiki>}}} marker to bypass all wikification inside a specific HTML block
2008.09.19 [2.2.0] in wikifyTextNodes(), don't wikify the contents of STYLE nodes (thanks to MorrisGray for bug report)
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!!!!
2006.09.10 [2.1.4] update formatter for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)
2006.05.28 [2.1.3] in wikifyTextNodes(), decode the *value* of TEXTAREA nodes, but don't wikify() its children.  (thanks to "ayj" for bug report)
2006.02.19 [2.1.2] in wikifyTextNodes(), put SPAN element into tiddler DOM (replacing text node), BEFORE wikifying the text content.  This ensures that the 'place' passed to any macros is correctly defined when the macro is evaluated, so that calls to story.findContainingTiddler(place) will work as expected. (Thanks for bug report from GeoffSlocock)
2006.02.05 [2.1.1] wrapped wikifier hijack in init function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals
2005.12.01 [2.1.0] don't wikify #TEXT nodes inside SELECT and TEXTAREA elements
2005.11.06 [2.0.1] code cleanup
2005.10.31 [2.0.0] replaced hijack wikify() with hijack config.formatters["html"] and simplified recursive WikifyTextNodes() code
2005.10.09 [1.0.2] combined documentation and code into a single tiddler
2005.08.05 [1.0.1] moved HTML and CSS definitions into plugin code instead of using separate tiddlers
2005.07.26 [1.0.1] Re-released as a plugin. Added <{{{html}}}>...</{{{nohtml}}}> and <{{{hide newlines}}}> handling
2005.06.26 [1.0.0] Initial Release (as code adaptation - pre-dates TiddlyWiki plugin architecture!!)
<<<
(:graph({pos:"center",width:300,height:300,scales:[-5.1,5.1,-5.1,5.1],coords:"none"})
  circle([0,0],5,{strokewidth:3, stroke:"none",fill:"#FFD500"})
  arc({start:[-2,-2],end:[2,-2],radius:3,  stroke:"red",strokewidth:5})
  circle([-2,1],.5,{stroke: "none", fill: "darkblue"})
  circle([2,1],.5,{stroke: "none", fill: "darkblue"})
  arc({start:[-1.5,1.5], end:[-2.5,1.5], radius:1, stroke: "fuchsia", fill: "none", strokewidth:3})
  arc({start:[2.5,1.5], end:[1.5,1.5], radius:1, stroke: "fuchsia", fill: "none", strokewidth:3})
:)
This is an experiment for developing a [[detachable notebook]] with [[LaTeX]] math notation (and possibly full [[LaTeX formatting]]).  
The steps I followed up to now are:

* Open a new notebook on [[TiddlySpot]]
* Download the latest [[TiddlyWiki]] and import the TiddlySpot plugin (I think this step can be avoided by chosing the "upgrade" option).
* Import MathSVGPlugin from [[Paulo Soares]]' page.
* Import a lot of extension from [[TiddlyTools]]. 


!!ToDo

* LaTeX help
* LaTeX button on the  [[QuickEditToolbar]] 
* LaTeX export
(:graph({width:300,height:200,scales:[0,4,0,5],borderstroke:"blue",borderwidth:2,backgroundcolor:'yellow',backgroundopacity:0.25,coords:"none"})
axes();
image('http://www1.chapman.edu/~jipsen/mathml/asciimathml.jpeg',{point:[1.8,2.2],width:75,height:90,pos:"NE"});
setOptions({stroke:"red"});
plot("2*(sin(2*x)+1)")
:)
/***
|Name|ImageMapPlugin|
|Source|http://www.TiddlyTools.com/#ImageMapPlugin|
|Documentation|http://www.TiddlyTools.com/#ImageMapPluginInfo|
|Version|1.2.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|apply image maps ('hotspots') with links to tiddlers|
!!!!!Documentation
>see [[ImageMapPluginInfo]]
!!!!!Revisions
<<<
2009.05.27 [1.2.2] improved autoscroll for {{{<<mapMaker>>}}} textarea
2009.05.14 [1.2.1] added cursor changes
see [[ImageMapPluginInfo]] for additional revision details
2009.05.09 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageMapPlugin= {major: 1, minor: 2, revision: 2, date: new Date(2009,5,27)};
//}}}
//{{{
config.macros.imageMap = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		// image element must immediately precede macro
		var img=place.lastChild; if (!img||img.nodeName!='IMG') return;
		var map=params[0]; var items=store.getTiddlerText(map,'').split('\n----\n'); if (!items) return;
		var out=['<MAP NAME="'+map+'">'];
		var fmt='<AREA SHAPE="POLY" TIDDLER="%0" COORDS="%1" TITLE="%2" ALT="%2" ONCLICK="%3" STYLE="%4">';
		var click="story.displayTiddler(story.findContainingTiddler(this),this.getAttribute('tiddler'));";
		var style='cursor:pointer';
		for (var i=0; i<items.length; i++) {
			var lines=items[i].split('\n'); var tid=lines.shift(); var coords=lines.join('');
			var tip=store.tiddlerExists(tid)?store.getTiddler(tid).getSubtitle():tid;
			out.push(fmt.format([tid,coords,tip,click,style]));
		}
		out.push('</MAP>');
		createTiddlyElement(place,'span').innerHTML=out.join('');
		img.setAttribute('isMap',true);
		img.setAttribute('useMap','#'+map);
		img.style.border=0;
	}
}
//}}}
//{{{
config.macros.mapMaker= {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var img=place.lastChild; // image element must immediately precede macro
		if (!img||img.nodeName!='IMG') return;
		img.onmousemove=function(ev){ ev=ev||window.event;
			var mX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
			var mY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
			var ta=this.nextSibling.getElementsByTagName('textarea')[0];
			var lines=ta.value.split('\n'); var last=lines.length?lines.length-1:0;
			var vals=lines[last].split(','); vals.pop(); vals.pop(); lines[last]=vals.join(',');
			lines[last]+=(lines[last].length?',':'')+(mX-findPosX(this))+','+(mY-findPosY(this));
			ta.value=lines.join('\n');
			ta.scrollTop=ta.scrollHeight-ta.offsetHeight+this.emH*2;
			ta.scrollLeft=lines[last].length*this.emW-ta.offsetWidth;
			ta.focus();
		};
		img.onmouseout=function(ev){ ev=ev||window.event;
			var ta=this.nextSibling.getElementsByTagName('textarea')[0];
			var lines=ta.value.split('\n'); var last=lines.length?lines.length-1:0;
			var vals=lines[last].split(','); vals.pop(); vals.pop(); lines[last]=vals.join(',');
			ta.value=lines.join('\n');
			ta.scrollTop=ta.scrollHeight-ta.offsetHeight+this.emH*2;
			ta.scrollLeft=lines[last].length*this.emW-ta.offsetWidth;
		};
		img.onmouseover=img.onclick=function(ev) { ev=ev||window.event;
			var mX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
			var mY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
			var ta=this.nextSibling.getElementsByTagName('textarea')[0];
			ta.value+=(ta.value.length?',':'')+(mX-findPosX(this))+','+(mY-findPosY(this));
			var lines=ta.value.split('\n'); var last=lines.length?lines.length-1:0;
			ta.scrollTop=ta.scrollHeight-ta.offsetHeight+this.emH*2;
			ta.scrollLeft=lines[last].length*this.emW-ta.offsetWidth;
			ta.focus();
		}
		img.style.border='1px solid #999';
		img.style.cursor='crosshair';
		var map=params[0]||'';
		var s=createTiddlyElement(place,'div');
		s.style.height=s.style.width='1em';
		img.emW=s.offsetWidth; img.emH=s.offsetHeight; // get font metrics (for auto scrolling)
		s.style.height=s.style.width='';
		s.innerHTML+='<div class="toolbar">'
			+'<a href="javascript:;" '
			+'onclick="config.macros.mapMaker.load(this.parentNode.nextSibling)">load map</a>'
			+'<a href="javascript:;" '
			+'onclick="config.macros.mapMaker.save(this.parentNode.nextSibling)">save map</a>'
			+'</div>'
			+'<textarea rows="8" style="display:block;clear:both;width:100%;" tiddler="'+map+'">'
			+store.getTiddlerText(map,'')
			+'</textarea>';
	},
	load: function(ta) {
		var tid=prompt('Enter a tiddler title:',ta.getAttribute('tiddler')||'');
		if (!tid||!tid.length) return; // cancelled by user
		ta.value=store.getTiddlerText(tid,''); ta.setAttribute('tiddler',tid);
		return false;
	},
	save: function(ta) {
		var tid=prompt('Enter a tiddler title:',ta.getAttribute('tiddler')||'NewImageMap');
		while (tid && tid.length && store.tiddlerExists(tid)) {
			if(confirm(config.messages.overwriteWarning.format([tid]))) break;
			var tid=prompt('Enter a different tiddler title:',tid);
		}
		if (!tid||!tid.length) return; // cancelled by user
		store.saveTiddler(tid,tid,ta.value,config.options.txtUserName,new Date(),['imageMap'],{});
		story.displayTiddler(null,tid);
		displayMessage('image map saved to: '+tid);
		ta.setAttribute('tiddler',tid);
		return false;
	}
}
//}}}
/***
|Name|ImageMapPluginInfo|
|Source|http://www.TiddlyTools.com/#ImageMapPlugin|
|Documentation|http://www.TiddlyTools.com/#ImageMapPluginInfo|
|Version|1.2.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for ImageMapPlugin|
!!!Usage
<<<
{{{
[img[...]]<<imageMap MapName>>
}}}
applies an image map to the embedded image immediately preceding the macro.   ''~MapName'' is the title of a tiddler (or a tiddler section) that contains an ''~HR-separated list'' of items, where the first line of each item is the ''tiddler to link to'' and the second line is a ''list of polygon coordinates'' using standard HTML <AREA COORDS="..."> syntax (e.g., a ''comma-separated series of X,Y pairs'': "x1,y1,x2,y2,x3,y3,...", that trace out the desired shape).
{{{
[img[...]]<<mapMaker MapName>>
}}}
adds interactive point-and-click calculation of X,Y map coordinates that are automatically entered into a text input field that you can then edit and save to a tiddler to create an ~HR-separated map definition.
<<<
!!!imageMap Example
<<<
{{{
[img[images/california.gif]]<<imageMap ImageMapPluginInfo##county_map>>
}}}
~~//(click a county to open a tiddler)//~~
[img[images/california.gif]]<<imageMap ImageMapPluginInfo##county_map>>
<<<
!!!mapMaker example
<<<
{{{
[img[images/california.gif]]<<mapMaker ImageMapPluginInfo##county_map>>
}}}
~~//(click anywhere inside image to record x,y coordinates)//~~
[img[images/california.gif]]<<mapMaker ImageMapPluginInfo##county_map>>
<<<
!!!Revisions
<<<
2009.05.14 [1.2.1] added cursor changes
2009.05.13 [1.2.0] add MAP/AREA elements using innerHTML
2009.05.12 [1.1.1] fixed mapMaker event handling for IE
2009.05.10 [1.1.0] added {{{<<mapMaker>>}}}
2009.05.10 [1.0.1] open tiddlers following current tiddler instead of at top of story column
2009.05.09 [1.0.0] initial release
<<<
!!!Sample Map
<<<
{{{
!county_map
San Francisco
50,231,51,225,54,222,55,226,55,231,50,231,50,231
----
San Mateo
59,252,60,242,58,239,55,238,54,232,49,233,50,240,50,244,50,249,54,253,59,252,59,252
----
Santa Clara
94,242,90,244,80,243,75,242,66,243,60,243,58,251,63,255,70,258,75,270,79,268,95,268,97,260,97,254,94,254,93,252,97,250,94,248,95,246,94,242,94,242
----
Alameda
94,223,95,242,90,243,80,242,75,241,65,242,66,235,63,225,70,224,80,226,94,221,94,224,95,225,95,231,94,223,94,223
----
Contra Costa
97,213,97,221,83,226,69,224,63,224,62,220,67,214,73,217,79,214,98,214,96,214,97,213,97,213
----
Santa Cruz
53,254,59,251,63,255,70,258,75,268,73,273,68,273,67,266,53,254,53,254
----
San Benito
117,292,116,302,114,304,110,302,111,307,104,304,101,306,91,292,91,288,87,288,87,285,73,273,75,271,78,269,96,270,116,292,117,292,117,292
----
Monterey
128,325,86,325,83,319,83,313,78,309,78,305,64,286,64,283,67,282,67,273,73,273,87,284,86,288,90,287,91,292,101,305,104,303,110,306,113,303,126,318,128,325,128,325
----
Fresno
123,266,133,278,149,271,164,269,170,261,176,261,176,257,181,258,182,254,190,252,194,245,203,237,211,243,213,248,211,253,218,267,221,276,215,276,214,278,195,278,195,282,179,282,177,285,166,285,162,289,154,291,152,294,146,294,146,302,126,318,116,304,118,302,116,299,117,290,106,278,123,265,123,266,123,266
----
Merced
114,249,117,245,142,238,145,245,148,249,153,251,152,256,143,256,136,258,130,262,125,263,106,278,96,269,97,261,99,255,113,250,114,249,114,249
----
Madera
167,243,173,243,174,239,178,238,179,234,192,227,194,228,193,235,198,232,203,236,192,245,188,252,180,254,180,258,172,257,175,261,168,260,163,269,146,270,132,278,122,266,124,263,130,262,135,258,142,256,151,256,152,252,167,243,167,243
----
Kings
162,324,161,303,164,302,164,295,162,294,162,289,153,291,151,295,146,295,146,303,128,318,128,325,161,324,162,324,162,324
----
Tulare
232,324,233,316,234,314,229,310,229,303,228,299,230,296,219,276,213,276,212,279,193,278,193,282,177,282,176,286,164,285,161,289,163,295,164,303,160,304,161,325,232,324,232,324
----
Mono
183,182,183,188,185,194,181,200,181,209,185,211,185,213,191,218,191,224,196,227,194,235,198,233,203,236,211,243,243,243,183,182,183,182
----
Inyo
241,243,320,324,233,324,233,317,235,314,229,310,229,303,228,299,231,295,220,276,217,267,211,253,213,247,211,242,242,244,241,243,241,243
----
San Luis Obispo
111,348,97,340,86,325,127,325,129,332,139,341,144,343,145,346,150,348,156,354,156,358,159,360,161,368,157,371,153,364,136,358,133,354,131,360,126,362,126,366,120,363,112,364,111,356,106,353,112,348,111,348,111,348
----
Santa Barbara
121,387,117,383,111,381,111,365,121,362,127,367,125,362,132,360,135,353,137,359,154,365,157,372,161,368,164,372,163,394,143,390,126,384,121,387,121,387
----
Ventura
186,402,175,401,163,395,163,372,166,369,172,371,177,376,186,376,193,397,186,402,186,402
----
Los Angeles
205,409,184,402,193,397,186,376,234,376,236,388,238,408,232,416,222,420,217,424,211,420,205,409,205,409
----
Kern
240,325,128,325,130,334,139,342,150,348,159,359,162,370,167,368,176,377,235,375,237,374,239,343,241,341,241,325,240,325,240,325
----
San Bernardino
392,401,320,324,240,325,241,342,238,345,236,374,234,377,237,407,256,422,264,413,290,414,303,417,386,414,390,409,392,401,392,401
----
Riverside
379,441,388,429,387,412,303,417,289,414,263,413,255,421,260,424,260,428,265,428,265,436,271,438,275,443,352,444,379,442,379,441,379,441
----
Orange
258,441,221,421,232,415,237,407,255,421,259,424,260,428,266,428,265,438,258,443,258,441,258,441
----
San Diego
322,482,284,484,280,475,276,464,270,451,258,440,264,437,272,438,275,443,283,445,321,444,321,483,322,482,322,482
----
Imperial
378,480,321,482,322,445,378,443,382,451,378,461,383,468,382,475,378,480,378,480
----
Stanislaus
113,229,95,240,98,257,113,249,118,244,141,237,132,228,127,214,124,230,112,229,113,229,113,229
----
Mariposa
168,228,154,225,151,228,148,227,147,231,144,231,145,236,141,237,143,245,151,254,165,242,172,243,172,238,177,238,177,234,191,227,194,226,189,224,184,221,181,223,178,220,169,229,157,226,153,226,151,229,152,229,168,228,168,228
----
Alpine
173,172,172,176,164,180,164,192,179,201,185,194,183,181,173,173,173,172,173,172
----
Calaveras
125,203,127,214,132,223,144,220,165,195,163,191,158,194,150,194,135,203,125,203,125,203
----
San Joaquin
108,205,97,213,97,222,94,225,95,240,113,229,124,229,127,215,125,203,120,206,107,206,108,205,108,205
----
Amador
125,189,126,194,125,203,135,203,150,194,158,194,163,191,164,179,154,186,142,189,124,189,125,189,125,189
----
Sacramento
83,212,96,213,107,205,118,205,124,203,125,195,123,188,120,180,104,180,106,189,103,197,102,203,94,206,93,210,79,212,83,212,83,212
----
Yolo
102,174,98,174,97,170,92,165,68,164,74,178,79,181,81,189,91,190,93,187,97,187,99,197,104,197,106,189,104,180,102,174,102,174
----
Solano
79,197,72,204,73,209,82,211,94,210,95,205,103,203,104,196,98,196,97,186,91,187,90,190,80,189,78,193,79,197,79,197
----
Napa
58,177,59,183,65,192,65,205,71,204,79,197,77,192,80,188,78,181,73,178,67,164,64,166,64,173,58,177,58,177
----
Sonoma
24,168,48,165,56,175,57,182,64,192,64,203,45,198,43,191,32,180,31,176,23,168,24,168,24,168
----
Marin
44,210,50,212,52,216,57,218,60,217,59,212,62,210,64,203,46,199,43,209,44,210,44,210
----
Tuolumne
165,195,144,219,131,223,132,227,142,237,146,236,145,230,149,230,149,226,154,228,155,225,169,228,178,220,182,222,185,221,190,225,190,218,185,213,185,210,180,209,180,200,165,193,164,196,165,195,165,195
----
Mendocino
10,107,16,116,16,126,15,132,20,151,21,161,24,169,50,165,43,158,46,155,46,150,43,145,45,137,53,132,53,114,56,109,11,108,10,107,10,107
----
Humboldt
21,38,17,50,19,59,12,70,9,70,1,85,2,92,10,107,31,108,33,73,32,65,39,65,39,59,45,53,43,51,44,42,33,43,30,37,21,37,21,38,21,38
----
Del Norte
24,14,19,24,20,37,29,37,32,43,37,42,38,37,35,34,42,31,43,21,50,15,24,14,24,14
----
Siskiyou
130,19,51,15,44,21,43,31,36,33,39,37,38,43,43,42,42,50,45,53,54,57,55,61,59,61,59,65,64,61,69,63,67,54,71,52,76,54,80,48,90,46,90,55,131,57,132,31,129,30,130,19,130,19
----
Modoc
183,22,130,19,131,57,179,60,182,22,183,22,183,22
----
Trinity
56,98,57,102,55,105,55,109,31,108,33,72,31,65,39,65,40,58,44,52,54,57,55,61,58,61,58,65,65,61,69,63,67,53,71,52,76,55,79,47,90,46,90,55,90,59,75,70,70,84,56,98,56,98
----
Shasta
124,95,120,96,115,94,111,96,94,96,83,97,78,95,71,98,67,96,57,98,69,84,74,70,90,59,89,54,131,57,132,93,124,95,124,95
----
Tehama
130,105,125,110,109,116,104,122,93,122,93,124,53,122,53,114,57,108,55,106,56,101,56,97,65,96,71,98,77,95,84,98,94,97,112,96,116,94,120,96,123,95,126,98,126,101,130,105,130,105
----
Lake
64,150,67,162,64,167,64,173,58,178,50,164,42,159,46,154,46,149,43,145,45,137,52,133,55,131,61,132,61,141,55,141,54,143,57,149,63,151,64,151,64,150,64,150
----
Colusa
95,143,92,149,92,156,94,164,67,163,64,151,57,149,53,143,56,141,83,142,84,140,87,141,89,143,95,143,95,143
----
Glenn
99,131,97,133,97,137,101,139,96,143,89,143,86,141,82,140,82,142,60,142,61,132,55,131,53,123,92,123,99,131,99,131
----
Sutter
113,166,111,170,111,179,103,180,102,174,97,173,97,169,93,164,92,156,91,149,108,151,108,157,113,166,113,166
----
Butte
120,143,115,144,115,146,107,151,91,149,95,143,101,139,96,137,96,132,99,131,92,123,102,122,109,116,125,109,128,117,126,124,130,128,132,135,126,140,121,138,120,143,120,143
----
El Dorado
170,160,163,160,157,164,149,164,148,167,131,166,122,177,126,188,143,188,155,185,162,180,172,176,173,172,170,169,170,160,170,160
----
Placer
171,152,146,151,138,158,135,158,129,163,121,161,113,165,111,170,111,179,120,179,122,177,131,166,146,168,150,164,157,164,163,161,171,160,171,153,171,152,171,152
----
Yuba
135,145,131,145,129,148,124,150,122,159,113,166,108,157,108,151,115,146,115,143,122,143,120,139,127,140,133,135,135,134,135,145,135,145
----
Nevada
172,143,150,142,146,139,136,144,131,144,129,148,124,150,122,161,130,164,136,157,138,158,146,151,170,152,171,143,171,144,172,143,172,143
----
Sierra
172,131,145,130,139,126,134,134,134,145,145,139,150,143,172,144,173,131,172,131,172,131
----
Plumas
141,94,124,94,126,102,130,105,125,110,128,117,126,124,130,129,132,134,140,126,145,130,168,131,171,124,169,117,154,102,149,103,148,106,141,102,141,93,141,94,141,94
----
Lassen
177,93,174,130,167,131,170,124,169,115,153,101,148,104,148,106,141,103,141,93,132,93,131,59,179,60,176,94,177,93,177,93
!end county_map
}}}
<<<
***/
 
/***
|Name|ImagePathPlugin|
|Source|http://www.TiddlyTools.com/#ImagePathPlugin|
|Version|0.7.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin,formatter|
|Requires||
|Overrides|'image' formatter|
|Description|Tell TiddlyWiki where to look for image files.  Permits multiple 'fallback' locations|
|Status|ALPHA - initial development/testing only - may be unstable - do not distribute|

!!!!!Usage
<<<
This plugin adds "resolvePath()" fallback processing to the {{{[img[...]]}}} formatter's handler, so that local image file references can be successfully resolved, even if the files cannot be located on the local filesystem.

The plugin tries alternative file "paths" that are listed, one per line, in an optional tiddler, [[ImagePathList]].  Each path in the list is combined with the image filename, which is then checked for existence, until the file is located.  If no alternative is found, or [[ImagePathList]] is not present, then a 'last-ditch' fallback is attempted using the remote system and path specified in [[SiteUrl]] (if present).

If no fallback attempt is successful (i.e., because no [[ImagePathList]] OR [[SiteUrl]] tiddlers have been defined), the plugin simply passes the original image file value along for default handling by the browser without any "path resolution" being applied.(i.e, the current TW core behavior occurs).

| ''Important note: This plugin may cause one or more security alert messages to appear, because it uses browser-specific functions that can require security permission in order to access the local filesystem to check for the existence of a given image file.  If you block local access, the 'last-ditch' fallback using the remote [[SiteUrl]] (if present) will be attempted.'' |

Note: the image formatter code contained here also includes support for AttachFilePlugin extensions (if installed).  AttachFilePlugin includes its own fallback mechanism for handling embedded vs. local file vs. remote URL references to the attached binary file.  Both methods may be used: ImagePathPlugin provides fallback for images contained in tiddler content, while AttachFilePlugin works well for access to non-image binary files (or images used in CSS as backgrounds, textures, etc.)
<<<
!!!!!Examples
<<<
coming soon...
<<<
!!!!!Revisions
<<<
''2007.04.13 [0.7.1]'' in testFile(), convert any file:// references to local native format before checking for existence.
''2007.03.26 [0.7.0]'' for IE, use onError handling to trigger call to resolvePath() so it will only be invoked if the original path/file is not found by the browser-native lookup.  This avoids an unneeded call to fileExists() and the accompanying ActiveX security alert message box (as well as being slightly more efficient...)
''2007.03.25 [0.6.0]'' code cleanup (moved global functions into config.formatterHelpers) plus documentation re-write
''2007.03.24 [0.5.0]'' initial implementation - ALPHA - do not distribute
<<<
!!!!!Code
***/
//{{{
version.extensions.ImagePathPlugin= {major: 0, minor: 7, revision: 1, date: new Date(2007,4,13)};
//}}}
//{{{
// name of path definition tiddler
if (config.options.txtPathTiddler==undefined) config.options.txtPathTiddler="ImagePathList";
//}}}
//{{{
// low-level wrapper for platform-specific tests for local file existence
// returns true/false without visible error display
// Uses Components for FF and ActiveX FSO object for MSIE
// NOTE: this can cause a security warning on some browsers
config.formatterHelpers.fileExists=function(theFile) {
	var found=false;
	// DEBUG: alert('testing fileExists('+theFile+')...');
	if(window.Components) {
		try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
		catch(e) { return false; } // security access denied
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		try { file.initWithPath(theFile); }
		catch(e) { return false; } // invalid directory
		found = file.exists();
	}
	else { // use ActiveX FSO object for MSIE 
		var fso = new ActiveXObject("Scripting.FileSystemObject");
		found = fso.FileExists(theFile)
	}
	// DEBUG: alert(theFile+" "+(found?"exists":"not found"));
	return found;
}
//}}}
//{{{
// higher-level logic for checking local file existence.
// with secondary check for finding relative file references
// and automatic OK of http-based references without checking local filesystem
config.formatterHelpers.testFile=function(theFile) {
	if (document.location.protocol!="file:") return true; // viewing remote document, can't test local filesystem... assume OK
	if (theFile.substr(0,5)=="http:") return true; // remote HTTP reference... assume OK
	if (theFile.substr(0,5)=="file:") theFile=getLocalPath(theFile); // convert local FILE reference to native format
	if (this.fileExists(theFile)) return true; // file exists locally... OK to use!
	// file might have been relative, add path from current document and try again
	var docPath=document.location.href;
	var slashpos=docPath.lastIndexOf("/"); if (slashpos==-1) slashpos=docPath.lastIndexOf("\\"); 
	if (slashpos!=-1 && slashpos!=docPath.length-1) docPath=docPath.substr(0,slashpos+1); // trim off filename
	if (this.fileExists(getLocalPath(docPath+theFile)))
		return true; // ah ha!... file exists relative to current document... OK to use!
	return false; // file not found on local system
}
//}}}
//{{{
// given a path/file string, check for existence and
// try alternatives (if any) defined in a tiddler
// with last-ditch using system/path from SiteUrl (if any)
config.formatterHelpers.resolvePath=function(theFile,testoriginal) {
	if (testoriginal && this.testFile(theFile)) return theFile; // FOUND FILE - use specified path/file without modification
	// get the filename portion only
	var slashpos=theFile.lastIndexOf("/"); if (slashpos==-1) slashpos=theFile.lastIndexOf("\\"); 
	var theName=(slashpos==-1)?theFile:theFile.substr(slashpos+1);
	// get list of fallbacks (if any)
	var pathText=store.getTiddlerText(config.options.txtPathTiddler);
	if (pathText && pathText.length) {
		var paths=pathText.split("\n");
		for (p=0; p<paths.length; p++) // combine path+filename until one works...
			if (this.testFile(paths[p]+theName))
				return paths[p]+theName; // FOUND FILE - use alternative path+filename
	}
	// try "last ditch" fallback using SiteURL - assumes that original path/file was relative to document location
	var siteURL=store.getTiddlerText("SiteUrl");
	if (!siteURL||!siteURL.length) return theFile; // NO FALLBACK - use original path/file and hope for the best
	// trim filename (if any) from site URL
	var slashpos=siteURL.lastIndexOf("/"); if (slashpos==-1) slashpos=siteURL.lastIndexOf("\\"); 
	if (slashpos!=-1 && slashpos!=siteURL.length-1) siteURL=siteURL.substr(0,slashpos+1);
	return siteURL+theFile; // LAST DITCH: use system/path from SiteUrl combined with original file/path
}
//}}}
//{{{
// replace standard handler for image formatter
// adds call to resolvePath() to handle fallback processing
// includes support for AttachFilePlugin as well
config.formatters[config.formatters.findByField("name","image")].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) {
		// Simple bracketted link
		var e = w.output;
		if(lookaheadMatch[5]) {
			var link = lookaheadMatch[5];
			if (!config.formatterHelpers.isExternalLink) // fixup for TW2.0.x
				var external=!store.tiddlerExists(link)&&!store.isShadowTiddler(link);
			else
				var external=config.formatterHelpers.isExternalLink(link);
			if (external) {
				if (config.macros.attach && config.macros.attach.isAttachment(link)) { // ELS - attachments
					e = createExternalLink(w.output,link);
					e.href=config.macros.attach.getAttachment(link);
					e.title = config.macros.attach.linkTooltip + link;
				} else
					e = createExternalLink(w.output,link);
			} else 
				e = createTiddlyLink(w.output,link,false,null,w.isStatic);
			addClass(e,"imageLink");
		}
		var img = createTiddlyElement(e,"img");
		if(lookaheadMatch[1])
			img.align = "left";
		else if(lookaheadMatch[2])
			img.align = "right";
		if(lookaheadMatch[3])
			img.title = lookaheadMatch[3];
		if (config.macros.attach!=undefined && config.macros.attach.isAttachment(lookaheadMatch[4])) // ELS - attachments
			img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);
		else {
			if (config.browser.isIE || config.browser.isSafari) { // ELS - path processing
				// IE and Safari use browser's onError handling to check the original file...
				// avoids extra security alert messages due to use of Components/ActiveX for filesystem access
				img.onerror=(function(){this.src=config.formatterHelpers.resolvePath(this.src,false);return false;});
				img.src=lookaheadMatch[4]; // ELS - path processing
			} else {
				// if NOT IE or Safari, always check the original path/file before rendering
				img.src=config.formatterHelpers.resolvePath(lookaheadMatch[4],true);
			}
		}
		w.nextMatch = this.lookaheadRegExp.lastIndex;
	}
}
//}}}
/***
|Name|ImageSizePlugin|
|Source|http://www.TiddlyTools.com/#ImageSizePlugin|
|Version|1.2.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin,formatter|
|Requires||
|Overrides|'image' formatter|
|Description|adds support for resizing images|
This plugin adds optional syntax to scale an image to a specified width and height and/or interactively resize the image with the mouse.
!!!!!Usage
<<<
The extended image syntax is:
{{{
[img(w+,h+)[...][...]]
}}}
where ''(w,h)'' indicates the desired width and height (in CSS units, e.g., px, em, cm, in, or %). Use ''auto'' (or a blank value) for either dimension to scale that dimension proportionally (i.e., maintain the aspect ratio). You can also calculate a CSS value 'on-the-fly' by using a //javascript expression// enclosed between """{{""" and """}}""". Appending a plus sign (+) to a dimension enables interactive resizing in that dimension (by dragging the mouse inside the image). Use ~SHIFT-click to show the full-sized (un-scaled) image. Use ~CTRL-click to restore the starting size (either scaled or full-sized).
<<<
!!!!!Examples
<<<
{{{
[img(100px+,75px+)[images/meow2.jpg]]
}}}
[img(100px+,75px+)[images/meow2.jpg]]
{{{
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img(  1%+,+)[images/meow.gif]]
}}}
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img(  1%+,+)[images/meow.gif]]
{{tagClear{
}}}
<<<
!!!!!Revisions
<<<
2009.02.24 [1.2.1] cleanup width/height regexp, use '+' suffix for resizing
2009.02.22 [1.2.0] added stretchable images
2008.01.19 [1.1.0] added evaluated width/height values
2008.01.18 [1.0.1] regexp for "(width,height)" now passes all CSS values to browser for validation
2008.01.17 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageSizePlugin= {major: 1, minor: 2, revision: 1, date: new Date(2009,2,24)};
//}}}
//{{{
var f=config.formatters[config.formatters.findByField("name","image")];
f.match="\\[[<>]?[Ii][Mm][Gg](?:\\([^,]*,[^\\)]*\\))?\\[";
f.lookaheadRegExp=/\[([<]?)(>?)[Ii][Mm][Gg](?:\(([^,]*),([^\)]*)\))?\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg;
f.handler=function(w) {
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var floatLeft=lookaheadMatch[1];
		var floatRight=lookaheadMatch[2];
		var width=lookaheadMatch[3];
		var height=lookaheadMatch[4];
		var tooltip=lookaheadMatch[5];
		var src=lookaheadMatch[6];
		var link=lookaheadMatch[7];

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

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

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

config.formatterHelpers.addStretchHandlers=function(e,stretchW,stretchH) {
	e.title=((stretchW||stretchH)?'DRAG=stretch/shrink, ':'')
		+'SHIFT-CLICK=show full size, CTRL-CLICK=restore initial size';
	e.statusMsg='width=%0, height=%1';
	e.style.cursor='move';
	e.originalW=e.style.width;
	e.originalH=e.style.height;
	e.minW=Math.max(e.offsetWidth/20,10);
	e.minH=Math.max(e.offsetHeight/20,10);
	e.stretchW=stretchW;
	e.stretchH=stretchH;
	e.onmousedown=function(ev) { var ev=ev||window.event;
		this.sizing=true;
		this.startX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
		this.startY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
		this.startW=this.offsetWidth;
		this.startH=this.offsetHeight;
		return false;
	};
	e.onmousemove=function(ev) { var ev=ev||window.event;
		if (this.sizing) {
			var s=this.style;
			var currX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
			var currY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
			var newW=(currX-this.offsetLeft)/(this.startX-this.offsetLeft)*this.startW;
			var newH=(currY-this.offsetTop )/(this.startY-this.offsetTop )*this.startH;
			if (this.stretchW) s.width =Math.floor(Math.max(newW,this.minW))+'px';
			if (this.stretchH) s.height=Math.floor(Math.max(newH,this.minH))+'px';
			clearMessage(); displayMessage(this.statusMsg.format([s.width,s.height]));
		}
		return false;
	};
	e.onmouseup=function(ev) { var ev=ev||window.event;
		if (ev.shiftKey) { this.style.width=this.style.height=''; }
		if (ev.ctrlKey)  { this.style.width=this.originalW; this.style.height=this.originalH; }
		this.sizing=false;
		clearMessage();
		return false;
	};
	e.onmouseout=function(ev) { var ev=ev||window.event;
		this.sizing=false;
		clearMessage();
		return false;
	};
}
//}}}
(:graph({pos:"inline",height:200,width:200,coords:"polar"})
grid(); axes(); :)
(:graph({height:200,width:200,coords:"polar"})
grid(); axes(); :)
(:graph({pos:"inline",height:200,width:200,coords:"cartesian"})
grid(); axes(); :)
(:graph({height:200,width:200,coords:"cartesian"})
grid(); axes(); :)
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2009.04.11 [1.9.5] pass current tiddler object into wrapper code so it can be referenced from within 'onclick' scripts
2009.02.26 [1.9.4] in $(), handle leading '#' on ID for compatibility with JQuery syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 5, date: new Date(2009,4,11)};

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

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

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

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

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

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

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

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

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

Notes:
*When writing scripts intended for use as bookmarklets, due to the ~URI-encoding required by the browser, ''you cannot not use ANY double-quotes (") within the bookmarklet script code.''
*All comments embedded in the bookmarklet script must ''use the fully-delimited {{{/* ... */}}} comment syntax,'' rather than the shorter {{{//}}} comment syntax.
*Most importantly, because bookmarklets are invoked directly from the browser interface and are not embedded within the TiddlyWiki document, there is NO containing 'place' DOM element surrounding the script.  As a result, ''you cannot use a bookmarklet to generate dynamic output in your document,''  and using {{{document.write()}}} or returning wiki-syntax text or making reference to the 'place' DOM element will halt the script and report a "Reference Error" when that bookmarklet is invoked.  
Please see [[InstantBookmarklets]] for many examples of 'onclick' scripts that can also be used as bookmarklets.
<<<
!!!!!Special reserved function name
<<<
The plugin 'wraps' all inline javascript code inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler.  To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.
<<<
!!!!!$(...) 'shorthand' function
<<<
As described by Dustin Diaz [[here|http://www.dustindiaz.com/top-ten-javascript/]], the plugin defines a 'shorthand' function that allows you to write:
{{{
$(id)
}}}
in place of the normal standard javascript syntax:
{{{
document.getElementById(id)
}}}
This function is provided merely as a convenience for javascript coders that may be familiar with this abbreviation, in order to allow them to save a few bytes when writing their own inline script code.
<<<
!!!!!Examples
<<<
simple dynamic output:
><script show>
	document.write("The current date/time is: "+(new Date())+"<br>");
	return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
	if (!window.story) window.story=window;
	var title=story.findContainingTiddler(place).getAttribute("tiddler");
	var size=store.getTiddlerText(title).length;
	return title+" is using "+size+" bytes";
</script>
dynamic output from an 'onclick' script, using {{{document.write()}}} and/or {{{return "..."}}}
><script label="click here" show>
	document.write("<br>The current date/time is: "+(new Date())+"<br>");
	return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
creating an 'onclick' button/link that accesses the link text AND the containing tiddler:
><script label="click here" title="clicking this link will show an 'alert' box" key="H" show>
	if (!window.story) window.story=window;
	var txt=place.firstChild.data;
	var tid=story.findContainingTiddler(place).getAttribute('tiddler');
	alert('Hello World!\nlinktext='+txt+'\ntiddler='+tid);
</script>
dynamically setting onclick link text based on stateful information:
>{{block{
{{{
<script label="click here">
	/* toggle "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.innerHTML=on?"enable":"disable";
	config.txtSomething=on?"OFF":"ON";
	return "\nThe current value is: "+config.txtSomething;
</script><script>
	/* initialize onclick link text based on current "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.lastChild.previousSibling.innerHTML=on?"disable":"enable";
</script>
}}}
<script label="click here">
	/* toggle "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.innerHTML=on?"enable":"disable";
	config.txtSomething=on?"OFF":"ON";
	return "\nThe current value is: "+config.txtSomething;
</script><script>
	/* initialize onclick link text based on current "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.lastChild.innerHTML=on?"enable":"disable";
</script>
}}}
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function inlineJavascriptDemo() { alert('Hello from demo.js!!') } }}}
>>{{{displayMessage('InlineJavascriptPlugin: demo.js has been loaded');}}}
>note: When using this example on your local system, you will need to download the external script file from the above URL and install it into the same directory as your document.
>
><script src="demo.js" show>
	return "inlineJavascriptDemo() function has been defined"
</script>
><script label="click to invoke inlineJavascriptDemo()" key="D" show>
	inlineJavascriptDemo();
</script>
<<<
!!!!!Revisions
<<<
2009.02.26 [1.9.4] in $(), handle leading '#' on ID for compatibility with JQuery syntax
2008.06.11 [1.9.3] added $(...) function as 'shorthand' for document.getElementById()
2008.03.03 [1.9.2] corrected fallback declaration of wikifyPlainText() (fixes Safari "parse error")
2008.02.23 [1.9.1] in onclick function, use string instead of array for 'bufferedHTML' (fixes IE errors)
2008.02.21 [1.9.0] output from 'onclick' scripts (return value or document.write() calls) are now buffered and rendered into into a span following the script.  Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed).  Thanks to Xavier Verges for suggestion and preliminary code.
2008.02.14 [1.8.1] added backward-compatibility for use of wikifyPlainText() in TW2.1.3 and earlier
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 [1.8.0] added support for key="X" syntax to specify custom access key definitions
2007.12.15 [1.7.0] autogenerate URI encoded HREF on links for onclick scripts.  Drag links to browser toolbar to create bookmarklets.  IMPORTANT NOTE: place is NOT defined when scripts are used as bookmarklets.  In addition, double-quotes will cause syntax errors.  Thanks to PaulReiber for debugging and brainstorming.
2007.11.26 [1.6.2] when converting "document.write()" function calls in inline code, allow whitespace between "write" and "(" so that "document.write ( foobar )" is properly converted.
2007.11.16 [1.6.1] when rendering "onclick scripts", pass label text through wikifyPlainText() to parse any embedded wiki-syntax to enable use of HTML entities or even TW macros to generate dynamic label text.
2007.02.19 [1.6.0] added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
2006.10.16 [1.5.2] add newline before closing '}' in 'function out_' wrapper.  Fixes error caused when last line of script is a comment.
2006.06.01 [1.5.1] when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
2006.04.19 [1.5.0] added 'show' parameter to force display of javascript source code in tiddler output
2006.01.05 [1.4.0] added support 'onclick' scripts.  When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked.  'place' value is set to match the clicked button/link element.
2005.12.13 [1.3.1] when catching eval error in IE, e.description contains the error text, instead of e.toString().  Fixed error reporting so IE shows the correct response text.  Based on a suggestion by UdoBorkowski
2005.11.09 [1.3.0] for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content.  Based on a suggestion by BradleyMeck
2005.11.08 [1.2.0] handle loading of javascript from an external URL via src="..." syntax
2005.11.08 [1.1.0] pass 'place' param into scripts to provide direct DOM access 
2005.11.08 [1.0.0] initial release
<<<
example (:graph({pos:"inline",width:50,height:30})
axes({ticklabels:false})
plot("sin(x)")
:) of an inline picture
config.formatters.unshift( {
    name: "inlinesliders",
    match: "\\+\\+\\+\\+|\\<slider",
    lookaheadRegExp: /(?:\+\+\+\+|<slider) (.*?)(?:>?)\n((?:.|\n)*?)\n(?:====|<\/slider>)/mg,
    handler: function(w)
    {
        this.lookaheadRegExp.lastIndex = w.matchStart;
        var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
        if(lookaheadMatch && lookaheadMatch.index == w.matchStart )
            {
            var btn = createTiddlyButton(w.output,lookaheadMatch[1] + " "+"\u00BB",lookaheadMatch[1],this.onClickSlider,"button sliderButton");
	        var panel = createTiddlyElement(w.output,"div",null,"sliderPanel");
	        panel.style.display = "none";
            wikify(lookaheadMatch[2],panel);
            w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
            }
    },
    onClickSlider : function(e)
    {
        if(!e) var e = window.event;
	    var n = this.nextSibling;
        n.style.display = (n.style.display=="none") ? "block" : "none";
        return false;
    }
})
#Copy the MathSVGPlugin tiddler to your ~TiddlyWiki and tag it with //systemConfig//
#Optionally, copy and adapt the MathSVGPluginComp tiddler for additional configuration
(:graph({scales:[-0.5,3.9,-0.5,4.5],coords:"none"})
axes({marker:">"});
plot("2*x-2",{min:0.9,max:3.1});
plot("-2*x+6",{min:0.9,max:3.1});
area("4+rnormal(0,0.05)","(-2*x+6)*step(2-x)+(2*x-2)*step(x-2)+0.01",{min:1, max:3, stroke:"none",fill:"#ddd",points:50});
:)
/*{{{*/
/**
* $Id: Jash.css,v 1.3 2007/11/16 03:06:33 billyreisinger Exp $
*
* Jash - JavaScript Shell
* Copyright: 2007, Billy Reisinger
* Documentation: http://www.billyreisinger.com/jash/
* License: GNU General Public License - http://www.gnu.org/licenses/gpl.html
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
#JashParent {
	width: 581px;
	height: 450px;
	border: 1px solid gray;
	-moz-border-radius: 10px; /* ELS */
	-webkit-border-radius: 10px; /* ELS */
	color: black;
	z-index: 10000;
	overflow: hidden;
	background: #ccc;
	opacity: 0.90;
	filter: alpha(opacity=90);
	position: absolute;
	left: 25%;
	color: black;
	font-family: monospace;
	margin: 0;
}
#JashParent div {
	margin: 0;
}
#JashParent a, #JashParent a:visited, #JashParent a:active, #JashParent a:hover {
	text-decoration: none;
	color: black;
}
.transparentMode {
	opacity: 0.20 !important;
	filter: alpha(opacity=20) !important;
}
#JashDragBar {
	BACKGROUND: gray;
	CURSOR: move;
	COLOR: white;
	font-family: arial,helvetica,sans-serif; /* ELS - changed from monospace to arial,helvetica,sans-serif */
	font-weight: bold;
	text-indent: 4px;
	font-size: 14pt; /* ELS - changed from 14px to 14pt */
	HEIGHT: 25px;
	TEXT-ALIGN: left;
	overflow: hidden;
	border: 1px outset white;
	-moz-border-radius-topleft: 10px; /* ELS */
	-moz-border-radius-topright: 10px; /* ELS */
	-webkit-border-top-left-radius: 10px; /* ELS */
	-webkit-border-top-right-radius: 10px; /* ELS */
}
.JashXButton {
    border: 1px solid white;
    -moz-border-radius: 5px; /* ELS */
    -webkit-border-radius: 5px; /* ELS */
    color: white !important;
    position: absolute;
    background: #bbb;
    width: 20px; 
    text-align: center;
    display: block;
    right: 3px; _right: 1px;
    top: 4px; _top: 1px;
    font-family: arial,helvetica,sans-serif; /* ELS - changed to arial,helvetica,sans-serif */
    font-size: 8pt; /* ELS - changed from 18px to 8pt */
    cursor: pointer;
}
a.JashXButton:hover {
	background: #ddd; 
}
#JashTextareaWrap {
	width: 100%;
	_height: 420px;
}
html>body #JashTextareaWrap {
	height: 100%;
}
#JashOutput {
	border: 2px inset white;
	FONT-SIZE: 10px;
	font-family: "Lucida Console", monaco, monospace;
	BACKGROUND: black;
	width: 99%;
	COLOR: lightgreen;
	PADDING: 2px;
	height: 60%;
	height: expression(parseInt(this.parentNode.parentNode.offsetHeight * (3/5)) + 'px');
	
}
#JashInput {
	padding: 2px;
	WIDTH: 99%;
	border: 2px inset white;
	-moz-border-radius-bottomleft: 10px; /* ELS */
	-moz-border-radius-bottomright: 10px; /* ELS */
	-webkit-border-bottom-left-radius: 10px; /* ELS */
	-webkit-border-bottom-right-radius: 10px; /* ELS */
	HEIGHT: 25%;
	font-family: monospace;
	font-size: 11px;
	height: expression(parseInt(this.parentNode.parentNode.offsetHeight * (3/13)) + 'px');
}
#JashParent .cssEntry {
	background: lightgreen;
	font-size: 11px;
	font-family: monospace;
}
#JashBottomBar {
	BACKGROUND: #ccc;
	POSITION: relative;
	HEIGHT: 20px;
	overflow: hidden;
	margin-top: 2px;
}
#JashBottomBar a {
	HEIGHT: 14px;
	font-size: 9px;
	font-weight: normal;
	font-family: arial;
	float: left;
	padding: 4px;
	background: #eee;
	cursor: pointer;
	border: 1px outset white;
	margin-right: 1px;
}
#JashBottomBar a:hover {
	padding-top: 3px;
	padding-bottom: 5px;
	background-color: white;
}
#JashBottomBar a:active, #JashBottomBar a:focus {
	padding-top: 5px;
	padding-bottom: 3px;
	background-color: #ddd;
}
#JashResizeButton {
	BORDER: 1px solid gray;
	-moz-border-radius-bottomright: 10px; /* ELS */
	-webkit-border-bottom-right-radius: 10px; /* ELS */
	BACKGROUND: #eee;
	WIDTH: 17px;
	height: 17px;
	line-height: 0;
	CURSOR: move;
	position: absolute;
	bottom: -1px;
	right: -1px;
	z-index: 2000;
}
/*}}}*/
//{{{
// Jash - JavaScript Shell
// Copyright: 2007, Billy Reisinger
// Documentation: http://www.billyreisinger.com/jash/
// License: GNU General Public License - http://www.gnu.org/licenses/gpl.html

// MODIFIED BY ELS (www.TiddlyTools.com) on 12/11/2007 for embedded use within TiddlyWiki documents
// * disabled setting of stylesheet from remote URL - use internal CSS definitions instead (see [[jash.css]] tiddler)
// * disabled automatic display on startup (but initialize jash panel so ESC key will work)

window.Jash=function(){this.jashRoot="http://www.billyreisinger.com/jash/source/latest/";this.domGetElFunctions={id:new Array("document.getElementById","$"),className:new Array("getElementsByClassName","$C")};var line="-------------------------------------------------";var _null="nooutput";this.revision="$Revision: 1.14 $".replace(/(\$|[A-Za-z]|\s|:)/g,'');this.version="$Name: REL_1_35_7 $".replace(/\$|Name:|\s|REL_/g,'').replace(/_/g,'.');this.versionDate="$Date: 2007/11/16 03:24:54 $";this.main=function(){this.browser=this.returnBrowserType();this.lineNumber=0;this.mainBlock;this.output=document.getElementById("JashOutput");this.input;this.outputHistory=new Array();this.cssEvalFlag=false;this.innerHtmlInspection=false;this.accessKeyText=this.getAccessKeyText();this.defaultText="Jash, v"+this.version+"\nEnter \"jash.help()\" for a list of commands.\n";this.cls=this.clear;this.tabIndexIndex=0;this.currentNode={};this.tips=["Did you know?\nThe DOM Inspector will automatically put\n an element with an ID in the input field for you.","Did you know?\nYou can tie this script into your own to jash scripts. Use 'jash.methodName' anywhere\n in your scripts, and pull\n up this window before executing to see\n the results.","Did you know?\nUse jash.stopWatch.start() and jash.stopWatch.stop() to\n time execution speeds! Handy for optimization.","Did you know?\nPress TAB to complete a function, method, or property name.\n If more than one match is found, a list of possible\n matches will appear.","Did you know?\nYou can use jash.show() to show a list of the names\nand types of an object's members.\nOn the other hand, jash.dump will show names and\n_values_ of an object's members.","Whoa ---- you can now tab-complete HTML element ids after typing document.getElementsById(' (or the '$' shorthand if using Prototype).  This also works with class names (i.e. document.getElementsByClassName)"]
this.defaultText+=line+"\n"+this.tips[(parseInt((Math.random()*10)%this.tips.length))]+"\n"+line+"\n";

/* 
ELS: disable loading of remote stylesheet!  (use styles from [[jash.css]] tiddler intead)
if(this.returnBrowserType()!="sa"){this.stylesheet=document.body.appendChild(document.createElement('link'));}else{this.stylesheet=document.getElementsByTagName("head")[0].appendChild(document.createElement("link"));}
this.stylesheet.type='text/css';this.stylesheet.rel='stylesheet';this.stylesheet.href=this.jashRoot+'Jash.css';
*/

this.create();Jash.TabComplete.prototype=this;this.tabComplete=new Jash.TabComplete();Jash.Evaluator.prototype=this;this.evaluation=new Jash.Evaluator();this.history=new Jash.History();var _self=this;window.setTimeout(function(){_self.input.focus();},500);if(typeof event!="undefined")delete event;}
this.returnBrowserType=function(){if(window.navigator.userAgent.toLowerCase().indexOf("opera")!=-1){return"op";}
if(window.navigator.userAgent.toLowerCase().indexOf("msie")!=-1){return"ie";}
if(window.navigator.userAgent.toLowerCase().indexOf("firefox")!=-1){return"ff";}
if(window.navigator.userAgent.toLowerCase().indexOf("safari")!=-1){return"sa";}}
this.returnOsType=function(){var ua=window.navigator.userAgent.toLowerCase();if(ua.indexOf("macintosh")!=-1){return"mac";}else if(ua.indexOf("windows")!=-1){return"win";}else if(ua.indexOf("linux i686")!=-1){return"linux";}}
this.getAccessKeyText=function(){var txt;var agt=this.returnOsType();switch(this.browser){case"ie":txt="Alt";break;case"ff":if(agt=="mac"){txt="Ctrl";}else if(agt=="linux"){txt="Alt";}else{txt="Alt-Shift";}
break;case"op":txt="Shift-Esc";break;case"sa":if(agt=="mac"){txt="Ctrl";}else{txt="Alt";}
break;default:txt="Alt";break;}
return txt;}
this.print=function(text,clear,suppressLineNumbers,autoscroll){clear=(typeof clear!="undefined")?clear:false;autoscroll=(typeof autoscroll!="undefined")?autoscroll:true;if(this.output==null||document.getElementById("JashParent")==null){this.create();this.output=document.getElementById("JashOutput");this.mainBlock=document.getElementById("JashParent");}
if(clear){this.clear();}
if(text!=""){if(typeof suppressLineNumbers!="undefined"&&!suppressLineNumbers){this.output.value+=this.lineNumber+". ";}
this.output.value+=text+"\n";if(autoscroll){this.output.scrollTop=this.output.scrollHeight;}
this.lineNumber++;}
return _null;}
this.show=function(obj){this.print(line,false,true);var out="";this.lineNumber=0;for(var p in obj){if(typeof obj[p]=="function"){var t=obj[p].toString();t=t.replace(/[\x0A\x0D]/g,"").replace(/\s+/g,"").replace(/\{.+\}/g,"{ ... }");t=t.replace(p,"");t=p+": "+t;}else{t=p+": "+typeof obj[p];}
out+=++this.lineNumber+". "+t+"\n";}
this.print(out,false,true);this.print(line,false,true);this.output.scrollTop=this.output.scrollHeight;return _null;}
this.dump=function(obj){if(typeof obj=="string"){this.print(obj);}else{this.print(line,false,true);var out=new Array();if(typeof obj.push=="undefined"){for(var th in obj){out.push(++this.lineNumber+". "+th+" = "+obj[th]);}}else{for(var i=0;i<obj.length;i++){out.push(++this.lineNumber+". "+obj[i]);}}
this.print(out.join("\n"),false,true);this.print(line,false,true);this.output.scrollTop=this.output.scrollHeight;}
return _null;}
this.clear=function(){this.outputHistory.push(this.output.value);this.output.value="";this.input.focus();return _null;}
this.showOutputHistory=function(){this.outputHistory.push(this.output.value);this.dump(this.outputHistory);}
this.assignInputKeyEvent=function(keyCode){if(keyCode==13){this.evaluation.evaluate(this.input.value);this.input.value="";return false;}else if(keyCode==38){if(this.browser!="op"){this.input.value=this.history.getPreviousInput();}
return false;}else if(keyCode==40){if(this.browser!="op"){this.input.value=this.history.getNextInput();}
return false;}else if(keyCode==9){this.tabComplete.tabComplete();return false;}}
this.getXBrowserYOffset=function(){var y;if(self.pageYOffset){y=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){y=document.documentElement.scrollTop;}else if(document.body){y=document.body.scrollTop;}
return y;}
this.getMouseXY=function(e){var tempX=0
var tempY=0
if(window.event){if(document.documentElement&&document.documentElement.scrollTop){tempX=window.event.clientX+document.documentElement.scrollLeft;tempY=window.event.clientY+document.documentElement.scrollTop;}else{tempX=window.event.clientX+document.body.scrollLeft;tempY=window.event.clientY+document.body.scrollTop;}}else{tempX=e.pageX;tempY=e.pageY;}
return{x:tempX,y:tempY};}
this.getDimensions=function(el){var dims={}
if(document.all){dims.x=el.offsetWidth;dims.y=el.offsetHeight;}else{dims.x=parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("width"));dims.y=parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("height"));}
return dims;}
this.addEvent=function(obj,eventName,func){if(obj.addEventListener)
return obj.addEventListener(eventName,func,true);else if(obj.attachEvent){obj.attachEvent("on"+eventName,func);return true;}
return false;}
this.findElementPosition=function(obj){var curleft=0;var curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft
curtop=obj.offsetTop
while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}}
return[curleft,curtop];}
this.create=function(){if(document.getElementsByTagName("frameset").length>0){alert("Jash currently does not support pages with frames.");return;}
var self=this;var debugParent=document.createElement("div");var windowScrollY=0;if(document.documentElement&&document.documentElement.scrollTop){windowScrollY=document.documentElement.scrollTop;}else if(document.body){windowScrollY=document.body.scrollTop}else{windowScrollY=window.scrollY;}





debugParent.style.top=windowScrollY+50+"px";debugParent.id="JashParent";

/*
ELS: 12/12/2007 - REMOVED ESC HANDLER SO OTHER PAGE ELEMENTS GET THEM!... SEE BELOW FOR ALTERNATIVE SHIFT-ESC HANDLER
this.addEvent(document,"keydown",function(e){e=(typeof window.event!="undefined")?window.event:e;if(e.keyCode=="27"){if(typeof e.shiftKey=="undefined"||!e.shiftKey && (this.mainBlock.style.display!="none")){self.close();}}});
*/

var textareaWrap=document.createElement("div");textareaWrap.id="JashTextareaWrap";var debugOutput=document.createElement("textarea");debugOutput.id="JashOutput";debugOutput.wrap="off";debugOutput.readOnly="true";debugOutput.value=this.defaultText;var inp=document.createElement("textarea");inp.id="JashInput";var last="";inp.onkeydown=function(e){e=(typeof window.event!="undefined")?window.event:e;return self.assignInputKeyEvent(e.keyCode);}
inp.onkeypress=function(e){e=(typeof window.event!="undefined")?window.event:e;var k=e.keyCode;if(!self.evaluation.cssEvalFlag){if(k==9||k==13||k==38||k==40){if(k!=40&&this.browser!="ie"){return false;}}}else if(k==9){return false;}}
var dragBut=document.createElement("div");dragBut.innerHTML="Jash";dragBut.id="JashDragBar";dragBut.onmousedown=function(e){e=(typeof window.event!="undefined")?window.event:e;var xplus=(typeof e.layerX=="undefined")?e.offsetX:e.layerX;var yplus=(typeof e.layerY=="undefined")?e.offsetY:e.layerY;document.onmousemove=function(e){var coords=self.getMouseXY(e);document.getElementById("JashParent").style.top=coords.y-yplus+"px";document.getElementById("JashParent").style.left=coords.x-xplus+"px";}
return false;}
document.onmouseup=function(){document.onmousemove=null;};dragBut.onclick=function(){return false;}
var xBut=document.createElement("a");xBut.className="JashXButton";xBut.innerHTML="X";xBut.href="#";xBut.onclick=function(){self.close();return false;}
var clearBut=document.createElement("a");clearBut.innerHTML="Clear ("+this.accessKeyText+"-C)";clearBut.accessKey="C";clearBut.className="JashButton";clearBut.onclick=function(){self.clear();return false;}
this.setCrossBrowserAccessKeyFunctionForAnchor(clearBut);var evalBut=document.createElement("a");evalBut.value="Evaluate ("+this.accessKeyText+"-Z)";evalBut.innerHTML="Evaluate ("+this.accessKeyText+"-Z)";evalBut.accessKey="Z";evalBut.className="JashButton";evalBut.title="Evaluate current input ("+this.accessKeyText+"-Z)";evalBut.onclick=function(){self.evaluation.evaluate(inp.value);if(!self.evaluation.cssEvalFlag){inp.value="";}
inp.focus();return false;}
this.setCrossBrowserAccessKeyFunctionForAnchor(evalBut);var helpBut=document.createElement("a");helpBut.innerHTML="Help";helpBut.className="JashButton";helpBut.title="Help: show list of commands (or type jash.help(); )";helpBut.onclick=function(){self.help();}
var domBut=document.createElement("a");domBut.innerHTML="Mouseover DOM ("+this.accessKeyText+"-X)";domBut.title="Mouseover DOM: toggle to turn on/off inspection of document nodes ("+this.accessKeyText+"-X)";domBut.className="JashButton";domBut.accessKey="X";domBut.tabIndex="4";this.domActive=false;domBut.onclick=function(){if(!self.domActive){document.body.onmouseover=function(e){if(typeof e=="undefined"){e=window.event;}
self.showNodes(e);}
self.setButtonVisualActiveState(domBut,"on");self.domActive=true;}else{document.body.onmouseover=function(){}
self.domActive=false;self.setButtonVisualActiveState(domBut,"off");}
return _null;}
this.setCrossBrowserAccessKeyFunctionForAnchor(domBut);var innerHtmlInspectBut=document.createElement("a");innerHtmlInspectBut.innerHTML="innerHTML Dump ("+this.accessKeyText+"-A)";innerHtmlInspectBut.title="innerHTML Inspect: toggle to turn on/off innerHTML inspection of document nodes ("+this.accessKeyText+"-A)";innerHtmlInspectBut.className="JashButton";innerHtmlInspectBut.accessKey="A";innerHtmlInspectBut.tabIndex="5";this.innerHtmlInspection=false;innerHtmlInspectBut.onclick=function(){self.innerHtmlInspection=!self.innerHtmlInspection;self.setButtonVisualActiveState(innerHtmlInspectBut,self.innerHtmlInspection?"on":"off");return _null;}
this.setCrossBrowserAccessKeyFunctionForAnchor(innerHtmlInspectBut);var cssBut=document.createElement("a");cssBut.innerHTML="CSS Input ("+this.accessKeyText+"-S)";cssBut.title="CSS Input: turn on CSS input to enter arbitrary CSS ("+this.accessKeyText+"-S)";cssBut.className="JashButton";cssBut.accessKey="S";cssBut.onclick=function(){if(!self.evaluation.cssEvalFlag){self.setButtonVisualActiveState(cssBut,"on");self.evaluation.cssEvalFlag=true;inp.className="cssEntry";if(document.getElementById("JashStyleInput")!=null){self.evaluation.styleInputTag.disabled=false;}
inp.value="";}else{self.setButtonVisualActiveState(cssBut,"off");inp.className="";self.evaluation.cssEvalFlag=false;if(document.getElementById("JashStyleInput")!=null){self.evaluation.styleInputTag.disabled=true;}
inp.value="";}
inp.focus();return _null;}
this.setCrossBrowserAccessKeyFunctionForAnchor(cssBut);var resizeBut=document.createElement("div");resizeBut.id="JashResizeButton";this.minDims={x:100,y:100};resizeBut.onmousedown=function(e){e=(typeof window.event!="undefined")?window.event:e;var originalDims=self.getDimensions(textareaWrap);var originMouseDims=self.getMouseXY(e);document.onmousemove=function(e){var newMouseDims=self.getMouseXY(e);var newWidth=originalDims.x+(newMouseDims.x-originMouseDims.x);if(newWidth<self.minDims.x){newWidth=self.minDims.x;}
textareaWrap.style.width=newWidth+"px";debugParent.style.width=newWidth+"px";var newHeight=originalDims.y+(newMouseDims.y-originMouseDims.y);if(newHeight<self.minDims.y){newHeight=self.minDims.y;}
textareaWrap.style.height=newHeight+"px";debugParent.style.height=newHeight+"px";}
document.onmouseup=function(){document.onmousemove="";}}
var bottomBar=document.createElement("div");bottomBar.id="JashBottomBar";debugParent.appendChild(dragBut);debugParent.appendChild(xBut);bottomBar.appendChild(evalBut);bottomBar.appendChild(cssBut);bottomBar.appendChild(domBut);bottomBar.appendChild(innerHtmlInspectBut);bottomBar.appendChild(clearBut);bottomBar.appendChild(helpBut);debugParent.appendChild(bottomBar);debugParent.appendChild(resizeBut);document.body.appendChild(debugParent);textareaWrap.appendChild(debugOutput);textareaWrap.appendChild(inp);debugParent.appendChild(textareaWrap);this.bottomBar=document.getElementById("JashBottomBar");this.dragBar=document.getElementById("JashDragBar")
this.output=document.getElementById("JashOutput");this.input=document.getElementById("JashInput");this.mainBlock=debugParent;this.addEvent(window,'scroll',function(){debugParent.style.top=50+self.getXBrowserYOffset()+'px';});}
this.setButtonVisualActiveState=function(button,state){if(state=="on"){button.style.backgroundColor="lightgreen";}else{button.style.backgroundColor="";}}
this.help=function(){var out=new Array();out.push(line);out.push("Jash v"+this.version+" "+this.versionDate.replace(/\$/g,''),true);out.push("http://www.billyreisinger.com/jash/documentation.html");out.push(line);out.push("METHODS");out.push(line);out.push("this.cls() - clear console and terminal");out.push("jash.print(str,clear) - output str to console ~~ str = string ~~ clear = true|false: clear console before output");out.push("this.close() - close this console");out.push("this.dump(obj) - output object and members to console");out.push("this.show(obj) - print out the names and types (only) of all members of obj");out.push("this.stopWatch.start() - start timer");out.push("this.stopWatch.stop() - end timer and return result in ms");out.push("this.kill(HTML Element) - remove an element from the page.");out.push("this.getDimensions(HTML Element) - get width, height dimensions of an html element. Returns an object [x,y]");out.push(line);out.push("KEYSTROKES");out.push(line);out.push("press up arrow in input field to retrieve last input");out.push("press ESC to show/hide console");out.push("press "+this.accessKeyText+"-Q to turn on/off Transparent mode, so you can see through the Jash.");out.push("press ENTER in input field to enter a command");out.push("press TAB to auto-complete input");out.push("press "+this.accessKeyText+"-Z to evaluate input");out.push("press "+this.accessKeyText+"-X to activate/deactivate DOM inspector");out.push("press "+this.accessKeyText+"-A to activate/deactivate innerHTML dump (only works w/ DOM inspector)");out.push("press "+this.accessKeyText+"-C to clear output and input");out.push("press "+this.accessKeyText+"-S to turn on/off CSS input mode. In CSS input mode, you can enter arbitrary CSS selectors and rules, as you would normally do in a CSS stylesheet.");this.print(out.join("\n"));return _null;}
this.close=function(){if(this.mainBlock.style.display=="none"){this.mainBlock.style.display="block";this.input.focus();}else{this.mainBlock.style.display="none";}}
this.setCrossBrowserAccessKeyFunctionForAnchor=function(el){var self=this;el.tabIndex=++this.tabIndexIndex;if(this.browser=="ie"){el.onfocus=function(){if(window.event.altKey){el.onclick();}
self.input.focus();}}}
this.stopWatch={t_start:0,t_end:0,t_total:0,start:function(){t_start=new Date().getTime();return t_start;},stop:function(){t_end=new Date().getTime();t_total=t_end-t_start;return(t_total);}}
this.showNodes=function(e){if(typeof e=="undefined")e=window.event;var el=typeof e.target=="undefined"?e.srcElement:e.target;this.currentNode=el;var childMost=this.identifyNode(el,false);var out="";var childmostTxt="childmost..... "+childMost.txt+"\n";while(el=el.parentNode){if(el.nodeName.toLowerCase()=="html"){out="parentmost.... <html>\n"+out;break;}
out=this.identifyNode(el).txt+"\n"+out;}
out="**** PRESS "+this.accessKeyText+"-X TO PAUSE / UNPAUSE ****\n"+out;out+=childmostTxt;this.print(out,true,true,false);if(this.innerHtmlInspection){this.print("INNER HTML");if(this.currentNode.innerHTML.indexOf("<")!=-1){this.print(Jash.Indenter.indent(this.currentNode.innerHTML),false,true,false);}else{this.print(this.currentNode.innerHTML,false,true,false);}}
if(!this.evaluation.cssEvalFlag){if(childMost.id!=""){if(typeof $!="undefined"){this.input.value='$("'+childMost.id+'")';}else{this.input.value='document.getElementById("'+childMost.id+'")';}}else{this.input.value="this.currentNode";}}}
this.identifyNode=function(el,showDots){showDots=typeof showDots=="boolean"?showDots:true;var out={txt:"",id:""};if(showDots)out.txt+=".............. ";out.txt+="<"+el.nodeName.toLowerCase();for(var i=0;i<el.attributes.length;i++){if((this.browser=="ie"&&el.attributes[i].specified===true)||this.browser!="ie"){out.txt+=" "+el.attributes[i].name;out.txt+="=\""+el.attributes[i].value+"\"";}}
out.txt+=">";return out;}
this.kill=function(){this.currentNode.parentNode.removeChild(this.currentNode);}}
Jash.Evaluator=function(){this.cssEvalFlag=false;var _null="nooutput";this.evaluate=function(input){if(input=="")return false;this.history.add(input);if(this.cssEvalFlag){this.evalCss(input);this.print(input);}else{var output=this.evalJs(input);if(typeof output!="undefined"){this.print(">> "+input);this.print(output);}}}
this.evalJs=function(input){try{var result;if(this.browser=="ie"){result=eval(input);}else{result=window.eval(input);}
if(result!=null&&result.toString()!=_null){return(result.toString());}else{return"null"}}catch(e){return(e.message);}}
this.evalCss=function(input){try{this.insertStyleRule(input);}catch(e){}
return input;}
this.insertStyleRule=function(rule){var lastStyleSheetIndex=document.styleSheets.length-1;if(document.getElementById("JashStyleInput")==null){this.styleInputTag=document.createElement("style");this.styleInputTag.id="JashStyleInput";this.styleInputTag.type="text/css";document.body.appendChild(this.styleInputTag);}
if(this.browser=="ff"||this.browser=="op"){this.styleInputTag.innerHTML+=rule+"\n";}else if(this.browser=="ie"||this.browser=="sa"){if(this.browser=="ie"){var i=0;}else if(this.browser="sa"){var i=document.styleSheets.length-1;}
var rulesArray=rule.split("}");for(var t=0;t<rulesArray.length;t++){var ruleSplit=rulesArray[t].split("{");var selectors=ruleSplit[0].split(",");for(var k=0;k<selectors.length;k++){document.styleSheets[i].addRule(selectors[k],ruleSplit[1]);}}}
return"";}
return this;}
Jash.History=function(){this.entries=new Array('');this.position=0;}
Jash.History.prototype={add:function(input){this.entries.push(input);this.position=this.entries.length-1;},getPreviousInput:function(){if(this.position<0){return'';}
var entry=typeof this.entries[this.position]!="undefined"?this.entries[this.position]:'';if(this.position>0){this.position--;}
return entry;},getNextInput:function(){if(this.position+1<this.entries.length){return this.entries[++this.position];}else{return'';}}}
Jash.Indenter={indentChar:"\t",nodesCommonlyUnclosed:new Array("link ","img ","meta ","!DOCTYPE ","input ","param","hr","br"),stringRepeat:function(stringToRepeat,times){var string=new Array();for(var i=0;i<times;i++){string.push(stringToRepeat);}
return string.join('');},closeUnclosedNode:function(str){for(var k=0;k<this.nodesCommonlyUnclosed.length;k++){var reg=new RegExp("^"+this.nodesCommonlyUnclosed[k].toLowerCase());if(str.toLowerCase().match(reg)){return str.replace(">","/>");}}
return str;},indentAndAdd:function(level,string,arr){var indents=this.stringRepeat(this.indentChar,level);arr.push(indents+string);return arr;},indent:function(source){var source=source;var arr=new Array();source=source.replace(/[\n\r\t]/g,'');source=source.replace(/>\s+/g,">");source=source.replace(/\s+</g,"<");var splitsrc=source.split("<");for(i=0;i<splitsrc.length;i++){splitsrc[i]=this.closeUnclosedNode(splitsrc[i]);}
source=splitsrc.join("<");var level=0;var sourceLength=source.length;var position=0;while(position<sourceLength){if(source.charAt(position)=='<'){var startedAt=position;var tagLevel=1;if(source.charAt(position+1)=='/'){tagLevel=-1;}
if(source.charAt(position+1)=='!'){tagLevel=0;}
while(source.charAt(position)!='>'){position++;}
if(source.charAt(position-1)=='/'){tagLevel=0;}
var tagLength=position+1-startedAt;if(tagLevel===-1){level--;}
arr=this.indentAndAdd(level,source.substr(startedAt,tagLength),arr);if(tagLevel===1){level++;}}
if((position+1)<sourceLength){if(source.charAt(position+1)!=='<'){startedAt=position+1;while(source.charAt(position)!=='<'&&position<sourceLength){position++;}
if(source.charAt(position)==='<'){tagLength=position-startedAt;arr=this.indentAndAdd(level,source.substr(startedAt,tagLength),arr);}}else{position++;}}else{break;}}
return arr.join("\n");}}
Jash.Profiler=function(func,onFinish){this.func=func;this.time=0;this.defaultOnFinish=function(){};this.results=new Array();this.onFinish=typeof onFinish!="function"?this.defaultOnFinish:onFinish;var self=this;this.reverseWhile=function(reps){this.stopWatch.start();while(reps>0){this.func();reps--;}
return this.stopWatch.stop();}
this.forLoop=function(reps){this.stopWatch.start();for(i=0;i<reps;i++){this.func();}
return this.stopWatch.stop();}
this.loop=function(kind,reps){if(!this.results[kind]){this.results[kind]=new Array();}
var repsMemberName="r_"+reps;if(!this.results[kind][repsMemberName]){this.results[kind][repsMemberName]=new Array();}
var time=this[kind](reps);this.results[kind][repsMemberName].push(time);}
this.runOnce=function(){if(!this.results.runOnce){this.results.runOnce=new Array();}
this.stopWatch.start();func();this.results.runOnce.push(this.stopWatch.stop());}
this.stopWatch={t_start:0,t_end:0,t_total:0,start:function(){t_start=new Date().getTime();return t_start;},stop:function(){t_end=new Date().getTime();t_total=t_end-t_start;self.time=t_total;return t_total;}}
this.average=function(arr){var sum=0;for(i=0;i<arr.length;i++){sum+=arr[i];}
return sum/arr.length}
this.multiPass=function(passes,type,reps){if(typeof type=="undefined"){type="runOnce";}else if(typeof this[type]=="undefined"){jash.print("Error: the loop type '"+type+"' does not exist");return false;}
var self=this;if(type=="runOnce"){if(passes<1){self.reportProfile(Math.round(this.average(this.results.runOnce)),type,reps);}else{window.setTimeout(function(){self.runOnce();self.multiPass(--passes,type);},50);}}else{if(passes<1){var repsMemberName="r_"+reps;self.reportProfile(Math.round(this.average(this.results[type][repsMemberName])),type,reps);}else{window.setTimeout(function(){self.loop(type,reps);self.multiPass(--passes,type,reps);},50);}}}
this.reportProfile=function(avgMs,type,reps){var line="-------PROFILER----------------------------------------------";var str=line+"\n"+this.func+"\n"+line+"\n";str+="Type of profile: "+type+"\n";if(typeof reps!="undefined"){str+="Loop iterations: "+reps+"\n";}
str+="Average execution time: "+avgMs+"ms"+"\n";if(type=="runOnce"){howManyTimes=this.results.runOnce.length;}else{repsMemberName="r_"+reps;howManyTimes=this.results[type][repsMemberName].length;}
str+="Average calculated from "+howManyTimes+" pass(es)\n";str+=line+"\n";jash.print(str);}}
Jash.TabComplete=function(){this.tabComplete=function(e){e=(typeof window.event!="undefined")?window.event:e;var inputText=this.input.value;var match=null;if(match=this.searchInputForDomGetElFunctions(inputText)){this.tabCompleteIdOrClassInJavascript(match.match[0],match.type);this.focusCaretAtEndOfInput();return false;}else if(this.evaluation.cssEvalFlag){this.tabCompleteIdOrClassInCss(inputText);this.focusCaretAtEndOfInput();return false;}else{this.tabCompleteJavascript(e,inputText);this.focusCaretAtEndOfInput();}}
this.focusCaretAtEndOfInput=function(){this.input.selectionEnd=this.input.selectionStart=this.input.value.length;}
this.tabCompleteJavascript=function(e,inputText){var words=inputText.split(/\s+/);var lastWord=words[(words.length-1)];var numOpeningParens=lastWord.split("(").length-1;var numClosingParens=lastWord.split(")").length-1;var scope;var sentinel=0;var diff=numOpeningParens-numClosingParens;if(diff>0){numClosingParens=lastWord.split("(")[numOpeningParens].split(")").length-1;var numRealDanglers=numOpeningParens-numClosingParens;scope=lastWord.split("(").slice(numRealDanglers).join("(");}else if(diff<0){this.print("error: too many closing parentheses");return false;}else{scope=lastWord;}
scope=scope.split(".");var fragment=scope.pop();scope=scope.join(".");if(scope=="")scope="window";var members=this.getMembers(scope);var results=this.findTextMatchesInArray(members,fragment);if(results==false){}else if(typeof results!="string"){this.dump(results);var bestMatch=this.findBestStringMatch(fragment,results);if(fragment!=''){fragReg=new RegExp(fragment+"$");this.input.value=this.input.value.replace(fragReg,bestMatch);}else{this.input.value+=bestMatch;}}else{var reggie=new RegExp(fragment+"$");this.input.value=this.input.value.replace(reggie,results);}
return false;}
this.doAllStringsInArrayHaveSameCharacterAtIndex=function(index,arr){var matched=0;if(!arr[0].charAt(index))return false;var character=arr[0].charAt(index);for(var i=1;i<arr.length;i++){if(!arr[i].charAt(index)||arr[i].charAt(index)!=character){return false;}}
return true;}
this.findBestStringMatch=function(str,arr){var fragLength=str.length;var matches=this.doAllStringsInArrayHaveSameCharacterAtIndex(fragLength,arr);while(matches){fragLength++;matches=this.doAllStringsInArrayHaveSameCharacterAtIndex(fragLength,arr);}
return arr[0].substr(0,fragLength);}
this.tabCompleteIdOrClassInJavascript=function(inputText,type){var query=inputText.split("(");query=query[query.length-1].replace(/\W/g,'');var matches=new Array();var els=document.getElementsByTagName("*");if(type=="id"){for(var i=0;i<els.length;i++){if(els[i].id&&els[i].id.indexOf(query)==0){matches.push(els[i].id);}}}else if(type=="class"){for(var i=0;i<els.length;i++){if(els[i].className&&els[i].className!=''){var classes=els[i].className.split(/\s/);for(var ii=0;ii<classes.length;ii++){if(classes[ii].indexOf(query)==0||query==''){if(matches.join("***").indexOf(classes[ii])==-1){matches.push(classes[ii]);}}}}}}
if(matches.length==1){this.input.value+=matches[0].split(query)[1];}else if(matches.length==0){this.print("no match");}else{this.dump(matches.sort());var bestMatch=this.findBestStringMatch(query,matches);if(query!=''){var replacement=inputText.split("(");replacement[replacement.length-1]=replacement[replacement.length-1].replace(query,bestMatch);this.input.value=this.input.value.replace(inputText,replacement.join("("));}else{this.input.value+=bestMatch;}}}
this.tabCompleteIdOrClassInCss=function(inputText){var selectors=inputText.replace(/(\.|#)/g,' $1').split(/\s+/);var lastSelector=selectors[selectors.length-1];var els=document.getElementsByTagName("*");var matches=new Array();if(lastSelector.match(/^\./)){for(var i=0;i<els.length;i++){if(els[i].className&&els[i].className!=''){var classes=els[i].className.split(/\s/);for(var ii=0;ii<classes.length;ii++){if(classes[ii].indexOf(lastSelector.substr(1))==0||lastSelector=="."){if(matches.join("***").indexOf(classes[ii])==-1){matches.push("."+classes[ii]);}}}}}}else if(lastSelector.match(/^#/)){for(var i=0;i<els.length;i++){if(els[i].id&&els[i].id.indexOf(lastSelector.substr(1))==0){matches.push("#"+els[i].id);}}}
if(matches.length==1){this.input.value+=matches[0].split(lastSelector)[1];}else if(matches.length==0){this.print("no match");}else{this.dump(matches.sort());var bestMatch=this.findBestStringMatch(lastSelector,matches);if(lastSelector!=''){this.input.value=this.input.value.replace(lastSelector,bestMatch);}else{this.input.value+=bestMatch;}}}
this.searchInputForDomGetElFunctions=function(inputText){for(var i=0;i<this.domGetElFunctions.id.length;i++){var selfct=new RegExp(this.domGetElFunctions.id[i].replace("\$","\\\$")+"\\\(['\"]\\w*$");if(inputText.match(selfct)){return{match:inputText.match(selfct),type:"id"};}}
for(var i=0;i<this.domGetElFunctions.className.length;i++){var selfct=new RegExp(this.domGetElFunctions.className[i].replace("\$","\\\$")+"\\\(['\"]\\w*$");if(inputText.match(selfct)){return{match:inputText.match(selfct),type:"class"};}}}
this.findTextMatchesInArray=function(arrayToTest,findMe){var resultsArray=new Array();var tester=new RegExp("^"+findMe);for(var i=0;i<arrayToTest.length;i++){if(tester.test(arrayToTest[i])){resultsArray.push(arrayToTest[i]);}}
if(resultsArray.length>1){resultsArray.sort();return resultsArray;}else if(resultsArray.length==1){return resultsArray[0];}else{return false;}}
this.getMembers=function(context){var members=new Array();for(memberName in eval(context)){members.push(memberName);}
return members;}
return this;}

// ELS 12/12/2007: init is deferred until first time panel is shown
window.toggleJash=function() // show/hide panel...
	{ if("jash" in window)window.jash.close();else{window.jash=new Jash();window.jash.main();} }
window.isJashVisible=function() // so scripts can find out the current display state
	{ return window.jash?window.jash.mainBlock.style.display!="none":false; }
addEvent(document,"keydown",function(ev){ // SHIFT-ESC shows/hides panel, ESC hides panel
	var e=(typeof window.event!="undefined")?window.event:ev;
	if(e.keyCode=="27"&&(e.shiftKey||window.isJashVisible())) window.toggleJash(); });
//}}}
<html><hide linebreaks><a href="javascript:;" class="button"
	title='JASH: Javascript Shell - view/modify internal run time variables and functions!'
	onclick="if (window.toggleJash) toggleJash(); return false;"
	onmouseover="this.href='javascript:void(eval(decodeURIComponent(%22(function(){try{('
		+encodeURIComponent(encodeURIComponent(this.onclick))
		+')()}catch(e){alert(e.description?e.description:e.toString())}})()%22)))';">
	$1
</a></html>
~JaSH is a Javascript Shell written by Billy Reisinger, and provides a cross-browser compatible interactive javascript development and debugging tool.

This package includes a whitespace-compressed version of the Jash source code ([[Jash.js]]), accompanied by the appropriate stylesheet definitions necessary to render the Jash interface ([[Jash.css]]).  Additionally, [[JashCommand]] provides a simple ~HTML-based command link that toggles the display of the Jash interface with a single click.
(:graph({width:100,scales:[-2,2,-1,9],coords:"none"})
dot([-1,0])
dot([0,0],{markerstroke:"red",id:"l1"})
dot([1,0],{markerfill:"red",id:"l2"})
dot([-1,1],{marker:"*"})
dot([0,1],{markerstroke:"yellow",marker:"*",id:"l3"})
dot([-1,2],{marker:"s"})
dot([0,2],{marker:"s",markerstroke:"red",id:"l4"})
dot([1,2],{marker:"s",markerfill:"red",id:"new3"})
dot([-1,3],{marker:"S"})
dot([0,3],{marker:"S",markerstroke:"yellow",id:"l5"})
dot([-1,4],{marker:"x"})
dot([0,4],{marker:"x",markerstroke:"red",id:"l9"})
dot([-1,5],{marker:"+"})
dot([0,5],{marker:"+",markerstroke:"red",id:"l10"})
dot([-1,6],{marker:">"})
dot([0,6],{marker:">",markerstroke:"red",id:"l6"})
dot([-1,7],{marker:"<"})
dot([0,7],{marker:"<",markerstroke:"red",id:"l7"})
dot([-1,8],{marker:"|"})
dot([0,8],{marker:"|",markerstroke:"red",id:"l8"})
:)
(:graph({scales:[-6,6],coords:"polar"})
dynamic.moveit = function() {
  var angle = getAngle();
  parametricPlot("dynamic.a*cos(x)","dynamic.b*sin(x)",{max:angle,id:"ell",stroke:"darkorange",strokewidth:2});
  path([[-dynamic.c,0],[dynamic.a*cos(angle),dynamic.b*sin(angle)],[dynamic.c,0]],{id:"gen",stroke:"blue",strokewidth:1,strokedasharray:"5,5"});
image('figuras/moon.png',{id:"moon",point:[dynamic.a*cos(angle),dynamic.b*sin(angle)],width:20,height:20});
}

setAction("mousemove",dynamic.moveit);
axes({ticklabels:false});
dynamic.a = 5;
dynamic.b = 3.5;
dynamic.c = sqrt(dynamic.a*dynamic.a-dynamic.b*dynamic.b);
dot([-dynamic.c,0],{id:"sol",marker:"*",size:40,markerstroke:"#FFD500",label:"Sol",pos:"S"});
dot([dynamic.c,0],{marker:"*",size:8});
:)
A mathematical markup language and a converting program from textual input to various graphical formats (like pdf). It produces beautiful mathematical texts. LaTeX is the standard way (in the scientific world) to write scientific texts (and presentations). It is also a way of expressing mathematics in text. Mathematical expressions are tagged with a dollar sign

Examples: 

$f(x) = \sum_{i=1}^N \frac{i}{N}a_i x^i$

|Nome|Fórmula molecular|Fórmula de estrutura condensada|h
|Met''ano''|$CH_4$|$CH_4$|
|Et''ano''|$C_2H_6$|$CH_3-CH_3$|
|Prop''ano''|$C_3H_8$|$CH_3-CH_2-CH_3$|
|But''ano''|$C_4H_{10}$|$CH_3-CH_2-CH_2 CH_3$|
|Pent''ano''|$C_5H_{12}$|$CH_3-CH_2-CH_2-CH_2-CH_3$|
|...|...|$\ldots$|

{{myMath{
$$f(x) = \left\{\begin{array}{l l}
x^2 \sin \frac1x, & \textrm{if } x \ne 0, \\
0, & \textrm{if } x = 0 .
\end{array}\right.$$
}}}
$$\begin{eqnarray} x & = & \frac{-7 \pm \sqrt{49 - 24}}{6} \\
& = & -2 \textrm{ or } -\frac13. \end{eqnarray}$$
$x_1+3-\frac{5}{4}$
$\DD\left(\frac{4}{3}\pir^3\right)=4\pir^2$ $$x_2$$
$x_1 e^{-x^2/2}$ $$x_2\in\R$$
Surround  ~LaTeX formulas with {{{$}}}-signs:  $\sum_{i=1}^n i=\frac{n(n+1)}{2}$
$$\int_0^{\pi/2} \sin x\,dx=1$$
(:graph({width:320,height:200,scales:[-1.1,3.1],coords:"none"})
dynamic.upX = function(){dynamic.a++;dynamic.update();}
dynamic.downX = function(){dynamic.a--;dynamic.update();}
dynamic.upY = function(){dynamic.b++;dynamic.update();}
dynamic.downY = function(){dynamic.b--;dynamic.update();}
dynamic.update = function() {
  parametricPlot("sin(dynamic.a*x)","sin(dynamic.b*x)",{id:"lsj"});
  text([2,1],"$x=\\sin("+dynamic.a+"t)$",{id:"x"});
  text([2,0.4],"$y=\\sin("+dynamic.b+"t)$",{id:"y"});
}
axes({scales:[-1.4,1.4]});
button([1.5,0.65],[1.7,0.85],"-",dynamic.downX,{fill:"grey",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"none"});
button([1.8,0.65],[2.0,0.85],"+",dynamic.upX,{fill:"grey",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"none"});
button([1.5,0.05],[1.7,0.25],"-",dynamic.downY,{fill:"grey",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"none"});
button([1.8,0.05],[2.0,0.25],"+",dynamic.upY,{fill:"grey",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"none"});
setOptions({stroke: "red"});
dynamic.a = 2;
dynamic.b = 3;
dynamic.update();
:)
Click to refresh the graph
(:graph({width:300,height:200,scales:[-2.5,22,1.05,2.8],coords:'none',borderwidth:5})
dynamic.goforit = function(){
if(typeof cstep=='undefined'){cstep=0;}
cstep++;
switch(cstep%4){
case 0:
changeScales(1,[-2.5,20,1.05,2.8]);
axes({origin:[0,1.3], dx:5, dy:0.2});
break;
case 1:
changeScales(1,[-10,60,0.4,5]);
axes({origin:[0,1.0], dx:10, dy:0.5});
plot("0.06*x+1.4");
break;
case 2:
changeScales(1,[-10,60,0.4,5]);
axes({origin:[0,1.0], dx:10, dy:0.5});
plot("0.06*x+1.4");
plot("-0.0005*x*x+0.07*x+1.4",{stroke:"green"});
break;
case 3:
changeScales(1,[-25,190,0,3.5]);
plot("2+sin(2*PI/100*(x-10))",{id:"data",min:0,max:180,stroke:"none",marker:"ooo",markerfill:"#FFD500",markerstroke:"none",points:50});
axes({origin:[0,0.5], dx:50, dy:0.5});
break;
}
return false;
}


axes({origin:[0,1.3], dx:5, dy:0.2});
plot("2+sin(2*PI/100*(x-10))",{id:"data",min:0,max:20,stroke:"none",marker:"ooo",markerfill:"#FFD500",markerstroke:"none",points:10})
if(typeof cstep=='undefined') setAction("mousedown",dynamic.goforit);
:)
#~ASCIIMath notation is not supported
#Includes a customisable image fallback when ~MathML is not supported (using mimetex by default)
#Only image fallback in Internet Explorer
#No support for any ~LateX environments unrelated to the writing of mathematical expressions
#No automatic detection of equations (automath mode)
#SVG plotting code completely rewritten with new features
#SVG in Internet Explorer is not supported
!~LaTeX
*All code under a namespace (MSVG is the only global variable)
*Updated character tables from Michael A. Ziegler suggestions
*Add a couple of characters as suggested by users in website
*Changed //define// function to accept an array of new symbols
!SVG
*All code under a namespace (ASVG is the only global variable)
*Pan and zoom
*Export SVG code
*Simplified keyboard and mouse interaction
*Optional display of polar coordinates
*Markers and endpoints unified and replaced by proper SVG markers
*Markers and enpoints are attached to the owner path
*New function to fill area between functions
*Improved picture border
*Added rotation and translation of objects
*Mouse events are handled by addEventListener which makes possible multiple handlers for any event
*All optional arguments of functions that produce SVG objects are defined in an optional object argument 
*SVG objects' id's and names of variables or functions defined in a script are unique (variables and functions must be attached to the 'dynamic' object) 
*Added a few auxilliary functions (Gamma, Beta, range, root, max, min...)
*Added polar grid
*Added parametric plot
[[MathNotebook]] [[WelcomeToTiddlyspot]] [[GettingStarted]] 
(:graph({borderwidth:2})
dynamic.left=function(){
  dynamic.pos--;
  circle([dynamic.pos,0],1,{id:'bola',stroke:"none",fill:"orange",fillopacity:0.5});
}

dynamic.right=function(){
  dynamic.pos++;
  circle([dynamic.pos,0],1,{id:'bola',stroke:"none",fill:"orange",fillopacity:0.5});
}

axes();
dynamic.pos=0;
circle([0,0],1,{id:'bola',stroke:"none",fill:"orange",fillopacity:0.5});
button([SVG.xmin,SVG.ymin],[SVG.xmin+0.8,SVG.ymin+0.6],"<",dynamic.left,{fill:"grey",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"yellow"});
button([SVG.xmin+0.9,SVG.ymin],[SVG.xmin+1.7,SVG.ymin+0.6],">",dynamic.right,{fill:"grey",fillopacity:0.5,rx:0.05,ry:0.05,stroke:"yellow"});
:)
(:graph
setOptions({type:'*', stroke:'red', size:20})
dot([0,0])
setOptions({type:'o', fill:'orange', size:10})
dot([0,1])
:)
(:graph({width:200,height:150,coords:"none",scales:[-2.5,2.5,-2.5,2.5]})
grid();
polygon([[-2,1],[-2,-1],[-0.5,-1],[-0.5,1]],{stroke:"blue",strokewidth:1,marker:"ooo",size:12,markerstroke:"orange",markerstrokewidth:0.5,markerfill:"green",fill:"fuchsia",fillopacity:0.5});
polygon([[2,1],[2,-1],[0.5,-1],[0.5,1]],{stroke:"blue",strokewidth:3,marker:"ooo",size:12,markerstroke:"orange",markerstrokewidth:0.5,markerfill:"green",fill:"fuchsia",fillopacity:0.5});
:)
This is a [[wiki]] (a web page that can be edited) that can be saved on web or locally, so that it can serve as a personal notebook. Moreover, it is possible to add mathematical expressions and plots, so it is can be used as a mathematical notebook, useful for distributing notes of scientific courses and for personal contributions. 

It is based on [[TiddlyWiki|http://www.tiddlywiki.com]] (a wiki in a page), powered by [[TiddlySpot|http://www.tiddlyspot.com]] (a TiddlyWiki repository), with the [[MathSVGPlugin]] plugin by [[Paulo Soares|http://www.math.ist.utl.pt/~psoares/MathSVG.html]].
[>img[figuras/MSVGlogo.png]] (:graph({width:100,height:120,scales:[0,3,-2,1.8],coords:"none"})
grid({dx:0.5});
text([0,0.15],"$\\Sigma$",{fontsize:80,fontfill:"grey",pos:"e"});
text([0,0.1],"$\\Sigma$",{fontsize:76,fontfill:"#afc6e9",pos:"e"});
text([0,-1.75],"MathSVG",{fontsize:19,fill:"black",fontweight:"bold",pos:"e"});
text([1.3,0.1],"$x^2+\\frac{b}{a}=0$",{fontsize:10,fontfill:"red",pos:"e"});
text([0.05,-1.2],"$(a,b]= \\{x \\in \\R$",{fontsize:12,fontfill:"red",pos:"e"});
circle([2.5,1.1],0.4,{stroke:"orange",strokewidth:2,fill:"#eee"});
text([2.5,1.1],"1.0",{fontfill:"blue",fontsize:11});
:)
/***
|''Name:''|MathSVGPlugin|
|''Description:''|This plugin translates a subset of the LaTeX math notation to MathML with a customisable  image fallback when MathML is not supported. It also provides an easy way to produce mathematical SVG graphics with dynamical features and animation.|
|''Version:''|1.2.2|
|''Date:''|2009-06-25|
|''Source:''|http://www.math.ist.utl.pt/~psoares/mathsvg.html|
|''Author:''|Paulo Soares|
|''License:''|[[GNU Lesser General Public License|http://www.gnu.org/licences/lgpl.html]]|
|''~CoreVersion:''|2.5.0|
!Original copyright notice
{{{
ASCIIMathML.js
==============
Version 2.1 Oct 8, 2008, (c) Peter Jipsen http://www.chapman.edu/~jipsen
This version extends ASCIIMathML.js with LaTeXMathML.js and ASCIIsvg.js.
Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js
If you use it on a webpage, please send the URL to jipsen@chapman.edu

The LaTeXMathML modifications were made by Douglas Woodall, June 2006.
(for details see header on the LaTeXMathML part in middle of file)
Extensive clean-up and improvements by Paulo Soares, Oct 2007.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 
(at http://www.gnu.org/licences/lgpl.html) for more details.
}}}
!~MathSVG code (minified)
***/
//{{{
Math.sec=function(a){return 1/Math.cos(a)};Math.csc=function(a){return 1/Math.sin(a)};Math.cot=function(a){return 1/Math.tan(a)};Math.asec=function(a){return Math.acos(1/a)};Math.acsc=function(a){return Math.asin(1/a)};Math.acot=function(a){return Math.atan(1/a)};Math.sinh=function(a){return(Math.exp(a)-Math.exp(-a))/2};Math.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};Math.tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};Math.sech=function(a){return 1/Math.cosh(a)};Math.csch=function(a){return 1/Math.sinh(a)};Math.coth=function(a){return 1/Math.tanh(a)};Math.asinh=function(a){return Math.log(a+Math.sqrt(a*a+1))};Math.acosh=function(a){return Math.log(a+Math.sqrt(a*a-1))};Math.atanh=function(a){return Math.log((1+a)/(1-a))/2};Math.sech=function(a){return 1/Math.cosh(a)};Math.csch=function(a){return 1/Math.sinh(a)};Math.coth=function(a){return 1/Math.tanh(a)};Math.asech=function(a){return Math.acosh(1/a)};Math.acsch=function(a){return Math.asinh(1/a)};Math.acoth=function(a){return Math.atanh(1/a)};Math.sign=function(a){return(a===0?0:(a<0?-1:1))};Math.step=function(a,c,b){return(a<0?(b?b:0):(c?c:1))};Math.root=function(a,b){return Math.pow(a,1/b)};Math.factorial=function(b){if(b===0){return 1}if(b<0){if((b%1)===0){return}if(b>-1){return Math.factorial(b+1)/(b+1)}return -Math.PI/(Math.factorial(-1-b)*Math.sin(Math.PI*b))}var a=b;if((b%1)===0){while(b>1){b=b-1;a=a*b}}else{a=Math.exp((b+0.5)*Math.log(b+1)-b-b*(0.1121105+b*0.08106103)/(1.452342+b*(2.410858+b)))}return a};Math.Gamma=function(a){return Math.factorial(a-1)};Math.Beta=function(a,b){return Math.Gamma(a)*Math.Gamma(b)/Math.Gamma(a+b)};Math.C=function(a,b){var c=1/((a+1)*Math.Beta(b+1,a-b+1));return c};Math.truncate=function(a,c){var b=c||0;return Math.floor(a*Math.pow(10,b))/Math.pow(10,b)};Math.randomString=function(a,g){var f=(g||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").split("");var e=[],c=Math.random;var d=f.length;for(var b=0;b<a;b++){e[b]=f[0|c()*d]}return e.join("")};Math.runif=function(d,c,f){var e=f||0;return Math.truncate((c+Math.pow(10,-e)-d)*Math.random()+d,e)};Math.rnormal=function(a,b){a=a||0;b=b||1;var d=0,c=0;while(d*c===0){d=Math.random();c=Math.random()}return b*(Math.sqrt(-2*Math.log(d))*Math.cos(2*Math.PI*c))+a};var MSVG=function(j){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";var q=["\uD835\uDC9C","\u212C","\uD835\uDC9E","\uD835\uDC9F","\u2130","\u2131","\uD835\uDCA2","\u210B","\u2110","\uD835\uDCA5","\uD835\uDCA6","\u2112","\u2133","\uD835\uDCA9","\uD835\uDCAA","\uD835\uDCAB","\uD835\uDCAC","\u211B","\uD835\uDCAE","\uD835\uDCAF","\uD835\uDCB0","\uD835\uDCB1","\uD835\uDCB2","\uD835\uDCB3","\uD835\uDCB4","\uD835\uDCB5","\uD835\uDCB6","\uD835\uDCB7","\uD835\uDCB8","\uD835\uDCB9","\u212F","\uD835\uDCBB","\u210A","\uD835\uDCBD","\uD835\uDCBE","\uD835\uDCBF","\uD835\uDCC0","\uD835\uDCC1","\uD835\uDCC2","\uD835\uDCC3","\u2134","\uD835\uDCC5","\uD835\uDCC6","\uD835\uDCC7","\uD835\uDCC8","\uD835\uDCC9","\uD835\uDCCA","\uD835\uDCCB","\uD835\uDCCC","\uD835\uDCCD","\uD835\uDCCE","\uD835\uDCCF"];var B=["\uD835\uDD04","\uD835\uDD05","\u212D","\uD835\uDD07","\uD835\uDD08","\uD835\uDD09","\uD835\uDD0A","\u210C","\u2111","\uD835\uDD0D","\uD835\uDD0E","\uD835\uDD0F","\uD835\uDD10","\uD835\uDD11","\uD835\uDD12","\uD835\uDD13","\uD835\uDD14","\u211C","\uD835\uDD16","\uD835\uDD17","\uD835\uDD18","\uD835\uDD19","\uD835\uDD1A","\uD835\uDD1B","\uD835\uDD1C","\u2128","\uD835\uDD1E","\uD835\uDD1F","\uD835\uDD20","\uD835\uDD21","\uD835\uDD22","\uD835\uDD23","\uD835\uDD24","\uD835\uDD25","\uD835\uDD26","\uD835\uDD27","\uD835\uDD28","\uD835\uDD29","\uD835\uDD2A","\uD835\uDD2B","\uD835\uDD2C","\uD835\uDD2D","\uD835\uDD2E","\uD835\uDD2F","\uD835\uDD30","\uD835\uDD31","\uD835\uDD32","\uD835\uDD33","\uD835\uDD34","\uD835\uDD35","\uD835\uDD36","\uD835\uDD37"];var p=["\uD835\uDD38","\uD835\uDD39","\u2102","\uD835\uDD3B","\uD835\uDD3C","\uD835\uDD3D","\uD835\uDD3E","\u210D","\uD835\uDD40","\uD835\uDD41","\uD835\uDD42","\uD835\uDD43","\uD835\uDD44","\u2115","\uD835\uDD46","\u2119","\u211A","\u211D","\uD835\uDD4A","\uD835\uDD4B","\uD835\uDD4C","\uD835\uDD4D","\uD835\uDD4E","\uD835\uDD4F","\uD835\uDD50","\u2124","\uD835\uDD52","\uD835\uDD53","\uD835\uDD54","\uD835\uDD55","\uD835\uDD56","\uD835\uDD57","\uD835\uDD58","\uD835\uDD59","\uD835\uDD5A","\uD835\uDD5B","\uD835\uDD5C","\uD835\uDD5D","\uD835\uDD5E","\uD835\uDD5F","\uD835\uDD60","\uD835\uDD61","\uD835\uDD62","\uD835\uDD63","\uD835\uDD64","\uD835\uDD65","\uD835\uDD66","\uD835\uDD67","\uD835\uDD68","\uD835\uDD69","\uD835\uDD6A","\uD835\uDD6B"];var x=0,b=1,c=2,m=3,v=4,d=5,n=6,o=7,l=8,e=9,z=10,y=11,g=13,i=14;var a=[{input:"\\varepsilon",tag:"mi",output:"\u025B",ttype:x},{input:"\\varsigma",tag:"mi",output:"\u03C2",ttype:x},{input:"\\vartheta",tag:"mi",output:"\u03D1",ttype:x},{input:"\\varphi",tag:"mi",output:"\u03D5",ttype:x},{input:"\\varpi",tag:"mi",output:"\u03D6",ttype:x},{input:"\\varrho",tag:"mi",output:"\u03F1",ttype:x},{input:"\\alpha",tag:"mi",output:"\u03B1",ttype:x},{input:"\\beta",tag:"mi",output:"\u03B2",ttype:x},{input:"\\gamma",tag:"mi",output:"\u03B3",ttype:x},{input:"\\delta",tag:"mi",output:"\u03B4",ttype:x},{input:"\\epsilon",tag:"mi",output:"\u03B5",ttype:x},{input:"\\zeta",tag:"mi",output:"\u03B6",ttype:x},{input:"\\eta",tag:"mi",output:"\u03B7",ttype:x},{input:"\\theta",tag:"mi",output:"\u03B8",ttype:x},{input:"\\iota",tag:"mi",output:"\u03B9",ttype:x},{input:"\\kappa",tag:"mi",output:"\u03BA",ttype:x},{input:"\\lambda",tag:"mi",output:"\u03BB",ttype:x},{input:"\\mu",tag:"mi",output:"\u03BC",ttype:x},{input:"\\nu",tag:"mi",output:"\u03BD",ttype:x},{input:"\\xi",tag:"mi",output:"\u03BE",ttype:x},{input:"\\omicron",tag:"mi",output:"\u03BF",ttype:x},{input:"\\pi",tag:"mi",output:"\u03C0",ttype:x},{input:"\\rho",tag:"mi",output:"\u03C1",ttype:x},{input:"\\sigma",tag:"mi",output:"\u03C3",ttype:x},{input:"\\tau",tag:"mi",output:"\u03C4",ttype:x},{input:"\\upsilon",tag:"mi",output:"\u03C5",ttype:x},{input:"\\phi",tag:"mi",output:"\u03C6",ttype:x},{input:"\\chi",tag:"mi",output:"\u03C7",ttype:x},{input:"\\psi",tag:"mi",output:"\u03C8",ttype:x},{input:"\\omega",tag:"mi",output:"\u03C9",ttype:x},{input:"\\Alpha",tag:"mo",output:"\u0391",ttype:x},{input:"\\Beta",tag:"mo",output:"\u0392",ttype:x},{input:"\\Gamma",tag:"mo",output:"\u0393",ttype:x},{input:"\\Delta",tag:"mo",output:"\u0394",ttype:x},{input:"\\Epsilon",tag:"mo",output:"\u0395",ttype:x},{input:"\\Zeta",tag:"mo",output:"\u0396",ttype:x},{input:"\\Eta",tag:"mo",output:"\u0397",ttype:x},{input:"\\Theta",tag:"mo",output:"\u0398",ttype:x},{input:"\\Iota",tag:"mo",output:"\u0399",ttype:x},{input:"\\Kappa",tag:"mo",output:"\u039A",ttype:x},{input:"\\Lambda",tag:"mo",output:"\u039B",ttype:x},{input:"\\Mu",tag:"mo",output:"\u039C",ttype:x},{input:"\\Nu",tag:"mo",output:"\u039D",ttype:x},{input:"\\Xi",tag:"mo",output:"\u039E",ttype:x},{input:"\\Omicron",tag:"mo",output:"\u039F",ttype:x},{input:"\\Pi",tag:"mo",output:"\u03A0",ttype:x},{input:"\\Rho",tag:"mo",output:"\u03A1",ttype:x},{input:"\\Sigma",tag:"mo",output:"\u03A3",ttype:x},{input:"\\Tau",tag:"mo",output:"\u03A4",ttype:x},{input:"\\Upsilon",tag:"mo",output:"\u03A5",ttype:x},{input:"\\Phi",tag:"mo",output:"\u03A6",ttype:x},{input:"\\Chi",tag:"mo",output:"\u03A7",ttype:x},{input:"\\Psi",tag:"mo",output:"\u03A8",ttype:x},{input:"\\Omega",tag:"mo",output:"\u03A9",ttype:x},{input:"\\frac12",tag:"mo",output:"\u00BD",ttype:x},{input:"\\frac14",tag:"mo",output:"\u00BC",ttype:x},{input:"\\frac34",tag:"mo",output:"\u00BE",ttype:x},{input:"\\frac13",tag:"mo",output:"\u2153",ttype:x},{input:"\\frac23",tag:"mo",output:"\u2154",ttype:x},{input:"\\frac15",tag:"mo",output:"\u2155",ttype:x},{input:"\\frac25",tag:"mo",output:"\u2156",ttype:x},{input:"\\frac35",tag:"mo",output:"\u2157",ttype:x},{input:"\\frac45",tag:"mo",output:"\u2158",ttype:x},{input:"\\frac16",tag:"mo",output:"\u2159",ttype:x},{input:"\\frac56",tag:"mo",output:"\u215A",ttype:x},{input:"\\frac18",tag:"mo",output:"\u215B",ttype:x},{input:"\\frac38",tag:"mo",output:"\u215C",ttype:x},{input:"\\frac58",tag:"mo",output:"\u215D",ttype:x},{input:"\\frac78",tag:"mo",output:"\u215E",ttype:x},{input:"\\pm",tag:"mo",output:"\u00B1",ttype:x},{input:"\\mp",tag:"mo",output:"\u2213",ttype:x},{input:"\\triangleleft",tag:"mo",output:"\u22B2",ttype:x},{input:"\\triangleright",tag:"mo",output:"\u22B3",ttype:x},{input:"\\cdot",tag:"mo",output:"\u22C5",ttype:x},{input:"\\star",tag:"mo",output:"\u22C6",ttype:x},{input:"\\ast",tag:"mo",output:"\u002A",ttype:x},{input:"\\times",tag:"mo",output:"\u00D7",ttype:x},{input:"\\div",tag:"mo",output:"\u00F7",ttype:x},{input:"\\circ",tag:"mo",output:"\u2218",ttype:x},{input:"\\bullet",tag:"mo",output:"\u2022",ttype:x},{input:"\\oplus",tag:"mo",output:"\u2295",ttype:x},{input:"\\ominus",tag:"mo",output:"\u2296",ttype:x},{input:"\\otimes",tag:"mo",output:"\u2297",ttype:x},{input:"\\bigcirc",tag:"mo",output:"\u25CB",ttype:x},{input:"\\oslash",tag:"mo",output:"\u2298",ttype:x},{input:"\\odot",tag:"mo",output:"\u2299",ttype:x},{input:"\\land",tag:"mo",output:"\u2227",ttype:x},{input:"\\wedge",tag:"mo",output:"\u2227",ttype:x},{input:"\\lor",tag:"mo",output:"\u2228",ttype:x},{input:"\\vee",tag:"mo",output:"\u2228",ttype:x},{input:"\\cap",tag:"mo",output:"\u2229",ttype:x},{input:"\\cup",tag:"mo",output:"\u222A",ttype:x},{input:"\\sqcap",tag:"mo",output:"\u2293",ttype:x},{input:"\\sqcup",tag:"mo",output:"\u2294",ttype:x},{input:"\\uplus",tag:"mo",output:"\u228E",ttype:x},{input:"\\amalg",tag:"mo",output:"\u2210",ttype:x},{input:"\\bigtriangleup",tag:"mo",output:"\u25B3",ttype:x},{input:"\\bigtriangledown",tag:"mo",output:"\u25BD",ttype:x},{input:"\\dag",tag:"mo",output:"\u2020",ttype:x},{input:"\\dagger",tag:"mo",output:"\u2020",ttype:x},{input:"\\ddag",tag:"mo",output:"\u2021",ttype:x},{input:"\\ddagger",tag:"mo",output:"\u2021",ttype:x},{input:"\\lhd",tag:"mo",output:"\u22B2",ttype:x},{input:"\\rhd",tag:"mo",output:"\u22B3",ttype:x},{input:"\\unlhd",tag:"mo",output:"\u22B4",ttype:x},{input:"\\unrhd",tag:"mo",output:"\u22B5",ttype:x},{input:"\\sum",tag:"mo",output:"\u2211",ttype:o},{input:"\\prod",tag:"mo",output:"\u220F",ttype:o},{input:"\\bigcap",tag:"mo",output:"\u22C2",ttype:o},{input:"\\bigcup",tag:"mo",output:"\u22C3",ttype:o},{input:"\\bigwedge",tag:"mo",output:"\u22C0",ttype:o},{input:"\\bigvee",tag:"mo",output:"\u22C1",ttype:o},{input:"\\bigsqcap",tag:"mo",output:"\u2A05",ttype:o},{input:"\\bigsqcup",tag:"mo",output:"\u2A06",ttype:o},{input:"\\coprod",tag:"mo",output:"\u2210",ttype:o},{input:"\\bigoplus",tag:"mo",output:"\u2A01",ttype:o},{input:"\\bigotimes",tag:"mo",output:"\u2A02",ttype:o},{input:"\\bigodot",tag:"mo",output:"\u2A00",ttype:o},{input:"\\biguplus",tag:"mo",output:"\u2A04",ttype:o},{input:"\\int",tag:"mo",output:"\u222B",ttype:x},{input:"\\oint",tag:"mo",output:"\u222E",ttype:x},{input:":=",tag:"mo",output:":=",ttype:x},{input:"\\lt",tag:"mo",output:"<",ttype:x},{input:"\\gt",tag:"mo",output:">",ttype:x},{input:"\\ne",tag:"mo",output:"\u2260",ttype:x},{input:"\\neq",tag:"mo",output:"\u2260",ttype:x},{input:"\\le",tag:"mo",output:"\u2264",ttype:x},{input:"\\leq",tag:"mo",output:"\u2264",ttype:x},{input:"\\leqslant",tag:"mo",output:"\u2264",ttype:x},{input:"\\ge",tag:"mo",output:"\u2265",ttype:x},{input:"\\geq",tag:"mo",output:"\u2265",ttype:x},{input:"\\geqslant",tag:"mo",output:"\u2265",ttype:x},{input:"\\equiv",tag:"mo",output:"\u2261",ttype:x},{input:"\\ll",tag:"mo",output:"\u226A",ttype:x},{input:"\\gg",tag:"mo",output:"\u226B",ttype:x},{input:"\\doteq",tag:"mo",output:"\u2250",ttype:x},{input:"\\prec",tag:"mo",output:"\u227A",ttype:x},{input:"\\succ",tag:"mo",output:"\u227B",ttype:x},{input:"\\preceq",tag:"mo",output:"\u227C",ttype:x},{input:"\\succeq",tag:"mo",output:"\u227D",ttype:x},{input:"\\subset",tag:"mo",output:"\u2282",ttype:x},{input:"\\supset",tag:"mo",output:"\u2283",ttype:x},{input:"\\subseteq",tag:"mo",output:"\u2286",ttype:x},{input:"\\supseteq",tag:"mo",output:"\u2287",ttype:x},{input:"\\sqsubset",tag:"mo",output:"\u228F",ttype:x},{input:"\\sqsupset",tag:"mo",output:"\u2290",ttype:x},{input:"\\sqsubseteq",tag:"mo",output:"\u2291",ttype:x},{input:"\\sqsupseteq",tag:"mo",output:"\u2292",ttype:x},{input:"\\sim",tag:"mo",output:"\u223C",ttype:x},{input:"\\simeq",tag:"mo",output:"\u2243",ttype:x},{input:"\\approx",tag:"mo",output:"\u2248",ttype:x},{input:"\\cong",tag:"mo",output:"\u2245",ttype:x},{input:"\\Join",tag:"mo",output:"\u22C8",ttype:x},{input:"\\bowtie",tag:"mo",output:"\u22C8",ttype:x},{input:"\\in",tag:"mo",output:"\u2208",ttype:x},{input:"\\ni",tag:"mo",output:"\u220B",ttype:x},{input:"\\owns",tag:"mo",output:"\u220B",ttype:x},{input:"\\propto",tag:"mo",output:"\u221D",ttype:x},{input:"\\vdash",tag:"mo",output:"\u22A2",ttype:x},{input:"\\dashv",tag:"mo",output:"\u22A3",ttype:x},{input:"\\models",tag:"mo",output:"\u22A8",ttype:x},{input:"\\perp",tag:"mo",output:"\u22A5",ttype:x},{input:"\\smile",tag:"mo",output:"\u2323",ttype:x},{input:"\\frown",tag:"mo",output:"\u2322",ttype:x},{input:"\\asymp",tag:"mo",output:"\u224D",ttype:x},{input:"\\notin",tag:"mo",output:"\u2209",ttype:x},{input:"\\begin{eqnarray}",output:"X",ttype:i,invisible:true},{input:"\\begin{array}",output:"X",ttype:i,invisible:true},{input:"\\\\",output:"}&{",ttype:l},{input:"\\end{eqnarray}",output:"}}",ttype:l},{input:"\\end{array}",output:"}}",ttype:l},{input:"\\big",tag:"mo",output:"X",atval:"1.2",ttype:y},{input:"\\Big",tag:"mo",output:"X",atval:"1.8",ttype:y},{input:"\\bigg",tag:"mo",output:"X",atval:"2.3",ttype:y},{input:"\\Bigg",tag:"mo",output:"X",atval:"2.9",ttype:y},{input:"\\left",tag:"mo",output:"X",ttype:v},{input:"\\right",tag:"mo",output:"X",ttype:d},{input:"{",output:"{",ttype:v,invisible:true},{input:"}",output:"}",ttype:d,invisible:true},{input:"(",tag:"mo",output:"(",atval:"1",ttype:g},{input:"[",tag:"mo",output:"[",atval:"1",ttype:g},{input:"\\lbrack",tag:"mo",output:"[",atval:"1",ttype:g},{input:"\\{",tag:"mo",output:"{",atval:"1",ttype:g},{input:"\\lbrace",tag:"mo",output:"{",atval:"1",ttype:g},{input:"\\langle",tag:"mo",output:"\u2329",atval:"1",ttype:g},{input:"\\lfloor",tag:"mo",output:"\u230A",atval:"1",ttype:g},{input:"\\lceil",tag:"mo",output:"\u2308",atval:"1",ttype:g},{input:")",tag:"mo",output:")",rtag:"mi",atval:"1",ttype:g},{input:"]",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:g},{input:"\\rbrack",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:g},{input:"\\}",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:g},{input:"\\rbrace",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:g},{input:"\\rangle",tag:"mo",output:"\u232A",rtag:"mi",atval:"1",ttype:g},{input:"\\rfloor",tag:"mo",output:"\u230B",rtag:"mi",atval:"1",ttype:g},{input:"\\rceil",tag:"mo",output:"\u2309",rtag:"mi",atval:"1",ttype:g},{input:"|",tag:"mo",output:"\u2223",atval:"1",ttype:g},{input:"\\|",tag:"mo",output:"\u2225",atval:"1",ttype:g},{input:"\\vert",tag:"mo",output:"\u2223",atval:"1",ttype:g},{input:"\\Vert",tag:"mo",output:"\u2225",atval:"1",ttype:g},{input:"\\mid",tag:"mo",output:"\u2223",atval:"1",ttype:g},{input:"\\parallel",tag:"mo",output:"\u2225",atval:"1",ttype:g},{input:"/",tag:"mo",output:"/",atval:"1.01",ttype:g},{input:"\\backslash",tag:"mo",output:"\u2216",atval:"1",ttype:g},{input:"\\setminus",tag:"mo",output:"\\",ttype:x},{input:"\\!",tag:"mspace",atname:"width",atval:"-0.167em",ttype:n},{input:"\\,",tag:"mspace",atname:"width",atval:"0.167em",ttype:n},{input:"\\>",tag:"mspace",atname:"width",atval:"0.222em",ttype:n},{input:"\\:",tag:"mspace",atname:"width",atval:"0.222em",ttype:n},{input:"\\;",tag:"mspace",atname:"width",atval:"0.278em",ttype:n},{input:"~",tag:"mspace",atname:"width",atval:"0.333em",ttype:n},{input:"\\quad",tag:"mspace",atname:"width",atval:"1em",ttype:n},{input:"\\qquad",tag:"mspace",atname:"width",atval:"2em",ttype:n},{input:"\\prime",tag:"mo",output:"\u2032",ttype:x},{input:"'",tag:"mo",output:"\u02B9",ttype:x},{input:"''",tag:"mo",output:"\u02BA",ttype:x},{input:"'''",tag:"mo",output:"\u2034",ttype:x},{input:"''''",tag:"mo",output:"\u2057",ttype:x},{input:"\\ldots",tag:"mo",output:"\u2026",ttype:x},{input:"\\cdots",tag:"mo",output:"\u22EF",ttype:x},{input:"\\vdots",tag:"mo",output:"\u22EE",ttype:x},{input:"\\ddots",tag:"mo",output:"\u22F1",ttype:x},{input:"\\forall",tag:"mo",output:"\u2200",ttype:x},{input:"\\exists",tag:"mo",output:"\u2203",ttype:x},{input:"\\Re",tag:"mo",output:"\u211C",ttype:x},{input:"\\Im",tag:"mo",output:"\u2111",ttype:x},{input:"\\aleph",tag:"mo",output:"\u2135",ttype:x},{input:"\\hbar",tag:"mo",output:"\u210F",ttype:x},{input:"\\ell",tag:"mo",output:"\u2113",ttype:x},{input:"\\wp",tag:"mo",output:"\u2118",ttype:x},{input:"\\emptyset",tag:"mo",output:"\u2205",ttype:x},{input:"\\infty",tag:"mo",output:"\u221E",ttype:x},{input:"\\surd",tag:"mo",output:"\\sqrt{}",ttype:l},{input:"\\partial",tag:"mo",output:"\u2202",ttype:x},{input:"\\nabla",tag:"mo",output:"\u2207",ttype:x},{input:"\\triangle",tag:"mo",output:"\u25B3",ttype:x},{input:"\\therefore",tag:"mo",output:"\u2234",ttype:x},{input:"\\angle",tag:"mo",output:"\u2220",ttype:x},{input:"\\diamond",tag:"mo",output:"\u22C4",ttype:x},{input:"\\Diamond",tag:"mo",output:"\u25C7",ttype:x},{input:"\\neg",tag:"mo",output:"\u00AC",ttype:x},{input:"\\lnot",tag:"mo",output:"\u00AC",ttype:x},{input:"\\bot",tag:"mo",output:"\u22A5",ttype:x},{input:"\\top",tag:"mo",output:"\u22A4",ttype:x},{input:"\\square",tag:"mo",output:"\u25AB",ttype:x},{input:"\\Box",tag:"mo",output:"\u25A1",ttype:x},{input:"\\wr",tag:"mo",output:"\u2240",ttype:x},{input:"\\arccos",tag:"mi",output:"arccos",ttype:b,func:true},{input:"\\arcsin",tag:"mi",output:"arcsin",ttype:b,func:true},{input:"\\arctan",tag:"mi",output:"arctan",ttype:b,func:true},{input:"\\arg",tag:"mi",output:"arg",ttype:b,func:true},{input:"\\cos",tag:"mi",output:"cos",ttype:b,func:true},{input:"\\cosh",tag:"mi",output:"cosh",ttype:b,func:true},{input:"\\cot",tag:"mi",output:"cot",ttype:b,func:true},{input:"\\coth",tag:"mi",output:"coth",ttype:b,func:true},{input:"\\csc",tag:"mi",output:"csc",ttype:b,func:true},{input:"\\deg",tag:"mi",output:"deg",ttype:b,func:true},{input:"\\det",tag:"mi",output:"det",ttype:b,func:true},{input:"\\dim",tag:"mi",output:"dim",ttype:b,func:true},{input:"\\exp",tag:"mi",output:"exp",ttype:b,func:true},{input:"\\gcd",tag:"mi",output:"gcd",ttype:b,func:true},{input:"\\hom",tag:"mi",output:"hom",ttype:b,func:true},{input:"\\inf",tag:"mo",output:"inf",ttype:o},{input:"\\ker",tag:"mi",output:"ker",ttype:b,func:true},{input:"\\lg",tag:"mi",output:"lg",ttype:b,func:true},{input:"\\lim",tag:"mo",output:"lim",ttype:o},{input:"\\liminf",tag:"mo",output:"liminf",ttype:o},{input:"\\limsup",tag:"mo",output:"limsup",ttype:o},{input:"\\ln",tag:"mi",output:"ln",ttype:b,func:true},{input:"\\log",tag:"mi",output:"log",ttype:b,func:true},{input:"\\max",tag:"mo",output:"max",ttype:o},{input:"\\min",tag:"mo",output:"min",ttype:o},{input:"\\Pr",tag:"mi",output:"Pr",ttype:b,func:true},{input:"\\sec",tag:"mi",output:"sec",ttype:b,func:true},{input:"\\sin",tag:"mi",output:"sin",ttype:b,func:true},{input:"\\sinh",tag:"mi",output:"sinh",ttype:b,func:true},{input:"\\sup",tag:"mo",output:"sup",ttype:o},{input:"\\tan",tag:"mi",output:"tan",ttype:b,func:true},{input:"\\tanh",tag:"mi",output:"tanh",ttype:b,func:true},{input:"\\gets",tag:"mo",output:"\u2190",ttype:x},{input:"\\leftarrow",tag:"mo",output:"\u2190",ttype:x},{input:"\\to",tag:"mo",output:"\u2192",ttype:x},{input:"\\rightarrow",tag:"mo",output:"\u2192",ttype:x},{input:"\\leftrightarrow",tag:"mo",output:"\u2194",ttype:x},{input:"\\uparrow",tag:"mo",output:"\u2191",ttype:x},{input:"\\downarrow",tag:"mo",output:"\u2193",ttype:x},{input:"\\updownarrow",tag:"mo",output:"\u2195",ttype:x},{input:"\\Leftarrow",tag:"mo",output:"\u21D0",ttype:x},{input:"\\Rightarrow",tag:"mo",output:"\u21D2",ttype:x},{input:"\\Leftrightarrow",tag:"mo",output:"\u21D4",ttype:x},{input:"\\iff",tag:"mo",output:"~\\Longleftrightarrow~",ttype:l},{input:"\\Uparrow",tag:"mo",output:"\u21D1",ttype:x},{input:"\\Downarrow",tag:"mo",output:"\u21D3",ttype:x},{input:"\\Updownarrow",tag:"mo",output:"\u21D5",ttype:x},{input:"\\mapsto",tag:"mo",output:"\u21A6",ttype:x},{input:"\\longleftarrow",tag:"mo",output:"\u27F5",ttype:x},{input:"\\longrightarrow",tag:"mo",output:"\u27F6",ttype:x},{input:"\\longleftrightarrow",tag:"mo",output:"\u27F7",ttype:x},{input:"\\Longleftarrow",tag:"mo",output:"\u27F8",ttype:x},{input:"\\Longrightarrow",tag:"mo",output:"\u27F9",ttype:x},{input:"\\Longleftrightarrow",tag:"mo",output:"\u27FA",ttype:x},{input:"\\longmapsto",tag:"mo",output:"\u27FC",ttype:x},{input:"\\sqrt",tag:"msqrt",output:"sqrt",ttype:b},{input:"\\root",tag:"mroot",output:"root",ttype:c},{input:"\\frac",tag:"mfrac",output:"/",ttype:c},{input:"\\stackrel",tag:"mover",output:"stackrel",ttype:c},{input:"\\atop",tag:"mfrac",output:"",ttype:m},{input:"\\choose",tag:"mfrac",output:"",ttype:m},{input:"_",tag:"msub",output:"_",ttype:m},{input:"^",tag:"msup",output:"^",ttype:m},{input:"\\mbox",tag:"mtext",output:"mbox",ttype:z},{input:"\\acute",tag:"mover",output:"\u00B4",ttype:b,acc:true},{input:"\\grave",tag:"mover",output:"\u0060",ttype:b,acc:true},{input:"\\breve",tag:"mover",output:"\u02D8",ttype:b,acc:true},{input:"\\check",tag:"mover",output:"\u02C7",ttype:b,acc:true},{input:"\\dot",tag:"mover",output:".",ttype:b,acc:true},{input:"\\ddot",tag:"mover",output:"..",ttype:b,acc:true},{input:"\\mathring",tag:"mover",output:"\u00B0",ttype:b,acc:true},{input:"\\vec",tag:"mover",output:"\u20D7",ttype:b,acc:true},{input:"\\overrightarrow",tag:"mover",output:"\u20D7",ttype:b,acc:true},{input:"\\overleftarrow",tag:"mover",output:"\u20D6",ttype:b,acc:true},{input:"\\hat",tag:"mover",output:"\u005E",ttype:b,acc:true},{input:"\\widehat",tag:"mover",output:"\u0302",ttype:b,acc:true},{input:"\\tilde",tag:"mover",output:"~",ttype:b,acc:true},{input:"\\widetilde",tag:"mover",output:"\u02DC",ttype:b,acc:true},{input:"\\bar",tag:"mover",output:"\u203E",ttype:b,acc:true},{input:"\\overbrace",tag:"mover",output:"\u23B4",ttype:b,acc:true},{input:"\\overline",tag:"mover",output:"\u00AF",ttype:b,acc:true},{input:"\\underbrace",tag:"munder",output:"\u23B5",ttype:b,acc:true},{input:"\\underline",tag:"munder",output:"\u00AF",ttype:b,acc:true},{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true",ttype:b},{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false",ttype:b},{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1",ttype:b},{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2",ttype:b},{input:"\\mathrm",tag:"mtext",output:"text",ttype:z},{input:"\\textrm",tag:"mtext",output:"text",ttype:z},{input:"\\mathbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:b,codes:s},{input:"\\textbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:b,codes:s},{input:"\\mathit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:b},{input:"\\textit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:b},{input:"\\mathtt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:b,codes:s},{input:"\\texttt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:b,codes:s},{input:"\\mathsf",tag:"mstyle",atname:"mathvariant",atval:"sans-serif",ttype:b,codes:s},{input:"\\mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",ttype:b,codes:p},{input:"\\mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",ttype:b,codes:q},{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",ttype:b,codes:B}];var r=[];function k(){return(j.browser.mozilla||j.browser.opera)}function E(F,G){if(F.input>G.input){return 1}else{return -1}}function u(){var F=a.length;a.sort(E);for(var G=0;G<F;G++){r[G]=a[G].input}}function w(F,G){return j.trim(F.slice(G))}function C(G,I){var H=r.indexOf(G,I);if(H<0){var F=r.concat([G]);F.sort();H=F.indexOf(G,I)}return H}function t(M){var F=0;var G=0;var I;var O;var N;var J="";var L=true;var K=M.length;for(var H=1;H<=K&&L;H++){O=M.slice(0,H);G=F;F=C(O,G);if(F<r.length&&M.slice(0,r[F].length)==r[F]){J=r[F];I=F;H=J.length}L=F<r.length&&M.slice(0,r[F].length)>=r[F]}if(J!==""){return a[I]}F=1;O=M.slice(0,1);if("0"<=O&&O<="9"){N="mn"}else{N=(("A">O||O>"Z")&&("a">O||O>"z")?"mo":"mi")}return{input:O,tag:N,output:O,ttype:x}}function f(N){var I,G,S,H,K,Q,M=document.createDocumentFragment();N=j.trim(N);I=t(N);if(I===null||I.ttype==d){return[null,N,null]}if(I.ttype==l){N=I.output+w(N,I.input.length);I=t(N);if(I===null||I.ttype==d){return[null,N,null]}}N=w(N,I.input.length);switch(I.ttype){case n:G=A(I.tag);G.setAttribute(I.atname,I.atval);return[G,N,I.tag];case o:return[A(I.tag,document.createTextNode(I.output)),N,I.tag];case x:G=A(I.tag,document.createTextNode(I.output));return[G,N,I.tag];case g:G=A(I.tag,document.createTextNode(I.output));if(I.input=="|"||I.input=="\\vert"||I.input=="\\|"||I.input=="\\Vert"){G.setAttribute("lspace","0em");G.setAttribute("rspace","0em")}G.setAttribute("maxsize",I.atval);if(I.rtag!==null){return[G,N,I.rtag]}else{return[G,N,I.tag]}case y:var L=I.atval;I=t(N);if(I===null){return[null,N,null]}N=w(N,I.input.length);G=A(I.tag,document.createTextNode(I.output));G.setAttribute("minsize",L);G.setAttribute("maxsize",L);return[G,N,I.tag];case v:if(I.input=="\\left"){I=t(N);if(I!==null){if(I.input=="."){I.invisible=true}N=w(N,I.input.length)}}S=h(N,true,false);if(I===null||(typeof I.invisible=="boolean"&&I.invisible)){G=A("mrow",S[0])}else{G=A("mo",document.createTextNode(I.output));G=A("mrow",G);G.appendChild(S[0])}return[G,S[1],S[2]];case i:if(I.input=="\\begin{array}"){var R="";I=t(N);N=j.trim(N);if(I===null){R="l"}else{N=w(N,I.input.length);if(I.input!="{"){R="l"}else{do{I=t(N);if(I!==null){N=w(N,I.input.length);if(I.input!="}"){R=R+I.input}}}while(I!==null&&I.input!==""&&I.input!="}")}}S=h("{"+N,true,true);G=A("mtable",S[0]);R=R.replace(/l/g,"left ");R=R.replace(/r/g,"right ");R=R.replace(/c/g,"center ");G.setAttribute("columnalign",R);G.setAttribute("displaystyle","false");return[G,S[1],null]}else{S=h("{"+N,true,true);G=A("mtable",S[0]);G.setAttribute("columnspacing","0.167em");G.setAttribute("columnalign","right center left");G.setAttribute("displaystyle","true");G=A("mrow",G);return[G,S[1],null]}case z:if(N.charAt(0)=="{"){K=N.indexOf("}")}else{K=0}if(K==-1){K=N.length}Q=N.slice(1,K);M.appendChild(A(I.tag,document.createTextNode(Q)));N=w(N,K+1);return[A("mrow",M),N,null];case b:S=f(N);if(S[0]===null){return[A(I.tag,document.createTextNode(I.output)),N]}if(typeof I.func=="boolean"&&I.func){Q=N.charAt(0);if(Q=="^"||Q=="_"||Q==","){return[A(I.tag,document.createTextNode(I.output)),N,I.tag]}else{G=A("mrow",A(I.tag,document.createTextNode(I.output)));G.appendChild(S[0]);return[G,S[1],I.tag]}}if(I.input=="\\sqrt"){return[A(I.tag,S[0]),S[1],I.tag]}else{if(typeof I.acc=="boolean"&&I.acc){G=A(I.tag,S[0]);var F=I.output;var P=A("mo",document.createTextNode(F));if(I.input=="\\vec"||I.input=="\\check"){P.setAttribute("maxsize","1.2")}if(I.input=="\\underbrace"||I.input=="\\underline"){P.setAttribute("accentunder","true")}else{P.setAttribute("accent","true")}G.appendChild(P);if(I.input=="\\overbrace"||I.input=="\\underbrace"){G.ttype=o}return[G,S[1],I.tag]}else{if(typeof I.codes!="undefined"){for(K=0;K<S[0].childNodes.length;K++){if(S[0].childNodes[K].nodeName=="mi"||S[0].nodeName=="mi"){Q=(S[0].nodeName=="mi"?S[0].firstChild.nodeValue:S[0].childNodes[K].firstChild.nodeValue);var O=[];for(var J=0;J<Q.length;J++){if(Q.charCodeAt(J)>64&&Q.charCodeAt(J)<91){O=O+I.codes[Q.charCodeAt(J)-65]}else{if(Q.charCodeAt(J)>96&&Q.charCodeAt(J)<123){O=O+I.codes[Q.charCodeAt(J)-71]}}}if(S[0].nodeName=="mi"){S[0]=A("mo").appendChild(document.createTextNode(O))}else{S[0].replaceChild(A("mo").appendChild(document.createTextNode(O)),S[0].childNodes[K])}}}}G=A(I.tag,S[0]);G.setAttribute(I.atname,I.atval);if(I.input=="\\scriptstyle"||I.input=="\\scriptscriptstyle"){G.setAttribute("displaystyle","false")}return[G,S[1],I.tag]}}case c:S=f(N);if(S[0]===null){return[A("mo",document.createTextNode(I.input)),N,null]}H=f(S[1]);if(H[0]===null){return[A("mo",document.createTextNode(I.input)),N,null]}if(I.input=="\\root"||I.input=="\\stackrel"){M.appendChild(H[0])}M.appendChild(S[0]);if(I.input=="\\frac"){M.appendChild(H[0])}return[A(I.tag,M),H[1],I.tag];case m:N=w(N,I.input.length);return[A("mo",document.createTextNode(I.output)),N,I.tag];default:return[A(I.tag,document.createTextNode(I.output)),N,I.tag]}}function D(K){var J,H,G,I,M,N,L;H=t(K);M=f(K);I=M[0];K=M[1];N=M[2];J=t(K);if(J.ttype==m){K=w(K,J.input.length);M=f(K);if(M[0]===null){M[0]=A("mo",document.createTextNode("\u25A1"))}K=M[1];N=M[2];if(J.input=="_"||J.input=="^"){G=t(K);N=null;L=((H.ttype==o)||(I.ttype==o));if(J.input=="_"&&G.input=="^"){K=w(K,G.input.length);var F=f(K);K=F[1];N=F[2];I=A((L?"munderover":"msubsup"),I);I.appendChild(M[0]);I.appendChild(F[0])}else{if(J.input=="_"){I=A((L?"munder":"msub"),I);I.appendChild(M[0])}else{I=A((L?"mover":"msup"),I);I.appendChild(M[0])}}I=A("mrow",I)}else{I=A(J.tag,I);if(J.input=="\\atop"||J.input=="\\choose"){I.setAttribute("linethickness","0ex")}I.appendChild(M[0]);if(J.input=="\\choose"){I=A("mfenced",I)}}}return[I,K,N]}function h(M,L,R){var Q,N,I,T,X,J=document.createDocumentFragment();do{M=j.trim(M);I=D(M);N=I[0];M=I[1];X=I[2];Q=t(M);if(N!=undefined){if((X=="mn"||X=="mi")&&Q!==null&&typeof Q.func=="boolean"&&Q.func){var W=A("mspace");W.setAttribute("width","0.167em");N=A("mrow",N);N.appendChild(W)}J.appendChild(N)}}while((Q.ttype!=d)&&Q!==null&&Q.output!="");X=null;if(Q.ttype==d){if(Q.input=="\\right"){M=w(M,Q.input.length);Q=t(M);if(Q!==null&&Q.input=="."){Q.invisible=true}if(Q!==null){X=Q.rtag}}if(Q!==null){M=w(M,Q.input.length)}var U=J.childNodes.length;if(R&&U>0&&J.childNodes[U-1].nodeName=="mrow"&&U>1&&J.childNodes[U-2].nodeName=="mo"&&J.childNodes[U-2].firstChild.nodeValue=="&"){var G=[];var O=J.childNodes.length;for(T=0;R&&T<O;T=T+2){G[T]=[];N=J.childNodes[T];for(var S=0;S<N.childNodes.length;S++){if(N.childNodes[S].firstChild.nodeValue=="&"){G[T][G[T].length]=S}}}var H,F,K,P,V=document.createDocumentFragment();for(T=0;T<O;T=T+2){H=document.createDocumentFragment();F=document.createDocumentFragment();N=J.firstChild;K=N.childNodes.length;P=0;for(S=0;S<K;S++){if(typeof G[T][P]!="undefined"&&S==G[T][P]){N.removeChild(N.firstChild);H.appendChild(A("mtd",F));P++}else{F.appendChild(N.firstChild)}}H.appendChild(A("mtd",F));if(J.childNodes.length>2){J.removeChild(J.firstChild);J.removeChild(J.firstChild)}V.appendChild(A("mtr",H))}return[V,M]}if(typeof Q.invisible!="boolean"||!Q.invisible){N=A("mo",document.createTextNode(Q.output));J.appendChild(N)}}return[J,M,X]}if(!document.createElementNS){document.createElementNS=function(G,F){return this.createElement(F)}}function A(F,H){var G=document.createElementNS("http://www.w3.org/1998/Math/MathML",F);if(H){j(G).append(H)}return G}return{showFormulaOnMouseOver:false,latexImages:false,latexConverter:"http://www.forkosh.dreamhost.com/mimetex.cgi?",mathColor:"black",mathFontSize:"",mathFontFamily:"",createElementXHTML:function(F,G,I){var H=document.createElementNS("http://www.w3.org/1999/xhtml",F);if(G){H.id=G}if(I){H.className=I}return H},define:function(H,I){if(MSVG.latexImages){return}if((typeof H)=="string"){H=[H];I=[I]}var G,F=H.length;if(F!=I.length){return}for(G=0;G<F;G++){a=a.concat([{input:"\\"+H[G],tag:"mo",output:I[G],ttype:l}])}u()},parseMath:function(J,I,G,F){if(J===null){return null}var K=h(J.replace(/^\s+/g,""),false,false)[0];var H=A("mstyle",K);if(I){j(H).attr({displaystyle:"true"})}j(H).attr({mathcolor:F||MSVG.mathColor,fontsize:G||MSVG.mathFontSize,fontfamily:MSVG.mathFontFamily});H=A("math",H);if(MSVG.showFormulaOnMouseOver){j(H).attr({title:J.replace(/\s+/g," ")})}return H},parseMathExternal:function(K,J,G,F){if(K===null){return null}var I=MSVG.createElementXHTML("img");var H=MSVG.latexConverter+K;j(I).attr({src:H});if(MSVG.showFormulaOnMouseOver){j(I).attr({title:K.replace(/\s+/g," ")})}return I},generic:function(){if(MSVG.latexImages||!k()){MSVG.parseMath=MSVG.parseMathExternal}else{u()}if(!(window.SVGElement||j.browser.opera||j.browser.safari)){ASVG.drawPictures=ASVG.removePictures}}}}(jQuery);var ASVG=function($){var SVG;var collection=[];var markerChars="o*sSx+<>|";function createSVGElement(elType){return document.createElementNS("http://www.w3.org/2000/svg",elType)}function getSVGElement(id,el){var node,res={node:null,newEl:false};if(id){id=SVG.id+"_"+id;res.node=$("#"+id)[0]}if(!res.node){res.node=createSVGElement(el);if(id){res.node.id=id}res.newEl=true}return res}function appendSVG(elmt){if(elmt.newEl){$(SVG.canvas).append(elmt.node)}}function setButton(text,title,func){var node=MSVG.createElementXHTML("span",null,"svgButton");node.title=title;node.onclick=func;$(node).append(text);$(node).css({paddingRight:"0.5em",paddingLeft:"0.5em",fontSize:"1em",fontFamily:"monospace",background:"blue",color:"yellow",cursor:"pointer"});$(node).mouseover(function(){$(this).css({background:"yellow",color:"blue"})});$(node).mouseout(function(){$(this).css({background:"blue",color:"yellow"})});node.setAttribute("owner",SVG.id);return node}function pictureAttributes(){this.id=null;this.stroke="blue";this.strokewidth=1;this.strokeopacity=1;this.strokedasharray="none";this.fill="none";this.fillopacity=1;this.fontstyle="normal";this.fontfamily="serif";this.fontweight="normal";this.fontsize=12;this.fontstroke="none";this.fontstrokewidth=1;this.fontstrokeopacity=1;this.fontstrokedasharray="none";this.fontfill="black";this.fontfillopacity=1;this.sector=false;this.largearc=0;this.marker="o";this.size=8;this.orient="auto";this.units="userSpaceOnUse";this.markerstroke="blue";this.markerstrokewidth=1;this.markerstrokeopacity=1;this.markerstrokedasharray="none";this.markerfill="none";this.markerfillopacity=1;this.sweep=0;this.rx=0;this.ry=0;this.closed=false;this.curve="";this.direction=[1,0];this.ticklabels="";this.pos="";this.points=200;this.backgroundcolor="none";this.backgroundopacity=1}function pictureObject(){this.id=null;this.pos=null;this.src="";this.canvas=null;this.border=0;this.width=300;this.height=200;this.factor=1;this.xmin=-5;this.xmax=5;this.ymin=null;this.ymax=null;this.xunitlength=null;this.yunitlength=null;this.origin=[0,0];this.coords="cartesian";this.mouse=[null,null];this.drag=null;this.pan=true;this.locked=false;this.attr=new pictureAttributes()}function refresh(){translateAndEval(SVG.id)}function translateAndEval(id){var errstr;var src=SVG.src;$("#"+SVG.id+" .svgMarker").remove();$("#"+SVG.id+"Canvas").empty();$("#"+SVG.id+"mml").empty();ASVG.dynamic[id]={};src=src.replace(/dynamic\./g,"ASVG.dynamic."+id+".");SVG.attr=new pictureAttributes();try{with(Math){eval(src)}}catch(err){if(typeof err=="object"){errstr=err.name+" "+err.message+" "+err.number+" "+err.description}else{errstr=err}alert(errstr+"\n"+src)}collection[SVG.id]=SVG}function setOptions(atr){for(var i in atr){SVG.attr[i]=atr[i]}}function getOptions(attr,options,prefix){var pref=prefix||"";if(typeof attr=="string"){return(options[pref+attr]==undefined?SVG.attr[pref+attr]:options[pref+attr])}else{var i,newAttr={},len=attr.length,item;for(i=0;i<len;i++){item=attr[i];newAttr[item]=options[pref+item]==undefined?SVG.attr[pref+item]:options[pref+item]}return newAttr}}function setAction(evt,fn,id){if(!$.isFunction(fn)){return}var node=id?$("#"+SVG.id+"_"+id):$("#"+SVG.id);$(node).bind(evt,fn)}function getPosition(evt){var off=$(evt.currentTarget.parentNode).offset();var posX=(evt.pageX-off.left-SVG.origin[0]-SVG.border)/SVG.xunitlength;var posY=(SVG.height-SVG.origin[1]-evt.pageY+off.top+SVG.border)/SVG.yunitlength;return[posX,posY]}function getAngle(p){p=p||[0,0];var res=Math.atan2(SVG.mouse[1]-p[1],SVG.mouse[0]-p[0]);res=(res<0)?res+2*Math.PI:res;return res}function getDistance(p){p=p||[0,0];return Math.sqrt(Math.pow(SVG.mouse[0]-p[0],2)+Math.pow(SVG.mouse[1]-p[1],2))}function updateButton(obj){var id=$(obj).attr("owner");var node=$("#"+id+"src");if(obj.firstChild.nodeValue=="Edit"){obj.firstChild.nodeValue="Update";obj.title="Update picture";node.val(SVG.src).css("display","block")}else{SVG.src=node.val();translateAndEval(id)}}function switchTo(evt){var name=evt.currentTarget.id;if(SVG.id==name||SVG.locked){return}SVG=collection[name]}function onWheel(evt){if(SVG.locked){return false}evt=evt||window.event;var factor=1;if(evt.wheelDelta){factor=(evt.wheelDelta>0)?0.8:1.25}else{if(evt.detail){factor=(evt.detail<0)?0.8:1.25}}if(evt.shiftKey){changeSize(factor)}else{changeScales(factor)}evt.preventDefault();evt.stopPropagation();return false}function onClick(evt){if(evt.button===0){if(evt.shiftKey){$("#"+SVG.id+"toolbar").slideToggle();$("#"+SVG.id+"src").val(SVG.src);SVG.locked=!SVG.locked;evt.stopImmediatePropagation()}else{if(SVG.pan&&!SVG.locked){SVG.drag=[evt.clientX,evt.clientY]}}}return false}function onDrop(evt){if(SVG.drag==null){return false}var xlen=(SVG.drag[0]-evt.clientX)/SVG.xunitlength;var ylen=(-SVG.drag[1]+evt.clientY)/SVG.yunitlength;SVG.drag=null;if(xlen==0&&ylen==0){return false}changeScales(1,[SVG.xmin+xlen,SVG.xmax+xlen,SVG.ymin+ylen,SVG.ymax+ylen]);return false}function setScales(){SVG.xunitlength=SVG.width/(SVG.xmax-SVG.xmin);SVG.yunitlength=SVG.height/(SVG.ymax-SVG.ymin);SVG.origin=[-SVG.xmin*SVG.xunitlength,-SVG.ymin*SVG.yunitlength]}function getScales(scales){scales=scales||[];var res=[null,null,null,null];switch(scales.length){case 0:res[0]=SVG.xmin;res[1]=SVG.xmax;break;case 2:res[0]=scales[0];res[1]=scales[1];break;case 4:res=scales}return res}function setSize(){var picture=$("#"+SVG.id)[0];picture.setAttribute("width",SVG.width);picture.setAttribute("height",SVG.height);picture.parentNode.style.width=SVG.width+"px";picture.parentNode.style.height=SVG.height+"px";var node=$("#"+SVG.id+"ClipPath")[0];node.firstChild.setAttribute("d","M0,0 "+SVG.width+",0 "+SVG.width+","+SVG.height+" 0,"+SVG.height);node=$("#"+SVG.id+"Coords")[0];if(node){node.setAttribute("x",SVG.width);node.setAttribute("y",SVG.height-2)}}function changeSize(factor){SVG.factor*=factor;SVG.width/=factor;SVG.height/=factor;setSize();setScales();translateAndEval(SVG.id)}function changeScales(factor,trans){trans=trans||[SVG.xmin,SVG.xmax,SVG.ymin,SVG.ymax];SVG.factor*=factor;var dx=(SVG.xmax-SVG.xmin)*(1-factor)*0.5;var dy=(SVG.ymax-SVG.ymin)*(1-factor)*0.5;SVG.xmin=trans[0]+dx;SVG.xmax=trans[1]-dx;SVG.ymin=trans[2]+dy;SVG.ymax=trans[3]-dy;setScales();translateAndEval(SVG.id)}function updateCoord(evt){if(SVG.locked){return false}if($.browser.opera){switchTo(evt)}SVG.mouse=getPosition(evt);if(SVG.coords!="none"){var coords;if(SVG.coords=="cartesian"){coords="C: ("+SVG.mouse[0].toFixed(2)+", "+SVG.mouse[1].toFixed(2)+")"}else{coords="P: ("+getDistance().toFixed(2)+", "+getAngle().toFixed(2)+")"}$("#"+SVG.id+"Coords").text(coords)}return false}function removeCoord(){$("#"+SVG.id+"Coords").text("")}function exportSVG(obj){var name=$(obj).attr("owner");var pic=$("#"+name)[0].parentNode.innerHTML;var pos=pic.indexOf("</svg")+6;pic=pic.substr(0,pos);var svg="<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";if(pic.indexOf("svgCoords")>-1){pos=pic.lastIndexOf("<text");svg+=pic.substr(0,pos);pos=pic.lastIndexOf("</text")+7;svg+=pic.substr(pos)}else{svg+=pic}svg=svg.replace(/&nbsp;/g,"");svg=svg.replace(/><(?!\/)/g,">\n<");obj.previousSibling.firstChild.nodeValue="Edit";$("#"+name+"src").val(svg).css("display","block")}function toSVG(p){var x=p[0]*SVG.xunitlength+SVG.origin[0];var y=SVG.height-p[1]*SVG.yunitlength-SVG.origin[1];return[x,y]}function toSVGPair(p){var q=toSVG(p);return q[0]+" "+q[1]}function setStrokeAndFill(node,options,prefix){var attributes=["stroke","strokewidth","strokedasharray","strokeopacity","fill","fillopacity"];var attr=getOptions(attributes,options,prefix);node.setAttribute("stroke",attr.stroke);node.setAttribute("stroke-width",attr.strokewidth/SVG.factor);node.setAttribute("stroke-dasharray",attr.strokedasharray);node.setAttribute("stroke-opacity",attr.strokeopacity);node.setAttribute("fill",attr.fill);node.setAttribute("fill-opacity",attr.fillopacity)}function button(p,q,txt,action,options){options=options||{};options.id=(options.id||Math.randomString(8));rect(p,q,options);setAction("click",action,options.id);options.fill=null;options.fillopacity=1;options.id+="_t";text([(p[0]+q[0])*0.5,(p[1]+q[1])*0.5],txt,options);setAction("click",action,options.id)}function setMarkers(obj,options){var attributes=["marker","size","units","orient","markerstroke","markerstrokeopacity"];var attr=getOptions(attributes,options);var node,node2,i,id,pos=["marker-start","marker-mid","marker-end"];var lim=attr.marker.length;for(i=0;i<lim;i++){var type=attr.marker.charAt(i);if(type=="-"||markerChars.indexOf(type)<0){continue}id=(options.id||Math.randomString(8))+"Marker_"+markerChars.indexOf(type);node=$("#"+SVG.id+"_"+id)[0];if(!node){node=getSVGElement(id,"marker").node;node.setAttribute("class","svgMarker");node.setAttribute("viewBox","0 0 10 10");node.setAttribute("refX",5);node.setAttribute("refY",5);node.setAttribute("orient",attr.orient);node.setAttribute("markerUnits",attr.units);switch(type){case"*":case"o":node2=createSVGElement("circle");node2.setAttribute("cx",5);node2.setAttribute("cy",5);node2.setAttribute("r",4);break;case">":node2=createSVGElement("path");node2.setAttribute("d","M0 0 L10 5 L0 10 z");node.setAttribute("refX",10);break;case"<":node2=createSVGElement("path");node2.setAttribute("d","M10 0 L10 10 L0 5 z");node.setAttribute("refX",0);break;case"x":node2=createSVGElement("path");node2.setAttribute("d","M0 0 L10 10 M0 10 L10 0");break;case"+":node2=createSVGElement("path");node2.setAttribute("d","M5 0 L5 10 M0 5 L10 5");break;case"|":node2=createSVGElement("path");node2.setAttribute("d","M5 0 L5 10");break;case"S":case"s":node2=createSVGElement("rect");node2.setAttribute("x",0);node2.setAttribute("y",0);node2.setAttribute("width",10);node2.setAttribute("height",10)}setStrokeAndFill(node2,options,"marker");if("*<>S".indexOf(type)>-1){node2.setAttribute("fill",attr.markerstroke);node2.setAttribute("fill-opacity",attr.markerstrokeopacity)}$(node).append(node2);$("#"+SVG.id+"_Defs:first").append(node)}node.setAttribute("markerWidth",attr.size/SVG.factor);node.setAttribute("markerHeight",attr.size/SVG.factor);obj.setAttribute(pos[i],"url(#"+SVG.id+"_"+id+")")}}function setLabels(p,options){var i,point,pos;var label=(typeof options.label=="string")?[options.label]:options.label;var labelpos=getOptions("pos",options);labelpos=(typeof labelpos=="string")?[labelpos]:labelpos;var poslen=labelpos.length;var size=options.size||SVG.attr.size;var dx=(0.5*size/SVG.xunitlength)/SVG.factor;var dy=(0.5*size/SVG.yunitlength)/SVG.factor;for(i=0;i<label.length;i++){options.isLabel="_label"+i;point=p[i];pos=(poslen>i)?labelpos[i].toUpperCase():pos;if(/E/.test(pos)){point[0]+=dx}if(/W/.test(pos)){point[0]-=dx}if(/N/.test(pos)){point[1]+=dy}if(/S/.test(pos)){point[1]-=dy}options.pos=pos;text(point,label[i],options)}}function line(p,q,options){options=options||{};options.closed=false;options.curve="";path([p,q],options)}function dot(p,options){options=options||{};var direction=getOptions("direction",options);var q=[p[0]+direction[0]/SVG.xunitlength,p[1]+direction[1]/SVG.yunitlength];var elmt=getSVGElement(options.id,"path");var st="M"+toSVGPair(p)+" "+toSVGPair(q);elmt.node.setAttribute("d",st);elmt.node.setAttribute("stroke","none");setMarkers(elmt.node,options);if(options.label){setLabels([p,q],options)}appendSVG(elmt)}function path(list,options){options=options||{};var st,i,elmt=getSVGElement(options.id,"path");var attr=getOptions(["curve","closed"],options);var len=list.length;if(len===0){return}st="M"+toSVGPair(list[0])+" "+attr.curve;for(i=1;i<len;i++){st+=toSVGPair(list[i])+" "}if(attr.closed){st+="Z"}elmt.node.setAttribute("d",st);setStrokeAndFill(elmt.node,options);if(options.marker){setMarkers(elmt.node,options)}if(options.label){setLabels(list,options)}appendSVG(elmt)}function rotate(id,angle,options){if(!id||!angle){return}var node=$("#"+SVG.id+"_"+id)[0];if(node){options=options||{};var center=options.center?toSVG(options.center):SVG.origin;angle=-angle*180/Math.PI;var transform=node.getAttribute("transform")||"";transform="rotate("+angle+" "+center+") "+(options.replace?"":transform);node.setAttribute("transform",transform)}}function translate(id,delta,options){if(!id||!delta){return}var node=$("#"+SVG.id+"_"+id)[0];if(node){options=options||{};delta=toSVG(delta);var transform=node.getAttribute("transform")||"";transform="translate("+(delta[0]-SVG.origin[0])+"  "+(SVG.origin[1]+delta[1]-SVG.height)+") "+(options.replace?"":transform);node.setAttribute("transform",transform)}}function curve(list,options){options=options||{};options.curve=options.curve||"T";path(list,options)}function circle(center,radius,options){ellipse(center,radius,radius,options)}function loop(p,options){options=options||{};var d=options.direction||[1,0];options.curve="C";options.closed=false;path([p,[p[0]+d[0],p[1]+d[1]],[p[0]-d[1],p[1]+d[0]],p],options)}function arc(options){options=options||{};var start=options.start;var end=options.end;var center=options.center;var startangle=options.startangle;var endangle=options.endangle;var st="M",elmt=getSVGElement(options.id,"path");var attr=getOptions(["largearc","sweep","closed","sector"],options);var radius=options.radius;if(center!=null&&startangle!=null&&endangle!=null&&radius!=null){start=[radius*Math.cos(startangle)+center[0],radius*Math.sin(startangle)+center[1]];end=[radius*Math.cos(endangle)+center[0],radius*Math.sin(endangle)+center[1]]}if(start==null||end==null){return}if(!radius){var v=[end[0]-start[0],end[1]-start[1]];radius=Math.sqrt(v[0]*v[0]+v[1]*v[1])}if(attr.sector){st+=toSVGPair(center)+" "}st+=toSVGPair(start)+" A"+radius*SVG.xunitlength+","+radius*SVG.yunitlength+" 0 "+attr.largearc+","+attr.sweep+" "+toSVGPair(end);if(attr.sector||attr.closed){st+=" z"}elmt.node.setAttribute("d",st);setStrokeAndFill(elmt.node,options);if(options.marker){setMarkers(elmt.node,options)}if(options.label){setLabels([start,end],options)}appendSVG(elmt)}function sector(options){if(!options.center||!options.startangle||!options.endangle||!options.radius){return}options.sector=true;arc(options)}function ellipse(center,rx,ry,options){options=options||{};var elmt=getSVGElement(options.id,"ellipse");center=toSVG(center);elmt.node.setAttribute("cx",center[0]);elmt.node.setAttribute("cy",center[1]);elmt.node.setAttribute("rx",rx*SVG.xunitlength);elmt.node.setAttribute("ry",ry*SVG.yunitlength);setStrokeAndFill(elmt.node,options);appendSVG(elmt)}function polygon(list,options){options=options||{};options.closed=true;path(list,options)}function rect(p,q,options){options=options||{};var elmt=getSVGElement(options.id,"rect");var attr=getOptions(["rx","ry"],options);elmt.node.setAttribute("x",toSVG(p)[0]);elmt.node.setAttribute("y",toSVG(q)[1]);elmt.node.setAttribute("width",(q[0]-p[0])*SVG.xunitlength);elmt.node.setAttribute("height",(q[1]-p[1])*SVG.yunitlength);elmt.node.setAttribute("rx",attr.rx*SVG.xunitlength);elmt.node.setAttribute("ry",attr.ry*SVG.yunitlength);setStrokeAndFill(elmt.node,options);appendSVG(elmt)}function text(p,st,options){options=options||{};var id=options.id;var fill=getOptions("fontfill",options);if(id&&options.isLabel){id+=options.isLabel}var pos=getOptions("pos",options).toUpperCase();var fontsize=getOptions("fontsize",options)/SVG.factor;var node,dx=0,dy=0,str=st.toString();var q=toSVG(p);if(/\$/.test(str)){if(p[0]>SVG.xmax||p[0]<SVG.xmin||p[1]>SVG.ymax||p[1]<SVG.ymin){return}var dnode=$("#"+SVG.id+"mml:first");if(id){node=$("#"+id)[0]}if(!node){node=MSVG.createElementXHTML("div",id);node.style.position="absolute";dnode.append(node)}else{$(node).empty()}str=$.trim(str);str=str.substr(1,str.length-2);$(node).append(MSVG.parseMath(str,true,fontsize+"px",fill));dx=-node.offsetWidth/2;dy=-node.offsetHeight/2;if(/N/.test(pos)){dy=-node.offsetHeight}if(/S/.test(pos)){dy=0}if(/E/.test(pos)){dx=0}if(/W/.test(pos)){dx=-node.offsetWidth}node.style.left=(q[0]+dx)+"px";node.style.top=(q[1]+dy)+"px"}else{var baseline="middle",textanchor="middle";if(/E/.test(pos)){textanchor="start"}if(/W/.test(pos)){textanchor="end"}if(/N/.test(pos)){baseline="text-after-edge"}if(/S/.test(pos)){baseline="text-before-edge"}var attr=getOptions(["fontstyle","fontfamily","fontweight"],options);var elmt=getSVGElement(id,"text");$(elmt.node).empty().text(str);elmt.node.setAttribute("x",q[0]);elmt.node.setAttribute("y",q[1]);elmt.node.setAttribute("font-style",attr.fontstyle);elmt.node.setAttribute("font-family",attr.fontfamily);elmt.node.setAttribute("font-weight",attr.fontweight);elmt.node.setAttribute("font-size",fontsize);elmt.node.setAttribute("text-anchor",textanchor);elmt.node.setAttribute("dominant-baseline",baseline);setStrokeAndFill(elmt.node,options,"font");appendSVG(elmt)}}function image(url,options){options=options||{};var elmt=getSVGElement(options.id,"image");var height=options.height||SVG.height;var width=options.width||SVG.width;var point=toSVG(options.point||[SVG.xmin,SVG.ymin]);var pos=(options.pos||"").toUpperCase();var x=point[0]-width*0.5;var y=point[1]-height*0.5;if(/N/.test(pos)){y-=height*0.5}if(/S/.test(pos)){y+=height*0.5}if(/E/.test(pos)){x+=width*0.5}if(/W/.test(pos)){x-=width*0.5}elmt.node.setAttribute("x",x);elmt.node.setAttribute("y",y);elmt.node.setAttribute("width",width);elmt.node.setAttribute("height",height);elmt.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",url);appendSVG(elmt)}function grid(options){options=options||{};var dx,dy,x,y,k;var orig=options.origin||[0,0];options.stroke=options.stroke||"grey";options.strokewidth=(options.strokewidth||SVG.attr.strokewidth*0.25)/SVG.factor;var lim=getScales(options.scales);lim[2]=lim[2]||SVG.ymin;lim[3]=lim[3]||SVG.ymax;var group=getSVGElement("Grid","g");$(group.node).empty();var tempNode=SVG.canvas;SVG.canvas=group.node;if(SVG.coords=="polar"){dx=options.dx||1;dy=options.dy||3;var limit=Math.max(Math.abs(lim[0]),Math.abs(lim[1]),Math.abs(lim[2]),Math.abs(lim[3]));for(x=dx;x<limit;x+=dx){circle(orig,x,options)}if(dy>1){for(y=1;y<dy;y++){k=Math.tan(y*Math.PI/(2*dy));line([lim[0],(lim[0]-orig[0])*k+orig[1]],[SVG.xmax,(lim[1]-orig[0])*k+orig[1]],options);line([lim[0],-(lim[0]-orig[0])*k+orig[1]],[SVG.xmax,-(lim[1]-orig[0])*k+orig[1]],options)}}}else{dx=options.dx||1;dy=options.dy||dx;for(x=orig[0];x<lim[1];x+=dx){line([x,lim[2]],[x,lim[3]],options)}for(x=orig[0]-dx;x>lim[0];x-=dx){line([x,lim[2]],[x,lim[3]],options)}for(y=orig[1];y<lim[3];y+=dy){line([lim[0],y],[lim[1],y],options)}for(y=orig[1]-dy;y>lim[2];y-=dy){line([lim[0],y],[lim[1],y],options)}}SVG.canvas=tempNode;appendSVG(group)}function axes(options){options=options||{};options.marker="-|"+(options.marker?options.marker.charAt(0):"-");var x,y,start,stop;var orig=options.origin||[0,0];var origin=toSVG(orig);var dx=options.dx||1;var dy=options.dy||dx;var fontsize=getOptions("fontsize",options);var ddx=Math.max(0,Math.floor(-Math.log(dx+1e-9)/Math.log(10))+1);var ddy=Math.max(0,Math.floor(-Math.log(dy+1e-9)/Math.log(10))+1);options.stroke=options.stroke||"black";options.strokewidth=options.strokewidth||SVG.attr.strokewidth*0.5;options.markerstroke=options.stroke;options.markerstrokewidth=2*options.strokewidth;options.units="strokeWidth";options.size=fontsize*SVG.factor;var lim=getScales(options.scales);lim[2]=lim[2]||SVG.ymin;lim[3]=lim[3]||SVG.ymax;var list1=[],label1=[];start=orig[0]+dx;stop=lim[1]-0.25*dx;for(x=start;x<stop;x+=dx){list1.push([x,orig[1]]);label1.push(String(x.toFixed(ddx)))}list1.push([lim[1],orig[1]]);label1.push("");var list2=[],label2=[];start=orig[0]-dx;stop=lim[0]+0.25*dx;for(x=start;x>stop;x-=dx){list2.push([x,orig[1]]);label2.push(String(x.toFixed(ddx)))}list2.push([lim[0],orig[1]]);label2.push("");list2.reverse();list2=list2.concat(list1);if(options.ticklabels!=false){label2.reverse();options.label=label2.concat(label1);options.pos=(SVG.height-origin[1]>2*fontsize)?"S":"N"}var group=getSVGElement("Axes","g");$(group.node).empty();var tempNode=SVG.canvas;SVG.canvas=group.node;path(list2,options);list1=[],label1=[];start=orig[1]+dy;stop=lim[3]-0.25*dy;for(y=start;y<stop;y+=dy){list1.push([orig[0],y]);label1.push(String(y.toFixed(ddy)))}list1.push([orig[0],lim[3]]);label1.push("");list2=[];label2=[];start=orig[1]-dy;stop=lim[2]+0.25*dy;for(y=start;y>stop;y-=dy){list2.push([orig[0],y]);label2.push(String(y.toFixed(ddy)))}list2.push([orig[0],lim[2]]);label2.push("");list2.reverse();list2=list2.concat(list1);if(options.ticklabels!=false){label2.reverse();options.label=label2.concat(label1);options.pos=(origin[0]>2*fontsize)?"W":"E"}options.stroke=options.markerstroke;path(list2,options);SVG.canvas=tempNode;appendSVG(group)}function list(fun,tmin,tmax,options){var inc=(tmax-tmin)/getOptions("points",options);if(inc<=0||fun.length==0){return}var t,pth,g=[],xt,yt;for(t=1;t>=0;t--){if($.isFunction(fun[t])){g[t]=fun[t]}else{if(typeof fun[t]=="string"){with(Math){eval("g["+t+"] = function(x){return "+fun[t]+"}")}}else{return}}}if(g.length<2){return}pth=[];for(t=tmin;t<=tmax;t+=inc){xt=g[0](t);yt=g[1](t);if(isFinite(xt)&&isFinite(yt)){pth[pth.length]=[xt,yt]}}return pth}function plot(fun,options){options=options||{};var i,steps=options.steps||[];if(steps.length===0){plotter(fun,options)}else{var leftMarkers=options.leftMarkers||"-";var rightMarkers=options.rightMarkers||"-";var n_steps=steps.length-1;options.max=steps[0];options.marker="--"+leftMarkers.charAt(0);plotter(fun,options);for(i=0;i<n_steps;i++){options.max=steps[i+1];options.min=steps[i];options.marker=rightMarkers.charAt((rightMarkers.length>i)?i:0)+"-"+leftMarkers.charAt((leftMarkers.length>i+1)?i+1:0);plotter(fun,options)}options.max=null;options.min=steps[n_steps];options.marker=rightMarkers.charAt((rightMarkers.length==n_steps)?n_steps-1:0)+"--";plotter(fun,options)}}function plotter(fun,options){options=options||{};options.closed=false;options.curve="";var xmin=(options.min==null)?SVG.xmin:options.min;var xmax=(options.max==null)?SVG.xmax:options.max;var pth=list(["x",fun],xmin,xmax,options);if(pth){path(pth,options)}}function area(fun1,fun2,options){options=options||{};options.curve="";options.closed=true;var xmin=(options.min==null)?SVG.xmin:options.min;var xmax=(options.max==null)?SVG.xmax:options.max;var pth1=list(["x",fun1],xmin,xmax,options);var pth2=list(["x",fun2],xmin,xmax,options);if(pth1&&pth2){pth2.reverse();pth1=pth1.concat(pth2);path(pth1,options)}}function polarPlot(fun,options){var g1,g2;if(typeof fun=="string"){with(Math){eval("g1 = function(x){return ("+fun+")*cos(x)}");eval("g2 = function(x){return ("+fun+")*sin(x)}")}}else{if($.isFunction(fun)){with(Math){eval("g1 = function(x){return fun(x)*cos(x)}");eval("g2 = function(x){return fun(x)*sin(x)}")}}}parametricPlot(g1,g2,options)}function parametricPlot(fun1,fun2,options){options=options||{};options.closed=false;options.curve="";var xmin=(options.min==null)?0:options.min;var xmax=(options.max==null)?2*Math.PI:options.max;var pth=list([fun1,fun2],xmin,xmax,options);if(pth){path(pth,options)}}function slopeField(fun,options){options=options||{};var g=fun;if(typeof fun=="string"){with(Math){eval("g = function(x,y){return "+fun+"}")}}var gxy,x,y,u,v,dz;var dx=(options.dx==null)?1:options.dx;var dy=(options.dy==null)?1:options.dy;dz=Math.sqrt(dx*dx+dy*dy)/6;var xmin=Math.ceil(SVG.xmin/dx);var ymin=Math.ceil(SVG.ymin/dy);for(x=xmin;x<=SVG.xmax;x+=dx){for(y=ymin;y<=SVG.ymax;y+=dy){gxy=g(x,y);if(!isNaN(gxy)){if(Math.abs(gxy)=="Infinity"){u=0;v=dz}else{u=dz/Math.sqrt(1+gxy*gxy);v=gxy*u}line([x-u,y-v],[x+u,y+v],options)}}}}return{dynamic:{},removePictures:function(obj){var pictures=obj?[obj]:$(".svgGraph");$(pictures).each(function(){var target=this.parentNode;$(this).remove();$(target).css({color:"red",background:"yellow"});$(target).text("Missing picture: your  browser does not support inline SVG");window.setTimeout(function(){$(target).remove()},10000)})},drawPictures:function(obj){var options,xmin,xmax,ymin,ymax;var pictures=obj?[obj]:$(".svgGraph");$(pictures).each(function(){SVG=new pictureObject();options=this.getAttribute("options");if(options!=""){with(Math){eval("options="+options)}setOptions(options)}else{options={}}SVG.pos=options.pos||SVG.pos;if(SVG.pos=="inline"){$(this).wrap("<span></span>")}else{$(this).wrap("<div></div>")}SVG.width=options.width||SVG.width;SVG.height=options.height||SVG.height;SVG.coords=options.coords||SVG.coords;SVG.border=options.borderwidth||SVG.border;var borderstroke=options.borderstroke||"black";var borderstyle=options.borderstyle||"solid";if(options.pan==false){SVG.pan=false}SVG.src=this.getAttribute("script");var container=this.parentNode;switch(SVG.pos){case"left":$(container).css("float","left");break;case"right":$(container).css("float","right");break;case"center":$(container).css("margin","auto auto")}$(container).css("border",SVG.border+"px "+borderstyle+" "+borderstroke);container.removeChild(this);var scales=getScales(options.scales);SVG.xmin=scales[0];SVG.xmax=scales[1];SVG.ymin=scales[2];SVG.ymax=scales[3];if(SVG.xmin>=SVG.xmax){throw"Incorrect values: xmax<=xmin."}var xunitlength=SVG.width/(SVG.xmax-SVG.xmin);if(typeof SVG.ymin!="number"){SVG.ymin=-SVG.height/(2*xunitlength);SVG.ymax=-SVG.ymin}else{if(SVG.ymin>=SVG.ymax){throw"Incorrect values: ymax<=ymin."}}setScales();SVG.id=Math.randomString(16);var qnode=createSVGElement("svg");qnode.id=SVG.id;qnode.setAttribute("xmlns","http://www.w3.org/2000/svg");var node=createSVGElement("clipPath");node.id=SVG.id+"ClipPath";var node2=createSVGElement("path");$(node).append(node2);node2=createSVGElement("defs");node2.id=SVG.id+"_Defs";$(node2).append(node);$(qnode).append(node2);node=createSVGElement("rect");node.setAttribute("class","svgBackground");node.setAttribute("x","0");node.setAttribute("y","0");node.setAttribute("width","100%");node.setAttribute("height","100%");node.setAttribute("fill",SVG.attr.backgroundcolor);node.setAttribute("fill-opacity",SVG.attr.backgroundopacity);$(qnode).append(node);node=createSVGElement("g");node.id=SVG.id+"Canvas";node.setAttribute("clip-path","url(#"+SVG.id+"ClipPath)");SVG.canvas=node;$(qnode).append(node);if(SVG.coords!="none"&&SVG.pos!="inline"){node=createSVGElement("text");node.id=SVG.id+"Coords";node.setAttribute("class","svgCoords");node.setAttribute("text-anchor","end");node.setAttribute("font-size",(SVG.attr.fontsize*0.8));$(qnode).append(node)}$(container).append(qnode);container.style.position="relative";node=MSVG.createElementXHTML("span",SVG.id+"mml");$(container).append(node);if(SVG.pos!="inline"){node=MSVG.createElementXHTML("span",SVG.id+"toolbar");node.style.position="absolute";node.style.textAlign="left";node.style.zIndex=10;node2=setButton("Update","Edit script",function(){updateButton(this)});$(node).append(node2);node2=setButton("SVG","View SVG code",function(){exportSVG(this)});$(node).append(node2);node2=setButton("-","Zoom out",function(){changeScales(1.25)});$(node).append(node2);node2=setButton("+","Zoom in",function(){changeScales(0.8)});$(node).append(node2);node2=setButton("\u2191","Enlarge picture",function(){changeSize(0.8)});$(node).append(node2);node2=setButton("\u2193","Reduce picture",function(){changeSize(1.25)});$(node).append(node2);$(node).append("<br />");node2=MSVG.createElementXHTML("textarea",SVG.id+"src");$(node2).attr({rows:8,cols:80});$(node).append(node2);$(node).hide();$(container).append(node);setAction("mousemove",updateCoord);setAction("mouseout",removeCoord);setAction("mousedown",onClick);if(SVG.pan){setAction("mouseup",onDrop)}if(window.addEventListener){var evt=$.browser.mozilla?"DOMMouseScroll":"mousewheel";qnode.addEventListener(evt,onWheel,false)}}setAction("mouseover",switchTo);setSize();translateAndEval(SVG.id)})}}}(jQuery);
//}}}
/***
!~TiddlyWiki formatters
***/
//{{{
if(!version.extensions.MathSVGPlugin) { //# ensure that the plugin is only installed once
version.extensions.MathSVGPlugin = {installed: true};
MSVG.generic();

config.formatterHelpers.MathSVGHelper = function(w) {
  this.lookaheadRegExp.lastIndex = w.matchStart;
  var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
  if(lookaheadMatch){
    var eq = MSVG.parseMath(lookaheadMatch[1],this.displaystyle);
    if(this.displaystyle){
      var node = createTiddlyElement(w.output,"div");
      node.style.textAlign='center';
      node.appendChild(eq);
      w.output.appendChild(node);
    } else {w.output.appendChild(eq);}
    w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
  }
}

config.formatters.push( {
  name: "clatex",
  match: "\\$\\$",
  lookaheadRegExp: /\$\$((?:.|\n)*?)\$\$/mg,
  displaystyle: true,
  handler: config.formatterHelpers.MathSVGHelper
})

config.formatters.push( {
  name: "clatex2",
  match: "\\\\\\\[",
  lookaheadRegExp: /\\\[\s*(.*?)\s*\\\]/mg,
  displaystyle: true,
  handler: config.formatterHelpers.MathSVGHelper
})

config.formatters.push( {
  name: "latex",
  match: "\\$",
  lookaheadRegExp: /\$((?:.|\n)*?)\$/mg,
  displaystyle: false,
  handler: config.formatterHelpers.MathSVGHelper
})

config.formatters.push( {
  name: "graph",
  match: "\\(:graph",
  lookaheadRegExp: /\(:graph(?:\((\{.+?\})?\))?[\s]+((?:.|\n)*?)[\s]+:\)/mg,
  handler: function(w){
  this.lookaheadRegExp.lastIndex = w.matchStart;
  var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
  if(lookaheadMatch){
    var svg = createTiddlyElement(w.output,"embed");
    svg.className="svgGraph";
    svg.setAttribute('options',lookaheadMatch[1]||"");
    svg.setAttribute('script',lookaheadMatch[2]);
    ASVG.drawPictures(svg);
    w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
  }
  }
})
}
//}}}
/***
The script should not be edited. All available options can be set by the following variables:
***/
//{{{
//MSVG.showFormulaOnMouseOver = false; //show LaTeX code on mouse over the equation
//MSVG.latexImages = false; //set to true to force the use of an external converter
//MSVG.latexConverter = "http://www.yourequations.com/eq.latex?"; //link to external converter
//MSVG.mathColor = "green"; //font color
//MSVG.mathFontSize = ""; //font size
//MSVG.mathFontFamily = ""; //font family
//}}}
/***
New symbols or commands can be defined here:
***/
//{{{
 var commands = ["nle","R","diagup","varnothing","ind","DD"];
 var symbols = ["\u2270","\u211D","\u2571","\u2205","\u2AEB","\\frac{d}{dr}"];
 MSVG.define(commands,symbols);
//}}}
rm $\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
rm $\mathrm{abcdefghijklmnopqrstuvwxyz}$

it $\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
it $\mathit{abcdefghijklmnopqrstuvwxyz}$

sf $\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
sf $\mathsf{abcdefghijklmnopqrstuvwxyz}$

tt $\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
tt $\mathtt{abcdefghijklmnopqrstuvwxyz}$

bf $\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
bf $\mathbf{abcdefghijklmnopqrstuvwxyz}$

bb $\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
bb $\mathbb{abcdefghijklmnopqrstuvwxyz}$

frak $\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
frak $\mathfrak{abcdefghijklmnopqrstuvwxyz}$

cal $\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
cal $\mathcal{abcdefghijklmnopqrstuvwxyz}$
<!--{{{-->
<!--
|Name|MediaEditTemplate|
|Source|http://www.TiddlyTools.com/#MediaEditTemplate|
|Version|1.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|template|
|Requires|ListboxPlugin, CheckboxPlugin|
|Overrides||
|Description|custom version of edit template used when tiddler is tagged with "media"|
-->
<span class='toolbar' macro='toolbar +saveTiddler -cancelTiddler ! copyTiddler deleteTiddler ! fields '></span>
<div class='title' macro='view title'></div>
<div style='clear:both'></div>
<div class='viewer'>
<table class='borderless' style='width:100%'><tr valign='bottom'>
<td style='width:40%'>
	<div class='small'>this item (tiddler name):</div>
	<div class='editor' macro='edit title'></div>
</td><td style='width:30%'>
	<div class='small'>previous (tiddler name):</div>
	<div class='editor' macro='edit previous'></div>
</td><td style='width:30%'>
	<div class='small'>next (tiddler name):</div>
	<div class='editor' macro='edit next'></div>
</td></tr></table>
<table class='borderless' style='width:100%'><tr valign='bottom'>
<td style='width:70%'>
	<div class='small'>caption (text):</div>
	<div class='editor' macro='edit mediatitle'></div>
</td><td style='width:15%'>
	<div class='small'>item ID (text):</div>
	<div class='editor' macro='edit itemid'></div>
</td><td style='width:15%'>
	<div class='small'>group ID (text):</div>
	<div class='editor' macro='edit groupid'></div>
</td></tr></table>
<table class='borderless' style='width:100%'><tr valign='bottom'>
<td style='width:40%'>
	<div class='small left'>media&nbsp;URL (Windows/Real/Quicktime/Flash/JPG/GIF/HTML):</div>
	<div class='editor' macro='edit mediaurl'></div>
</td><td style='width:15%'>
	<div class='small left'>media&nbsp;type:</div>
	<div class='editor smallform' macro='select mediatype rows:1 width:100% "auto-detect=auto" "Windows Media=windows" "Real One=realone" "QuickTime=quicktime" "Flash=flash" "still image (JPG/GIF)=image" "web page (HTML)=iframe"'></div>
</td><td style='width:15%'>
	<span class='small'>width&nbsp;(px):</span>
	<span class='editor' macro='edit width'></span>
</td><td style='width:15%'>
	<span class='small'>height&nbsp;(px):</span>
	<span class='editor' macro='edit height'></span>
</td><td style='width:15%;white-space:nowrap'>
	<span class='smallform' macro='checkbox autoplay@'></span><!--
	--><span class='small'>autoplay</span><br>
	<span class='smallform' macro='checkbox showcontrols@ checked'></span><!--
	--><span class='small'>show controls</span>
</td></tr></table>
<div class='small'>Notes (text):</span></div>
<div class='editor' macro='edit text 5'></div>
<table class='borderless' style='width:100%'><tr valign='bottom'>
<td style='width:33%'>
	<div class='small'>Submit comments to (URL):</div>
	<div class='editor' macro='edit rpgaction'></div>
</td><td style='width:33%'>
	<div class='small'>OK 'landing' page (URL):</div>
	<div class='editor' macro='edit rpgok'></div>
</td><td style='width:33%'>
	<div class='small'>Retry 'landing' page (URL):</div>
	<div class='editor' macro='edit rpgretry'></div>
</td></tr></table>
<div class='small'>Tags (keywords):</span></div>
<div class='editor' macro='edit tags'></div>
<div class='small editorFooter' style='text-align:left !important;'>
	<span macro='message views.editor.tagPrompt'></span>
	<span macro='tagChooser'></span>
</div>
<div style='clear:both'></div>
</div>
<!--}}}-->
These plugins enable you to easily add various types of media (audio, video, flash, etc.) to your tiddler content.  The package includes several different kinds of embedded media players and a number of examples that define and present media content using custom templates, along with supporting plugins to provide additional rendering/formatting for the content surrounding the embedded player.
Jeremy Ruston (TiddlyWiki) and Eric Shulman (TiddlyTools)
Yerba Buena Gardens, The Metreon, San Francisco, CA
1/28/06 3:45pm
[[AmericaFree.TV|http://www.AmericaFree.tv]] offers FREE ~QuickTime video streams of classic comedy films such as //"Arsenic and Old Lace"//, as well as movies/TV shows from Abbott & Costello, The Three Stooges, Laurel & Hardy, and others.

Other streams from ~AmericaFree.TV include "Classic Movies" and "~B-Movies" from the 1950's and 1960's.  Visit [[AmericaFree.TV|http://www.AmericaFree.tv]] for details and links.
Live webcam views of Times Square, New York, complete with audio.  Automatically switches between several cameras from various vantage points.
<!--{{{-->
<!--
|Name|MediaViewTemplate|
|Source|http://www.TiddlyTools.com/#MediaViewTemplate|
|Version|1.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|template|
|Requires|ToolbarCommands, StoryViewerPlugin, WikifyPlugin, PlayerPlugin|
|Overrides||
|Description|custom version of view template used when tiddler is tagged with "media"|
-->
<span class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></span>
<span class='title'>
	<span class='floatleft' macro='tiddlerIcons' style='cursor:auto !important;'></span>
	<span macro='view title'></span>
</span>
<span class='subtitle'>
	<span style='white-space:nowrap' macro='view modified date [[DDD, MMM DDth YYYY]]'></span>
</span>
<div class='tagClear'></div>
<div class='viewer'>
<div class='floatright smallform' macro='storyViewer media list allbuttons'></div>
<div class='big' macro='view mediatitle wikified'></div>
<hr>
<table class='borderless' style='width:100%'><tr valign='top'>
<td style='width:50%' rowspan='2'>
	<div macro='wikify "{{stretch{<<player [[id=%0]] [[%1]] [[%2]] [[%3]] [[%4]] [[%5]] [[%6]]>>}}}"
		title mediatype mediaurl width height autoplay showcontrols'></div>
	<div style='text-align:center'>
		<span class='smallform' macro='checkbox autoplay@'></span>
		<span class='small'>autoplay</span>
		<span class='smallform' macro='checkbox showcontrols@ checked'></span>
		<span class='small'>show controls</span>
	</div>
</td>
<td style='width:50%' valign=top>
	<div class='fine floatright'>group:<span macro='wikify %0 groupid'></span></div>
	<div class='fine'>notes:</div>
	<div class='small groupbox' macro='view text wikified'></div>
</td></tr><tr><td valign=bottom>
	<form target="responseframe" method="post" enctype="multipart/form-data" action="">
		<div class='fine bold italic'>If you would like to ask a question or make a comment:</div>
		<div class='small groupbox'>
			<div style='display:block';>
				<textarea name="answer" style='width:100%;height:6em' rows="6"></textarea>
				<div class='center'>
					<span class='fine bold italic'>Enter your message, then press </span>
					<!-- hidden values set by onclick handler below -->
					<input type="hidden" name="username" value="txtUserName">
					<input type="hidden" name=itemid value="code#"> 
					<input type="hidden" name=okPage value="URL">
					<input type="hidden" name=retryPage value="URL">
					<input type="submit" value="send"
						onclick="var tid=story.findContainingTiddler(this).getAttribute('tiddler');
							var action=store.getValue(tid,'act');
							var ok=store.getValue(tid,'ok');
							var retry=store.getValue(tid,'retry');
							var defaults=store.getTiddlerText('DefaultResponder','').split('\n');
							this.form.action=action?action:defaults[0];
							this.form.okPage.value=ok?ok:defaults[1];
							this.form.retryPage.value=retry?retry:defaults[2];
							this.form.itemid.value=store.getValue(tid,'itemid');
							if (config.macros.setUserName.handler) config.macros.setUserName.handler();
							this.form.username.value=config.options.txtUserName;
							this.parentNode.parentNode.style.display='none';
							this.parentNode.parentNode.nextSibling.style.display='block';
							if (!this.form.action.length) { 
								var f=this.parentNode.parentNode.nextSibling.firstChild;
								var d=f.document;
								if (f.contentDocument) d=f.contentDocument; // For NS6
								else if (f.contentWindow) d=f.contentWindow.document; // For IE5.5 and IE6
							 	d.open();
								d.writeln('<font size=-1><i>A responder URL has not been defined.<br>');
								d.writeln('Your response was not sent.</i></font>');
								d.close();
								return false;
							}
					">
				</div>
			</div><div style='display:none'><iframe
					src="" name="responseframe" id="responseframe"
					style="height:7em;width:100%;">
				</iframe>
				<div class='center medium'>
					<input type='button' value='try again...'
						title='edit and resend your response'
						onclick='var here=this.parentNode.parentNode;
							here.style.display="none"; here.previousSibling.style.display="block";'>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<input type='button' value='next item...'
						onmouseover='var tid=story.findContainingTiddler(this).getAttribute("tiddler");
							this.title="proceed to "+store.getValue(tid,"next");'
						onclick='var tid=story.findContainingTiddler(this).getAttribute("tiddler");
							var next=store.getValue(tid,"next");
							if (next&&next.length) story.displayTiddler(null,next);
							else displayMessage("There is no next item...");'>
				</div>
			</div>
		</div>
	</form>
</td>
</tr></table>
<div class='tagClear'></div>
</div>
<!--}}}-->
/%
|Name|MicroBrowser|
|Source|http://www.TiddlyTools.com/#MicroBrowser|
|Version|1.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|Type|html|
|Description|simplified browser-in-browser with bookmarks|

Usage: <<tiddler MicroBrowser with: TiddlerName>>
where TiddlerName (optional) contains an HR-separated
list of bookmarks (1st line=list text, 2nd line=URL)

Note: for full browser-in-browser features, including support
for embedded video and flash players, see [[MiniBrowserPlugin]]

%/<html><style>#tiddlerMicroBrowser .tagged {display:none;}</style>
<form style='display:block;margin:0;padding:0;white-space:nowrap;' onsubmit='return false;'><!--
	--><input type='button' value='<' title='back' style='width:3%'
		onclick='try{this.form.nextSibling.history.go(-1)}catch(e){window.history.go(-1)}'><!--
	--><input type='button' value='>' title='forward' style='width:3%'
		onclick='try{this.form.nextSibling.history.go(+1)}catch(e){window.history.go(+1)}'><!--
	--><input type='button' value='+' title='refresh'style='width:3%'
		onclick='try{this.form.nextSibling.location.reload()}catch(e){;}'><!--
	--><input type='button' value='x' title='stop'style='width:3%'
		onclick='window.stop()'><!--
	--><select name='bookmarks' size='1' style='width:25%'
		onchange='this.form.url.value=this.value; this.form.go.click();'><!--
	--><option value=''>bookmarks...</option><!--
	--></select><!--
	--><input type='button' value='edit' title='edit the bookmarks list' style='width:6%'
		onclick='story.displayTiddler(null,this.form.bookmarks.getAttribute("tiddler"),2)'><!--
	--><input type='text' name='url' size='60' value='' style='width:39%'
		onfocus='this.select()'><!--
	--><input type='button' value='go' name='go' title='view URL' style='width:6%'
		onclick="var f=this.form; var i=this.form.nextSibling;
			var u=f.url.value.trim(); if (!u.length) u=f.url.value=f.bookmarks.value.trim();
			if (u.length) { f.done.disabled=false; i.style.display='block'; i.src=u; }
			else { f.done.disabled=true; i.style.display='none'; i.src=''; }
		"><!--
	--><input type='button' value='open' title='open a separate tab/window' style='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='width:6%'
		onclick="this.form.done.disabled=true; var i=this.form.nextSibling; i.style.display='none'; i.src='';"><!--
	--></div></form><iframe src='' width='100%' height='480' 
		style='display:none;background:#fff;border:1px solid;'></iframe>
<hide linebreaks></html><<tiddler {{
	var list=place.lastChild.getElementsByTagName('form')[0].bookmarks;
	while (list.options[1]) list.options[1]=null;
	var tid='$1'; if(tid=='$'+'1') tid='MiniBrowserList';
	list.setAttribute('tiddler',tid);
	var parts=store.getTiddlerText(tid,'').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);
	}
''}}>>
/%
|Name|MicroCalc|
|Source|http://www.TiddlyTools.com/#MicroCalc|
|Version|1.1.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|html|
|Requires||
|Overrides||
|Description|a simple embeddable calculator using javascript eval() function|

Usage: <<tiddler MicroCalc>>

%/<<tiddler HideTiddlerTags>>/%
%/{{small smallform{/%
%/<html><div style="width:100%"><hide linebreaks>
<form action="javascript:;" style="display:inline;margin:0;padding:0;"><!--
--><input name="input" value="0" style="width:70%;text-align:right;"
	title="INPUT: enter a JavaScript expression, function, or object/variable name"
	onfocus="this.select()"
	onkeyup="if (event.keyCode==13) {this.form.go.click(); return false;}"><!--
--><input name="go" type="button" value="=" style="width:10%"
	title="CALCULATE: evaluate input and display results"
	onclick="var i=this.form.input; var o=this.form.output; var val=i.value; var res='';
		try{res=eval(val);i.value=res}catch(e){res=e.description||e.toString()};
		o.value+=(o.value.length?'\n':'')+val+'\n='+res;
		o.style.display='block'; o.scrollTop=o.scrollHeight;
		i.select();i.focus();"><!--
--><input name="memstore" type="button" value="m" style="width:10%"
	title="MEMORY STORE: save input to temporary memory"
	onclick="var f=this.form; f.memory.value=f.input.value;
		f.memory.parentNode.style.display='block'"><!--
--><input name="clear" type="button" value="c" style="width:10%" 
	title="CLEAR: erase history and reset input"
	onclick="var i=this.form.input; var o=this.form.output;
		o.value='';o.style.display='none';
		i.value='0';i.select();i.focus();"><!--
--><div style="display:none"><!--
--><input name="memory" value="0" style="width:70%;text-align:right;"
	title="MEMORY: temporarily store input during calculations"><!--
--><input name="meminsert" type="button" value="mi" style="width:10%"
	title="MEMORY INSERT: append memory value to current input"
	onclick="var i=this.form.input;
		i.value+=this.form.memory.value; i.select();i.focus();"><!--
--><input name="memrecall" type="button" value="mr" style="width:10%"
	title="MEMORY RECALL: replace current input with memory value "
	onclick="var i=this.form.input;
		i.value=this.form.memory.value; i.select();i.focus();"><!--
--><input name="memclear" type="button" value="mc" style="width:10%"
	title="MEMORY CLEAR: clear temporary memory"
	onclick="var f=this.form; f.memory.value='0';
		f.memory.parentNode.style.display='none';
		f.input.select();f.input.focus();"><!--
--></div><!--
--><textarea name="output" rows=5 style="width:99%;display:none;"
	title="HISTORY: previous inputs and calculated results"></textarea><!--
--></form></div></html>/%
%/}}}
TiddlyWiki.com - official release
http://www.TiddlyWiki.com
----
TiddlyWiki.org - wiki, tickets, source control
http://www.TiddlyWiki.org
----
GoogleGroup: TiddlyWiki - user/author discussion
http://groups.google.com/group/TiddlyWiki/
----
GoogleGroup: TiddlyWikiDev - core/plugin discussion
http://groups.google.com/group/TiddlyWikiDev/
----
TiddlyVault - index of add-ons from many sources
http://TiddlyVault.TiddlySpot.com
----
TiddlySpot - instant TiddlyWiki hosting!!
http://www.TiddlySpot.com
----
TiddlyTools - plugins, scripts, templates, etc.
http://www.TiddlyTools.com
----
del.icio.us - find popular TiddlyWiki sites
http://del.icio.us/tag/tiddlywiki
----
<<tiddler BookmarkList>>
----
<<tiddler MiniBrowserList_osmosoft>>
----
<<tiddler MiniBrowserList_tech>>
----
<<tiddler MiniBrowserList_news>>
----
<<tiddler MiniBrowserList_media>>
----
<<tiddler MiniBrowserList_flash>>
flash games...

----
Rag Doll
http://www.planetdan.net/pics/misc/georgerag.swf
----
Asteroids
http://www.80smusiclyrics.com/games/asteroids.swf
----
PacMan
http://www.80smusiclyrics.com/games/pacman.swf
----
Tetris
http://www.80smusiclyrics.com/games/tetris2.swf
----
Simon
http://www.80smusiclyrics.com/games/simon.swf
flickr photos...

----
HDR Pool (public collection)
http://www.flickr.com/groups/hdr/pool/show/
----
favorite videos...

----
"PovertyUSA" - WATCH THIS!
http://www.nccbuscc.org/cchd/povertyusa/tour.swf
----
Jack W counts (1yr old)
http://wolfram.org/media/jack_20050310_cleaned.mov
----
webcams...

----
Times Square
http://www.earthcam.com/usa/newyork/timessquare/asx/tsq_stream.asx
----
Monterey Bay
http://www.mbayaq.org/media/STRM/mba_mbay.asx
----
Wrightsville Beach, North Carolina
http://www.aroundtownnc.com/wvx/beachcam.wvx
----
Koningsplein, Amsterdam
"""mms://rembrandt.terena.nl/stream2"""
----
Corsica
http://195.6.173.164/liensmedias/webcam.asx
----
Kulak's Woodshed: Live/Recorded acoustic music
http://www.kulakswoodshed.com/high.asx
----
news...

----
BBC News24 - Live
http://www.bbc.co.uk/newsa/n5ctrl/live/nb/rm/video/now2_nb.ram
----
BBC News - London Summary
http://www.bbc.co.uk/london/realmedia/news/tvnews.ram
----
BBC Entertainment News
http://www.bbc.co.uk/newsa/n5ctrl/summaries/entertain/bb_liquid_news.ram
----
Bloomberg Business News
http://www.bloomberg.com/streams/video/LiveBTV200.ram
----
movies (AmericaFree.TV)...

----
Classic Comedy
http://www.americafree.tv/unicast_mov/AmericaFreeTVComedy.mov
----
Classic Movies
http://www.americafree.tv/unicast_mov/AmericaFreeTVClassics.mov
----
"B" Movies
http://www.americafree.tv/unicast_mov/AmericaFreeTVDimensionB.mov
----
science/education/govt...

----
PBS: Annenberg/CPB
http://www.scctv.net/annenberg_broadband.asx
----
NASA TV
http://science.ksc.nasa.gov/video/nasatv/nasatv.asx
----
C-SPAN 1
http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan1v.asf&proto=mms?mswmext=.asx
----
C-SPAN 2
http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan2v.asf&proto=mms?mswmext=.asx
----
C-SPAN 3
http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan3v.asf&proto=mms?mswmext=.asx
news and events...

----
News - CNN
http://www.cnn.com
----
News - BBC
http://news.bbc.co.uk
----
Comics
http://www.unitedmedia.com/comics/
----
Television
http://www.tvguide.com/listings/default.aspx
----
Weather
http://www.wunderground.com/US/CA/Sunnyvale.html
----
Earthquakes
http://quake.wr.usgs.gov/recenteqs/latest.htm
----
Maps
http://maps.google.com
BT/Osmosoft...

----
Jeremy Ruston
http://jermolene.wordpress.com/
----
Andrew Back
http://carrierdetect.com/
----
Fred Dohr
http://fnd.lewcid.org/blog/
----
James Shi
http://curiousjames.wordpress.com/
----
Jon Lister
http://jaybyjayfresh.com/
----
Nick Webb
http://www.erraticmusings.com/
----
Paul Downey
http://blog.whatfettle.com/
----
Phil Hawksworth
http://www.hawksworx.com/journal/
----
Phil Whitehouse
http://philwhitehouse.blogspot.com/
----
Simon McManus
http://simonmcmanus.com/
technical references...

----
Javascript QuickRef (DevGuru)
http://www.devguru.com/technologies/javascript/
----
CSS QuickRef (DevGuru)
http://www.devguru.com/technologies/css2/
----
CSS compatibility chart
http://www.webdevout.net/browser-support-css
----
Unicode Character Charts
http://www.alanwood.net/unicode/
----
UTF-8 Encoding (Wikipedia)
http://en.wikipedia.org/wiki/UTF-8
----
HTML Character entities (W3)
http://www.w3.org/TR/REC-html40/sgml/entities.html
----
Mozilla Developer Center
http://developer.mozilla.org/
----
Gecko DOM Reference
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference
----
IP Lookup...

----
ARIN - North America
http://www.arin.net
----
RIPE - Europe
http://www.ripe.net
----
APNIC - Asia/Pacific
http://www.apnic.net
----
LACNIC - Latin America/Caribbean
http://www.lacnic.net
----
AFRINIC - Africa
http://www.afrinic.net
/***
|Name|MiniBrowserPlugin|
|Source|http://www.TiddlyTools.com/#MiniBrowserPlugin|
|Documentation|http://www.TiddlyTools.com/#MiniBrowserPluginInfo|
|Version|1.5.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.2|
|Type|plugin|
|Requires|PlayerPlugin (optional, recommended)|
|Description|embedded browser-in-browser with favorites lists and media support|
!!!!!Documentation
>see [[MiniBrowserPluginInfo]]
!!!!!Configuration
>Default mini browser size:
>width: <<option txtMiniBrowserWidth>> height: <<option txtMiniBrowserHeight>>
!!!!!Revisions
<<<
2009.08.29 [1.5.2] in load(), fixed 'noplayer' IFRAME output
2009.07.03 [1.5.1] added onclick handling to 'n of m' button.  also, if noedit mode, add line numbers to bookmarks droplist items
2009.06.08 [1.5.0] added optional 'noedit' mode: replaces add/del/edit buttons with next/previous navigation.
|see [[MiniBrowserPluginInfo]] for additional revision details|
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.MiniBrowserPlugin={major: 1, minor: 5, revision: 2, date: new Date(2009,8,29)};

config.shadowTiddlers.MiniBrowser='<<miniBrowser>>';
config.options.txtMiniBrowserWidth=config.options.txtMiniBrowserWidth||'100%';
config.options.txtMiniBrowserHeight=config.options.txtMiniBrowserHeight||'480';
config.macros.miniBrowser= {
	favoritesList: 'MiniBrowserList',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var noPlayer=params[0]&&params[0].toLowerCase()=='noplayer'; if (noPlayer) params.shift();
		var noEdit  =params[0]&&params[0].toLowerCase()=='noedit';   if (noEdit)   params.shift();
		var expand  =params[0]&&params[0].toLowerCase()=='expand';   if (expand)   params.shift();
		var hideControls=params[0]&&params[0].toLowerCase()=='hidecontrols'; if (hideControls) params.shift();
		var url=(params[0]&&!store.tiddlerExists(params[0]))?params.shift():'';
		hideControls=hideControls&&url.length; // no initial URL, show controls anyway
		if (!config.macros.player) noPlayer=true; // PlayerPlugin not installed
		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=store.getTiddlerText('MiniBrowserPlugin##html');
		html=html.replace(/%id%/g,guid)
			.replace(/%noplayer%/g,noPlayer?'true':'')
			.replace(/%noedit%/g,noEdit||readOnly?'none':'inline')
			.replace(/%shownav%/g,noEdit||readOnly?'inline':'none')
			.replace(/%hidecontrols%/g,hideControls?'none':'block')
			.replace(/%bookmarksize%/g,(expand?70:20)+'%')
			.replace(/%urlsize%/g,(expand?69.5:20)+'%')
			.replace(/%linebreak%/g,expand?'<br>':'')
			.replace(/%favorites%/g,params[0]||config.macros.miniBrowser.favoritesList);
		createTiddlyElement(place,'span').innerHTML=html;

		// init form
		function $(i){return document.getElementById(i)}; // abbrev
		$('minibrowser_controls_'+guid).style.display=hideControls?'none':'block';
		$('minibrowser_resize_'+guid).style.display=hideControls?'none':'block';
		$('minibrowser_togglecontrols_'+guid).checked=!hideControls;
		$('minibrowser_form_'+guid).url.value=url;
		$('minibrowser_form_'+guid).w.value=w;
		$('minibrowser_form_'+guid).h.value=h;
		if (noPlayer) { // hide type list no PlayerPlugin
			$('minibrowser_type_'+guid).style.display='none';
			$('minibrowser_url_'+guid).style.width=(expand?81.5:32)+'%';
		}

		// load bookmarks droplist from HR-separated tiddler contents
		var b=$('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,noEdit); // load custom bookmarks
		if (b.length<2) this.getFavorites(b,config.macros.miniBrowser.favoritesList,noEdit); // default list
		$('minibrowser_nav_'+guid).value='1 out of '+b.length;

		// load initial URL (if any)
		var place=$('minibrowser_player_'+guid);
		this.load(place,guid,'','',w,h,true,noPlayer);
		this.go($('minibrowser_form_'+guid));
	},
	getFavorites: function(list,tid,noEdit) {
		var txt=store.getTiddlerText(tid); if (!txt||!txt.trim().length) return;
		txt=this.getWikifiedData(txt);
		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':'';
			var prefix=value.length&&noEdit?list.length+1+': ':'';
			list.options[list.length]=new Option(prefix+indent+label,value,false,false);
		}
	},
	getWikifiedData: // wikify content, then extract text WITH newlines and HRs included
	function(txt) {
		var e=createTiddlyElement(document.body,'div'); wikify(txt,e);
		var breaks=e.getElementsByTagName('br');
		for (var b=0; b<breaks.length; b++)
			breaks[b].parentNode.insertBefore(document.createTextNode('\n'),breaks[b]);
		var lines=e.getElementsByTagName('hr');
		for (var l=0; l<lines.length; l++)
			lines[l].parentNode.insertBefore(document.createTextNode('----\n'),lines[l]);
		var items=e.getElementsByTagName('li');
		for (var i=0; i<items.length; i++)
			items[i].parentNode.insertBefore(document.createTextNode('\n'),items[i]);
		var txt=getPlainText(e);
		removeNode(e);
		return txt.replace(/\r*/g,'').replace(/\n\n/g,'\n');
	},
	load: function(place,id,type,url,w,h,showcontrols,noPlayer) {
		if (!noPlayer)
			config.macros.player.loadURL(place,id,type,url,w,h,showcontrols);
		else { // force IFRAME-only display
			if (!place) place=document.getElementById(id).parentNode;
			var fmt="<iframe name='%0' id='%0' src='%1' width='%2' height='%3' \
				style='background:#fff;border:1px solid'></iframe>";
			place.innerHTML=fmt.format([id,url,w,h]);
		}
	},
	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) {
		// fudge factor to account for the other controls + padding + borders.  ADJUST THIS VALUE TO FIT LAYOUT
		var trim=89;
		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');
		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='width:3%'
	onclick='try{window.frames["player_%id%"].history.go(-1)}catch(e){window.history.go(-1)}' ><!--
--><input type='button' value='>' title='forward' style='width:3%'
	onclick='try{window.frames["player_%id%"].history.go(+1)}catch(e){window.history.go(+1)}'><!--
--><input type='button' value='+' title='refresh'style='width:3%'
	onclick='try{window.frames["player_%id%"].location.reload()}catch(e){;}'><!--
--><input type='button' value='x' title='stop'style='width:3%'
	onclick='window.stop()'><!--
--><select name='bookmarks' id='minibrowser_bookmarks_%id%' size='1' style='width:%bookmarksize%'
	onchange='this.form.url.value=this.value;
		this.form.nav.value="%0 out of %1".format([this.selectedIndex+1,this.length]);
		this.form.nav.title="reload %0".format([this.options[this.selectedIndex].text]);
		return config.macros.miniBrowser.go(this.form);'><!--
--><option value=''>bookmarks...</option><!--
--></select><!--
--><span style='display:%noedit%'><!--
--><input type='button' value='add' title='add URL to the bookmarks' style='width:6%'
	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='width:6%'
	favorites="%favorites%"
	onclick='config.macros.miniBrowser.del(this.form.bookmarks,this.getAttribute("favorites"));'><!--
--><input type='button' value='edit' title='edit the bookmarks list' style='width:6%'
	favorites="%favorites%"
	onclick='story.displayTiddler(null,this.getAttribute("favorites"),2)'><!--
--></span><!--
--><span style='display:%shownav%'><!--
--><input type='button' value='&#x25C4;' title='view previous bookmark' style='width:3%'
	onclick='var b=document.getElementById("minibrowser_bookmarks_%id%");
		b.selectedIndex=Math.max(b.selectedIndex-1,0); b.onchange();'><!--
--><input name='nav' id='minibrowser_nav_%id%'
	type='button' value='N out of MM' title='enter a bookmark number' style='width:12%'
	onclick='var b=this.form.bookmarks;
		var i=prompt("Enter a bookmark number (1-"+b.length+")",b.selectedIndex+1);
		if (i && i<b.length) { b.selectedIndex=i-1; b.onchange(); }'><!--
--><input type='button' value='&#x25BA;' title='view next bookmark' style='width:3%'
	onclick='var b=document.getElementById("minibrowser_bookmarks_%id%");
		b.selectedIndex=Math.min(b.selectedIndex+1,b.length); b.onchange();'><!--
--></span><!--
-->%linebreak%<!--
--><select name='type' id='minibrowser_type_%id%' size='1' style='width:12%'
	onchange='var opt=this.options; for (var i=0; i<opt.length; i++)
		if (i==this.selectedIndex) opt[i].text=opt[i].text.replace(/\xa0\xa0/,"&radic;");
		else opt[i].text=opt[i].text.replace(/&radic;/,"\xa0\xa0");
		if (this.selectedIndex==0) opt[1].text=opt[1].text.replace(/\xa0\xa0/,"&radic;");'><!--
--><option value=''>type...</option><!--
--><option value=''>&radic; auto-detect</option><!--
--><option value='iframe'>&nbsp;&nbsp; web page</option><!--
--><option value='windows'>&nbsp;&nbsp; windows media</option><!--
--><option value='realone'>&nbsp;&nbsp; real one</option><!--
--><option value='quicktime'>&nbsp;&nbsp; quicktime</option><!--
--><option value='flash'>&nbsp;&nbsp; flash</option><!--
--><option value='image'>&nbsp;&nbsp; jpg/gif/png</option><!--
--></select><!--
--><input type='text' name='url' id='minibrowser_url_%id%' size='60' value='' style='width:%urlsize%'
	onfocus='this.select()'><!--
--><input type='submit' value='go' title='view URL' style='width:6%'><!--
--><input type='button' value='open' title='open a separate tab/window' style='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='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;'><!--
--><div id='minibrowser_resize_%id%' style='display:%hidecontrols%;float:right'><!--
--> size: <input type='text' name='w' size='3' value='' style=''
	onfocus='this.select()'><!--
-->x<input type='text' name='h' size='3' value='' style=''
	onfocus='this.select()'><!--
--> <input type='submit' value='set' style='width:5em'
	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='width:5em'
	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='width:5em'
	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>
!end
//}}}
***/
 
/***
|Name|MiniBrowserPlugin|
|Source|http://www.TiddlyTools.com/#MiniBrowserPlugin|
|Documentation|http://www.TiddlyTools.com/#MiniBrowserPluginInfo|
|Version|1.5.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.2|
|Type|plugin|
|Requires|PlayerPlugin (optional, recommended)|
|Description|embedded browser-in-browser with favorites lists and media support|
!!!!!Usage
<<<
{{{<<miniBrowser noplayer noedit expand hidecontrols URL TiddlerName TiddlerName TiddlerName...>>}}}
* ''noplayer'' (optional)<br>disables support for embedded media player (using [[PlayerPlugin]], if installed)
* ''noedit'' (optional)<br>hides bookmark //add//, //del//, and //edit// buttons
* ''expand'' (optional)<br>displays minibrowser controls on two lines instead of one for increased readability, especially when long titles or URLs are displayed.
* ''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>>
!!!!!Examples
>{{{<<miniBrowser>>}}}<br>{{smallform small{<<miniBrowser>>}}}
>{{{<<miniBrowser noedit>>}}}<br>{{smallform small{<<miniBrowser noedit>>}}}
>{{{<<miniBrowser expand>>}}}<br>{{smallform small{<<miniBrowser expand>>}}}
>{{{<<miniBrowser noedit expand>>}}}<br>{{smallform small{<<miniBrowser noedit expand>>}}}
>{{{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}<br>{{smallform small{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}
!!!!!Revisions
<<<
2009.08.29 [1.5.2] in load(), fixed 'noplayer' IFRAME output
2009.07.03 [1.5.1] added onclick handling to 'n of m' button.  also, if noedit mode, add line numbers to bookmarks droplist items
2009.06.08 [1.5.0] added optional 'noedit' mode to hide bookmark add/del/edit buttons.  Also, moved html def'n to section (saves space)
2008.09.30 [1.4.0] removed hard-coded fontsize.  Added 'expand' option (wider controls, displayed on two lines)
2008.09.16 [1.3.1] fixed getWikifiedData() when using IE (remove \r and multiple \n)
2008.08.12 [1.3.0] added support for wikifying content from favorites lists to enable use of forEachTiddler or inline script output to generate lists on the fly.
2008.08.06 [1.2.2] corrected size control buttons to use fixed width
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
<<<
!!!Derivative as a function $f'(x)$

(:graph({width:300,height:300,scales:[-2.5,2.5,-2.5,2.5]})
 dynamic.update = function() {
  py = f(px);
  h = .01;
  dy = f(px+h)-py;
  m = dy/h;
  dot([px,m],{marker:"o",label:"m",id:"m_id",pos:"n"});
  dot([px,m],{marker:"*",size:3,markerstroke: "red"})
  setOptions({stroke:"red"});
  if (m>=0) {
    polygon([[px-.5,py-.5*m],[px+.5,py+.5*m],[px+.5,py-.5*m]],{id:"tangent"});
    text([px+.5,py],"m="+m.toFixed(1),{pos:"e",id:"rise",style:"italic"});
    text([px,py-.5*m],"1",{pos:"s",id:"run2"});
  } else {
    polygon([[px-.5,py-.5*m],[px+.5,py+.5*m],[px-.5,py+.5*m]],{id:"tangent"});
    text([px-.5,py],"m="+m.toFixed(1),{pos:"w",id:"rise",style:"italic"});
    text([px,py+.5*m],"1",{pos:"s",id:"run"});
  };
  px = SVG.mouse[0];
 };

 fn = "-pow(x,3)+2*x"; /*change this if you like*/

 axes();
 setAction("mousemove",dynamic.update);
 eval("f = function(x) { with(Math) return "+fn+" }");
 plot(f);
 px = .5;
 dynamic.update()
:)
(:graph({width:300}) axes(); plot("sin(x)"); :)

(:graph({width:300,height:200,scales:[-3,3,-2,2]})
axes();
grid({dx:0.5,dy:0.5});
plot("(x-2)*(x-1)*x*(x+1)*(x+2)/2",{min:-2.5,max:2.5});
:)
$\diagup X\ind Y \tilde{A} \varnothing$

$A = \left(\begin{array}{c c c}
1-x & 0 & 0 \\ 0 & 1-x & 0 \\ 0 & 0 & 1-x \end{array}\right)$

$\sum a_i + \sum_{i=0}^{+\infty} b_i$

$f(x) = \left\{\begin{array}{l l}
x^2 \sin \frac1x & \textrm{if } x \ne 0, \\
0 & \textrm{if } x = 0 .
\end{array}\right.$

$\displaystyle{ \lim_{x\to\infty} f(x) = k \choose r + \frac ab \sum_{n=1}^{+\infty} a_n + \left\{ \frac{1}{13} \sum_{n=1}^{+\infty} b_n \right\} }$
Opera fires mousemove before mouseover (fixed -- back to switchTo in displayCoords)
Click to pause/restart animation
(:graph({width:600,height:300,scales:[-1.5,31,-0.05,0.3],coords:"none",borderwidth:1})
dynamic.bn=function(x){
return C(x+dynamic.r-1,x)*pow(1-dynamic.theta,x)*pow(dynamic.theta,dynamic.r);
}

dynamic.update = function() {
   if (dynamic.draw==1) {
    dynamic.r = max(1,floor(SVG.mouse[0]));
    dynamic.theta = max(0,min(1,5*SVG.mouse[1]));
    plot(dynamic.bn,{id:"bn2",min:0, max:31, points:31,marker:"ooo",size:10,markerstroke:"yellow",markerfill:"yellow",stroke:"none"});
   text([21,0.25],"$NB(r="+dynamic.r+",\\theta="+dynamic.theta.toFixed(2)+")$",{id:"param",fontsize:16,fontfill:"blue",pos:"E"});
   if(dynamic.theta>0) {
     dynamic.mean=dynamic.r/dynamic.theta-dynamic.r;
     line([dynamic.mean,-0.5],[dynamic.mean,3],{id:"mean",stroke:"red",strokewidth:2}); 
   }
  }
};

dynamic.click = function() {
  dynamic.draw*=-1;
}

axes({origin:[-1,0],dy:0.1,marker:">"});
setAction("mousemove",dynamic.update);
setAction("click",dynamic.click);
dynamic.draw=1;
:)
Click to pause/restart animation
(:graph({width:400,height:250,scales:[-4,4,-0.1,1],coords:"none",borderwidth:5,borderstroke:"orange"})
dynamic.update = function() {
  if (draw==1) {
      vmu = SVG.mouse[0]||0;
      vsigma2 = max(0.0001,SVG.mouse[1]||0.1)*10;
    plot("1/sqrt(2*PI*vsigma2)*exp(-1/vsigma2*pow(x-vmu,2))",{id:"pdf",points:100,strokewidth:2});
    dot([vmu,0],{id:"mean"});
    text([-3.8,0.9],"N("+vmu.toFixed(2)+","+vsigma2.toFixed(3)+")",{id:"param",pos:"E"});
  }
};

dynamic.click = function() {
  draw*=-1;
}

setAction("mousemove",dynamic.update);
setAction("mousedown",dynamic.click);
axes({dy:0.2,marker:">"});
vmu = 0;
vsigma2 = 1;
draw = 1;
dynamic.update();
:)
(:graph
dynamic.hello=function(evt){
alert("Hey, why are you clicking me?\nDo you have something against blue rectangles?");
return false;
}

rect([0,0],[2,1],{id:"box",fill:"blue"});
setAction("click",dynamic.hello,"box");
:)
|''Name''|PSTheme|
|''Description''|personal theme|

!Author Mode
|PageTemplate|##PageTemplate|
|ViewTemplate|##ViewTemplate|
|EditTemplate|##EditTemplate|
|StyleSheet|##StyleSheet|
|ColorPalette|ColorPalette|

!Read-Only Mode
|PageTemplateReadOnly|##PageTemplate|
|ViewTemplateReadOnly|##ViewTemplate|
|EditTemplateReadOnly|##EditTemplate|
|StyleSheetReadOnly|##StyleSheet|
|ColorPalette|ColorPalette|

!PageTemplate
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::Foreground]] [[ColorPalette::PrimaryMid]]'>
<div class="titles"><span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span></div>
<span class='topMenu' refresh='content' tiddler='TopMenu'></span>
</div>
</div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->

!ViewTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler more > < * fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->

!EditTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<div class='editor' macro='edit text'></div>
<!--}}}-->

!StyleSheet
[[StyleSheet]]
/*{{{*/
.HideSideBarButton {float:right;  font-size: 1em;} 

.center {text-align:center;}

body {
 font-family: "Bitstream Vera Sans",arial,sans-serif;
}

h1,h2,h3,h4,h5 {
 color: [[ColorPalette::Foreground]];
 border: none;
}

h1 {font-size:1.6em;}
h2 {font-size:1.35em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.8em;}

hr {
 border: 0px solid [[ColorPalette::PrimaryMid]];
 color: [[ColorPalette::PrimaryMid]];
 background-color: [[ColorPalette::PrimaryMid]];
}

.title {
 font-size:1.8em;
 border-bottom: 1px dotted [[ColorPalette::SecondaryDark]];
 padding-bottom: 0.1em;
 margin-bottom: 0.1em;
}

.subtitle {
 padding-top: 0.25em;
 margin-bottom: 0.25em;
 font-size: x-small
}

.editor input, .editor textarea {
 margin-bottom: 1px;
}

#siteTitle .tiddlyLinkExisting,
#siteTitle .tiddlyLinkNonExisting{
 font-weight: normal;
 font-style: normal;
}

.header {
 padding: 1.25em 0 0 0;
}

.header a {
 color: [[ColorPalette::Background]];
 padding: 0.25em 0.25em 0 0.25em;
}

.header .button {
 padding: 0;
 margin:0;
 border: none;
 font-weight: bold;
}

.header .externalLink {
 text-decoration: none;
}

.header a:hover {
 color:[[ColorPalette::Foreground]];
 background: [[ColorPalette::Background]];
}

.siteTitle {
 color: [[ColorPalette::SecondaryLight]];
 font-size: 2em;
 font-weight: bold;
 padding: 0 0 0 0.5em;
}

.siteSubtitle {
 color: [[ColorPalette::SecondaryLight]];
 font-weight: bold;
}

.titles {
 margin: 0.25em 0 0.5em 0
}

input {font-size: 100%;}

.txtOptionInput {width: 15em;}

#displayArea {margin: 1em 15.5em 0em 1em;}
/*#displayArea {margin:1em 15.5em 0em 12.5em;}*/

.topMenu {
 padding: 0 0 0 1em;
 font-size: 0.9em;
}

@media print {
body {background:#ffffff;}
#mainMenu, #sidebar, #messageArea, .tagging, .tagged, .subtitle, #pageFooter, .button, .header {display: none ! important;}
#displayArea {margin: 1em 0em 0em 0em !important;}
.tiddler {padding:0;}
noscript{ display:none;}
.title {color:#000;}
}
/*}}}*/
/***
|''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"
	});
*/
//}}}
http://www.math.ist.utl.pt/~psoares/MathSVG.html
/***
|Name|PlayerPlugin|
|Source|http://www.TiddlyTools.com/#PlayerPlugin|
|Version|1.1.4|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~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.PlayerPlugin= {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;"> \
	&nbsp; \
	%u% \
	&nbsp; \
	</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>';
//}}}
!A cardioid
(:graph({width:200,height:200,scales:[-1.2,2.2,-1.7,1.7],coords:"polar"})
dynamic.moveit = function() {
var angle = getAngle([0.5,0]);
var p = [0.5+cos(angle),sin(angle)];
var q = [cos(angle)*(1+cos(angle)),sin(angle)*(1+cos(angle))];
rotate("roll",angle,{center:[0.5,0],replace:true});
line(p,q,{id:"radius",marker:"*-*",size:10});
}

axes({dx:0.5,dy:0.5});
grid({dx:0.5,dy:3});
setAction("mousemove",dynamic.moveit);
circle([0.5,0],0.5);
circle([0.5,0],1);
setOptions({stroke:'red', strokewidth:2});
polarPlot("1+cos(x)");
setOptions({stroke:"green"});
circle([1.5,0],0.5,{id:"roll"});
line([1.5,0],[2,0],{id:"radius",marker:"*-*",markerstroke:"green",size:10});
:)

(:graph({width:200,height:200,scales:[-1.2,2.2,-1.7,1.7],coords:"polar"})
axes();
setOptions({stroke:'red'});
polarPlot("1+cos(x)");
:)
/***
|Name|PopupPreviewPlugin|
|Source|http://www.TiddlyTools.com/#PopupPreviewPlugin|
|Version|1.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|StickyPopupPlugin (optional, recommended)|
|Overrides|createTiddlyLink|
|Options|##Configuration|
|Description|popup a formatted preview of a linked tiddler's content|
This plugin adds a custom "shift-click" handler to all tiddler links (or images with tiddler links) to display a popup with a fully-formatted preview of the linked tiddler's content.
!!!!!Usage
<<<
When you click the mouse on a preview-enhanced tiddler link while holding the SHIFT key, a popup will be displayed, containing the fully-formatted content of the linked tiddler, in a restricted size, scrolling area.  Note that, while you can //scroll// this preview display to //view// its contents, clicking anywhere (even within the preview popup) will automatically dismiss the popup display, making interaction with the preview content impossible.  To actually interact with the content of a tiddler, you should open it in the normal fashion (i.e, by clicking the tiddler link //without// holding the SHIFT key).
<<<
!!!!!Configuration
<<<
<<option chkPopupPreviews>> enable shift-click popup previews
{{{usage: <<option chkPopupPreviews>>}}}

width of popup: <<option txtPopupPreviewWidth>> height of popup: <<option txtPopupPreviewHeight>>
//(width and height may be specified using any valid CSS units, e.g., "px", "em", "in", "cm", "%")//
{{{usage: <<option txtPopupPreviewWidth>> <<option txtPopupPreviewHeight>>}}}
<<<
!!!!!Revisions
<<<
2007.11.19 [1.0.0] fixed handling for imageLinks ('tiddlylink' attrib is on the *parentNode* of target image element)
2007.11.10 [0.5.0] alpha development - use with care
<<<
!!!!!Code
***/
//{{{
version.extensions.PopupPreviewPlugin= {major: 1, minor: 0, revision: 0, date: new Date(2007,11,19)};

if (config.options.chkPopupPreviews==undefined) config.options.chkPopupPreviews=true;
if (config.options.txtPopupPreviewWidth==undefined) config.options.txtPopupPreviewWidth="50%";
if (config.options.txtPopupPreviewHeight==undefined) config.options.txtPopupPreviewHeight="10em";

window.popupPreview_createTiddlyLink=window.createTiddlyLink;
window.createTiddlyLink=function()
{
	var btn=this.popupPreview_createTiddlyLink.apply(this,arguments);
	btn.onclick_save=btn.onclick;
	btn.onclick=function(e) {
		if (!e) var e=window.event; var theTarget=resolveTarget(e);
		if (!e.shiftKey || !config.options.chkPopupPreviews) 
			return this.onclick_save.apply(this,arguments); // perform normal click handling
		else { // show tiddler preview if enabled and SHIFT is pressed
			var tid=theTarget.getAttribute("tiddlylink");
			if (!tid) tid=theTarget.parentNode.getAttribute("tiddlylink"); // for "imageLink" elements
			var text=store.getTiddlerText(tid);
			if (text && text.length) {

				var popup = Popup.create(this,null,"sticky popup");
				popup.style.width=config.options.txtPopupPreviewWidth;
				popup.style.padding=".5em";

				var msg="%0 %1".format([tid,config.views.wikified.shadowModifier]);
				var tiddler=store.getTiddler(tid); if (tiddler) msg=tiddler.getSubtitle();
				wikify("@@display:block;font-size:80%;line-height:110%;"+msg+"@@",popup);

				var div=createTiddlyElement(popup,"DIV",null,"popupPreview viewer");
				div.style.overflow="auto"; 
				div.style.whiteSpace="normal";
				div.style[config.browser.isIE?'height':'maxHeight']=config.options.txtPopupPreviewHeight;
				wikify(text,div);

				Popup.show(popup,false);
			}
			e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); return false;
		}
	}
	return btn;
}
//}}}
/***
|Name|PreviewPlugin|
|Source|http://www.TiddlyTools.com/#PreviewPlugin|
|Documentation|http://www.TiddlyTools.com/#PreviewPluginInfo|
|Version|1.8.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|add key-by-key wikified preview to any textarea input field|
Provides key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content as you type input into a textarea (multi-line) edit field.
!!!!!Documentation
>see [[PreviewPluginInfo]]
!!!!!Configuration
<<<
Automatically freeze preview updates when a tiddler takes more than <<option txtPreviewAutoFreeze>> milliseconds to render.
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.11.18 [1.8.1] in config.commands.previewTiddler, changed alt command text to use character-based "psuedo-checkbox" instead of embedded html fragment
2007.09.27 [1.8.0] split TidIDE preview functionality into separate stand-alone plugin (see [[TidIDEPlugin]]).  
|please see [[TidIDEPluginInfo]] for additional revision details|
2006.04.15 [0.5.0] Initial ALPHA release. Converted from inline script.
<<<
!!!!!Code
***/
// // version info
//{{{
version.extensions.PreviewPlugin= {major: 1, minor: 8, revision: 1, date: new Date(2007,11,18)};
//}}}

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

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

// // toolbar definition
//{{{
config.commands.previewTiddler = {
	text: 'preview',
	tooltip: 'show key-by-key preview',
	text_alt: '\u221Apreview',
	handler: function(event,src,title) {
		var here=story.findContainingTiddler(src); if (!here) return;
		var elems=here.getElementsByTagName("span");
		for (var e=0; e<elems.length; e++) {
			if (elems[e].getAttribute("editid")) {
				var show=elems[e].style.display=="none";
				src.innerHTML=show?this.text_alt:this.text;
				elems[e].style.display=show?"block":"none";
				config.macros.preview.findContainingForm(elems[e]).freeze.checked=!show;
				if (show) config.macros.preview.render(elems[e].getAttribute("editid"),elems[e].id);
			}
		}
		return false;
	}
};
//}}}
/***
|Name|PreviewPluginInfo|
|Source|http://www.TiddlyTools.com/#PreviewPlugin|
|Documentation|http://www.TiddlyTools.com/#PreviewPluginInfo|
|Version|1.8.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for PreviewPlugin|
Provides key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content as you type input into a textarea (multi-line) edit field.
!!!!!Usage
<<<
Syntax: (in tiddler content)
{{{
<<preview hide fieldname height>>
}}}
//OR// (in [[EditTemplate]])
{{{
<span macro='preview hide fieldname height'></span>
}}}
where:
* 'hide' (optional)<br>is a keyword that causes the preview display to be initially hidden when created.  This is typically used in an [[EditTemplate]] definition, in conjunction with the 'previewTiddler' toolbar syntax (see below).
* fieldname (optional)<br>specifies the name of the tiddler field that is being previewed.  It corresponds to the fieldname specified in the {{{<span class='editor' macro='edit fieldname height'></span>}}} syntax used to define the textarea edit field, and is used to locate and access the source content that is to be previewed.  When omitted, the previewer will automatically associate itself with the last textarea control that precedes it in the rendered tiddler editor display.
* height (optional)<br>defines the total height of the previewer display (including the status line and controls), using CSS "em" (line height) measurements.  The default height value is "15em" (i.e., approximately 15 lines of standard-sized text)

In addition to the preview macro itself, you can place the following in your [[EditTemplate]] to add a tiddler toolbar command that enables you to toggle the preview display once it has been created:
{{{
<span class='toolbar' macro='toolbar previewTiddler'></span>
}}}
when clicked, this command will show/hide ALL preview controls that are displayed in the current tiddler.  Note that, when desired, you can also embed this toolbar command directly into a tiddler by entering the "{{{<<toolbar previewTiddler>>}}}" syntax in the tiddler source.
<<<
!!!!!Examples
<<<
in [[EditTemplate]]:
{{{
<div class='editor' macro='edit foobar 5'></div>
<div class='editor' macro='preview hide foobar 10'></div>
}}}
OR, embedded in tiddler content:
{{{
<<edit foobar 5>><<preview foobar 10>>
}}}
{{smallform{
<<edit foobar 5>><<preview foobar 10>>}}}
By default, the preview display is automatically rendered each time a key is typed into the tiddler content edit field.  As soon as changes are entered, they will be instantly visible within the preview display.  Unfortunately, the partial tiddler source definitions that occur //during// editing may somtimes cause rendering problems, and some exceptionally complex tiddlers make take an unusually long amount of time to completely render their content.   In such cases, key-by-key display updates are undesirable or impractical.

You can select the ''freeze'' checkbox to suspend automatic key-by-key preview display updates.  The preview display will not be re-rendered again until you press the ''refresh'' button or clear the 'freeze' checkbox.  The preview display will also automatically freeze whenever the //rendering time// exceeds a pre-determined time limit (see configuration section), specified in milliseconds.  Note: the ''actual elapsed time'' used to process and render any given content is reported in the preview "status bar" whenever that content is previewed.

In addition to a 'wikified' preview, the previewer display can show a ''DOM viewer'' and/or an ''HTML viewer'' that are also updated with each keystroke.  These text-based displays can be helpful while attempting to correct or enhance the formatting of tiddler content, especially when complex combinations of wiki-syntax produce unexpected or undesired results.
<<<
The following produces a graph with three dots all of size=4.
(:graph
axes();
dot([1,1]);
dot([2,1],{size:20,markerstroke:"red"});
dot([3,1],{size:4});
:)

The following produces a graph with three dots all of size=20.
(:graph
axes();
dot([1,1]);
dot([3,1],{size:4});
dot([2,1],{size:20});
:)

The following produces a graph with three dots all with the default of size=8.
(:graph
axes();
dot([3,1],{size:4});
dot([2,1],{size:20});
dot([1,1]);
:)

(:graph({pos:"inline"})
axes();
line([-4,2],[4,2],{marker:"**S",markerstroke:"red",stroke:"red"});
line([-4,1],[4,1],{marker:"**S"});
:)(:graph({pos:"inline"})
axes();
line([-4,2],[4,2],{marker:"**S"});
line([-4,1],[4,1],{marker:"**S",markerstroke:"red",stroke:"red"});
:)
This package provides a toolbar of interactive 'power tools' that you can use while editing a tiddler to quickly insert TiddlyWiki tiddler links, images, macros, etc. or common formatting sequences directly into tiddler content, as well as perform other functions (such as find/replace, sort, split, convert, etc.) that can be used to modify the current tiddler's source content in a variety of ways.

<<tiddler QuickEditToolbar with: show>>
!!!!!Installation:
<<<
Individual ~QuickEdit buttons are defined in separate tiddlers (e.g., [[QuickEdit_replace]]) that have also been //transcluded// into a single toolbar definition named [[QuickEditToolbar]].  You can edit this definition to add, remove, or rearrange the toolbar buttons to best suit your needs, and then embed the [[QuickEditToolbar]] tiddler into your document's [[EditTemplate]], like this:
{{{
<div macro='tiddler QuickEditToolbar'></div>
}}}
Next, in order to support some of the formatting 'shortcuts' provided by the toolbar, add a reference to the shortcuts CSS class definitions in your [[StyleSheet]]:
{{{
[[StyleSheetShortcuts]]
}}}
By default, the QuickEdit toolbar is hidden until you enable it by using the ''toggleQuickEdit'' command, which you can add to the ~EditToolbar definition in [[ToolbarCommands]]:
{{{
|EditToolbar|... toggleQuickEdit ...|
}}}
You can also toggle the ~QuickEdit toolbar display via a single checkbox option that can be added to [[SideBarOptions]] (or any other desired location):
{{{
<<option chkShowQuickEdit>> show QuickEdit toolbar
}}}
Note: You can 'hard-code' the ''chkShowQuickEdit'' setting, so that the toolbar will be //initially// displayed, by creating a tiddler (e.g., ConfigTweaks), tagged with <<tag systemConfig>>, containing:
{{{
config.options.chkShowQuickEdit=true;
}}}
Alternatively, if you want the toolbar to //always// be displayed, regardless of the option setting, you can add a special keyword, ''show'', to the [[EditTemplate]] syntax, like this:
{{{
<div macro='tiddler QuickEditToolbar with: show'></div>
}}}
<<<
/***
|Name|QuickEditPlugin|
|Source|http://www.TiddlyTools.com/#QuickEditPlugin|
|Documentation|http://www.TiddlyTools.com/#QuickEditPlugin|
|Version|2.4.3|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Support functions for ~QuickEdit package: styles, utility functions, and 'toggleQuickEdit' command|
!!!!!Revisions
<<<
2009.06.11 [2.4.3] added keyup() function to abbreviate listbox handling for CR and ESC
2009.05.07 [2.4.2] added processed() function to abbreviate event handler code
2008.09.07 [2.4.1] added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.05.17 [2.4.0] copied code from StickyPopupPlugin to remove dependency
2008.05.12 [2.3.0] added "toggleQuickEdit" command handler (replaces inline script command)
2008.01.11 [2.2.0] converted from inline script
2007.03.29 [1.0.0] initial release (as inline script)
<<<
!!!!!Code
***/
//{{{
version.extensions.QuickEditPlugin= {major: 2, minor: 4, revision: 3, date: new Date(2009,6,11)};

// SET STYLESHEET
setStylesheet("\
.quickEdit a { border:2px outset ButtonFace; padding:0px 3px !important; \
	-moz-border-radius:.5em; -webkit-border-radius:.5em; \
	-moz-appearance:button !important; -webkit-appearance:push-button !important; \
	background-color:ButtonFace; color:ButtonText !important;  \
	line-height:200%; font-weight:normal; } \
.quickEdit a:hover { border: 2px inset ButtonFace; background-color:ButtonFace; }\
", "quickEditStyles");

// REMOVE COOKIE
if (window.removeCookie===undefined) {
	window.removeCookie=function(name) {
		document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;'; 
	}
}

// UTILITY FUNCTIONS
config.quickEdit = {
	processed: function(ev) { ev=ev||window.event;
		ev.cancelBubble=true;
		if(ev.stopPropagation) ev.stopPropagation();
		return false;
	},
	keyup: function(ev){ var k=(ev||window.event).keyCode;
		if (k==13) this.onclick();
		if (k==27) Popup.remove();
	},
	getField: function(where) {
		var here=story.findContainingTiddler(where); if (!here) return null;
		var e=story.getTiddlerField(here.getAttribute("tiddler"),"text");
		if (e&&e.getAttribute("edit")=="text") return e;
		return null;
	},
	setSelection: function(where,newtext) {
		var e=this.getField(where); if (!e) return false;
		e.focus(); replaceSelection(e,newtext);
		return false;
	},
	wrapSelection: function(where,before,after) {
		var e=this.getField(where); if (!e) return false;
		e.focus(); replaceSelection(e,before+config.quickEdit.getSelection(e)+after);
		return false;
	},
	getSelection: function(e) {
		var seltext="";
		if (e&&e.setSelectionRange)
			seltext=e.value.substr(e.selectionStart,e.selectionEnd-e.selectionStart);
		else if (document.selection) {
			var range = document.selection.createRange();
			if (range.parentElement()==e) seltext=range.text
		}
		return seltext;
	},
	promptForFilename: 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.modeOpen);
				var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
				thispath.initWithPath(path);
				picker.displayDirectory=thispath;
				picker.defaultExtension='jpg';
				picker.defaultString=file;
				picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterImages);
				if (picker.show()!=nsIFilePicker.returnCancel)
					var result="file:///"+picker.file.persistentDescriptor.replace(/\\/g,'/');
			}
			catch(e) { alert('error during local file access: '+e.toString()) }
		}
		else { // IE
			try { // XP only
				var s = new ActiveXObject('UserAccounts.CommonDialog');
				s.Filter='All files|*.*|JPG files|*.jpg|GIF files|*.gif|PNG files|*.png|';
				s.FilterIndex=1; // default to JPG
				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;
	}
}
//}}}

//{{{
if (config.options.chkShowQuickEdit===undefined) config.options.chkShowQuickEdit=false;
config.commands.toggleQuickEdit = {
	hideReadOnly: true,
	getText: function() { return config.options.chkShowQuickEdit?'\u221Aquickedit':'quickedit'; },

	tooltip: 'show QuickEdit toolbar buttons',
	handler: function(event,src,title) {
		config.options.chkShowQuickEdit=!config.options.chkShowQuickEdit;
		config.macros.option.propagateOption("chkShowQuickEdit","checked", config.options.chkShowQuickEdit,"input");
		if (config.options.chkShowQuickEdit) saveOptionCookie("chkShowQuickEdit");
		else removeCookie("chkShowQuickEdit");
		src.innerHTML=config.commands.toggleQuickEdit.getText();
		story.forEachTiddler(function(t,e){if (story.isDirty(t)) refreshElements(e);});
		return false;
	}
};
//}}}

// // COPIED FROM [[StickyPopupPlugin]] TO ELIMINATE PLUGIN DEPENDENCY
//{{{
if (config.options.chkStickyPopups==undefined) config.options.chkStickyPopups=false;
Popup.stickyPopup_onDocumentClick = function(ev)
{
	// if click is in a sticky popup, ignore it so popup will remain visible
	var e = ev ? ev : window.event; var target = resolveTarget(e);
	var p=target; while (p) {
		if (hasClass(p,"popup") && (hasClass(p,"sticky")||config.options.chkStickyPopups)) break;
		else p=p.parentNode;
	}
	if (!p) // not in sticky popup (or sticky popups disabled)... use normal click handling
		Popup.onDocumentClick(ev);
	return true;
};
try{removeEvent(document,"click",Popup.onDocumentClick);}catch(e){};
try{addEvent(document,"click",Popup.stickyPopup_onDocumentClick);}catch(e){};
//}}}
/%
|Name|QuickEditToolbar|
|Source|http://www.TiddlyTools.com/#QuickEditToolbar|
|Version|2.4.3|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.2|
|Type|transclusion|
|Requires|QuickEditPlugin|
|Optional|QuickEdit_*|
|Description|format/insert TiddlyWiki content using toolbar buttons|

Usage:
* install [[QuickEditPlugin]] (runtime support functions)

* add the toolbar to [[EditTemplate]]:
	<div macro='tiddler QuickEditToolbar with: show'></div>

* 'show' (optional) forces the toolbar to always be displayed or,
  omit keyword and use <<option chkShowQuickEdit>> setting

* selected QuickEdit buttons can also be added individually to the
  regular tiddler toolbar by adding references directly in [[EditTemplate]]:
	<span class='toolbar' macro='tiddler QuickEdit_...'></span>

* see [[QuickEditPackage]] for additional installation options

%/<<tiddler HideTiddlerTags>>/%
%/{{hidden fine center quickEdit{
<<tiddler {{ // show/hide toolbar
	var here=story.findContainingTiddler(place); if (here) var tid=here.getAttribute('tiddler');
	var show='$1'!='$'+'1'||config.options.chkShowQuickEdit||tid=='QuickEditToolbar'; 
	place.style.display=show?'block':'none';
'';}}>>/%

TOOLBAR DEFINITION - add, remove, or re-order items as desired:
= = = = = = = = = =
%/<<tiddler QuickEdit_replace>>/%
%/<<tiddler QuickEdit_split>>/%
%/<<tiddler QuickEdit_sort>>/%
%/<<tiddler QuickEdit_convert>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_link>>/%
%/<<tiddler QuickEdit_insert>>/%
%/<<tiddler QuickEdit_macro>>/%
%/<<tiddler QuickEdit_image>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_format>>/%
%/<<tiddler QuickEdit_align>>/%
%/<<tiddler QuickEdit_color>>/%
%/<<tiddler QuickEdit_font>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_custom>>/%
%/<html>&nbsp;<span class="tiddlyLink" macro='toolbar previewTiddler'></span></html>/%
%/}}}
/%
|Name|QuickEdit_align|
|Source|http://www.TiddlyTools.com/#QuickEdit_align|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - text alignment|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="align text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select text alignment...','');
	s.options[s.length]=new Option('left','left');
	s.options[s.length-1].title='{{left{...}}}';
	s.options[s.length]=new Option('center','center');
	s.options[s.length-1].title='{{center{...}}}';
	s.options[s.length]=new Option('right','right');
	s.options[s.length-1].title='{{right{...}}}';
	s.options[s.length]=new Option('justify','justify');
	s.options[s.length-1].title='{{justify{...}}}';
	s.options[s.length]=new Option('float left','floatleft');
	s.options[s.length-1].title='{{floatleft{...}}}';
	s.options[s.length]=new Option('float right','floatright');
	s.options[s.length-1].title='{{floatright{...}}}';
	s.size=s.length;
	s.onclick=function(){ if (!this.value.length) return;
		config.quickEdit.wrapSelection(this.button,'{{'+this.value+'{','}}}');
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>align</a></html>
/%
|Name|QuickEdit_color|
|Source|http://www.TiddlyTools.com/#QuickEdit_color|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - text/background color|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="text/background color - @@color:#RGB;background-color:#RGB;...@@"
onclick="var p=Popup.create(this,null,'popup sticky smallform'); if (!p) return false;
 	p.style.padding='2px';
	function hex(d) { return '0123456789ABCDEF'.substr(d,1); }
	var fg=createTiddlyElement(p,'select'); fg.button=this;
	fg.style.width='12em';
	fg.options[0]=new Option('text color...','');
	fg.options[1]=new Option('\xa0 or enter a value','_ask');
	fg.options[2]=new Option('\xa0 or use default color','');
	for (var r=0;r<16;r+=3) for (var g=0;g<16;g+=3) for (var b=0;b<16;b+=3) {
		var label=hex(r)+hex(g)+hex(b);
		fg.options[fg.length]=new Option(label,'#'+label);
		fg.options[fg.length-1].style.color='#'+label;
	}
	fg.onchange=function(){ var val=this.value;
		if (val=='_ask') { val=prompt('Enter a CSS color value');
		if (!val||!val.length) return false; }
		this.options[0].value=val; this.options[0].text=val.length?'text: '+val:'text color...';
		var bg=this.nextSibling;
		for (var i=3;i<bg.options.length;i++) bg.options[i].style.color=val;
		var preview=this.nextSibling.nextSibling.nextSibling;
		var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
		if (!t.length) t='~AaBbCcDdEeFfGgHhIiJj 1234567890';
		var fg=this.value; if (fg.length) fg='color:'+fg+';';
		var bg=this.nextSibling.value; if (bg.length) bg='background-color:'+bg+';';
		if (fg.length||bg.length) t='@@'+fg+bg+t+'@@';
		removeChildren(preview); wikify(t,preview);
		this.selectedIndex=0; return false;
	};
	var bg=createTiddlyElement(p,'select'); bg.button=this;
	bg.style.width='12em';
	bg.options[0]=new Option('background color...','');
	bg.options[1]=new Option('\xa0 or enter a value','_ask');
	bg.options[2]=new Option('\xa0 or use default color','');
	for (var r=0;r<16;r+=3) for (var g=0;g<16;g+=3) for (var b=0;b<16;b+=3) {
		var label=hex(15-r)+hex(15-g)+hex(15-b);
		bg.options[bg.length]=new Option(label,'#'+label);
		bg.options[bg.length-1].style.backgroundColor='#'+label;
	}
	bg.onchange=function(){ var val=this.value;
		if (val=='_ask') { val=prompt('Enter a CSS color value');
		if (!val||!val.length) return false; }
		this.options[0].value=val;
		this.options[0].text=val.length?'background: '+val:'background color...';
		var fg=this.previousSibling;
		for (var i=3;i<fg.options.length;i++) fg.options[i].style.backgroundColor=val;
		var preview=this.nextSibling.nextSibling;
		var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
		if (!t.length) t='~AaBbCcDdEeFfGgHhIiJj 1234567890';
		var fg=this.previousSibling.value; if (fg.length) fg='color:'+fg+';';
		var bg=this.value; if (bg.length) bg='background-color:'+bg+';';
		if (fg.length||bg.length) t='@@'+fg+bg+t+'@@';
		removeChildren(preview); wikify(t,preview);
		this.selectedIndex=0; return false;
	};
	var b=createTiddlyElement(p,'input',null,null,null,{type:'button'}); b.button=this;
	b.value='ok'; b.style.width='4em';
	b.onclick=function() {
		var fg=this.previousSibling.previousSibling.value; if (fg.length) fg='color:'+fg+';';
		var bg=this.previousSibling.value; if (bg.length) bg='background-color:'+bg+';';
		var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
		if (fg.length||bg.length) config.quickEdit.setSelection(this.button,'@@'+fg+bg+t+'@@');
		Popup.remove(); return false;
	};
	var preview=createTiddlyElement(p,'div',null,'viewer'); var s=preview.style;
	s.border='1px solid'; s.margin='2px'; s.width='24em'; s.padding='3px'; s.MozBorderRadius='3px';
	s.overflow='hidden'; s.textAlign='center'; s.whiteSpace='normal';
	var t=config.quickEdit.getSelection(config.quickEdit.getField(this));
	wikify(t.length?t:'~AaBbCcDdEeFfGgHhIiJj 1234567890',preview);
	Popup.show();
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>color</a></html>
/%
|Name|QuickEdit_convert|
|Source|http://www.TiddlyTools.com/#QuickEdit_convert|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - convert between comma/tab-separated and TW table format|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="convert between comma/tab-separated and TW table format"
onclick="var e=config.quickEdit.getField(this);
	if (e) e.focus(); var txt=config.quickEdit.getSelection(e);
	if (txt.indexOf(',')+txt.indexOf('\t')+txt.indexOf('|')==-3) {
		alert('Please select text containing tabs, commas, or TiddlyWiki table syntax.');
		return false;
	}
	var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a converter...','');
	if (txt.indexOf(',')!=-1) {
		s.options[s.length]=new Option('commas -> table','commasToTable');
		s.options[s.length]=new Option('commas -> tabs','commasToTabs');
	}
	if (txt.indexOf('\t')!=-1) {
		s.options[s.length]=new Option('tabs -> table','tabsToTable');
		s.options[s.length]=new Option('tabs -> commas','tabsToCommas');
	}
	if (txt.indexOf('|')!=-1) {
		s.options[s.length]=new Option('table -> tabs','tableToTabs');
		s.options[s.length]=new Option('table -> commas','tableToCommas');
	}
	s.size=s.length;
	s.onclick=function(){ if (!this.value.length) return;
	        var e=config.quickEdit.getField(this.button); if (!e) return false;
		e.focus(); var txt=config.quickEdit.getSelection(e);
		switch(this.value) {
			case 'tabsToTable':
				txt=txt.replace(/\t/g,'|').replace(/^|$/g,'|');
				txt=txt.replace(/\n/g,'|\n|').replace(/^\|$/g,'');
				break;
			case 'tableToTabs':
				txt=txt.replace(/\t/g,' ').replace(/\|/g,'\t');
				txt=txt.replace(/^\t/g,'').replace(/\t$/g,'');
				txt=txt.replace(/\n\t/g,'\n').replace(/\t\n/g,'\n');
				break;
			case 'commasToTable':
				txt=txt.replace(/,/g,'|').replace(/^|$/g,'|');
				txt=txt.replace(/\n/g,'|\n|').replace(/^\|$/g,''); 
				break;
			case 'tableToCommas':
				txt=txt.replace(/,/g,' ').replace(/\|/g,',');
				txt=txt.replace(/^,/g,'').replace(/,$/g,''); 
				txt=txt.replace(/\n,/g,'\n').replace(/,\n/g,'\n'); 
				break;
			case 'tabsToCommas':
				txt=txt.replace(/\t/g,',');
				break;
			case 'commasToTabs':
				txt=txt.replace(/,/g,'\t');
				break;
		}
		replaceSelection(e,txt);
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>convert</a></html>
/%
|Name|QuickEdit_custom|
|Source|http://www.TiddlyTools.com/#QuickEdit_custom|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - custom defined formats|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

!help
Reminders:

Custom formats are stored as an "HR-separated list" in [[QuickEdit_customList]], where the first line of each list item is the text 'label' to show in the droplist, followed by one or more lines of wiki content to be inserted into the tiddler source.

Substitution markers can be used to dynamically insert values into the formatted output: $1 inserts the tiddler editor's current selected text. $[[message|default value]] interactively prompts for a value to be inserted. $[[message|$1]] uses the selected text as the default value. $[[message|{{javascript}}]] calculates the default value using javascript code.
!end help

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" title="custom defined formats"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a custom format...','');
	var items=store.getTiddlerText('QuickEdit_customList','').split('\n----\n');
	for (var i=0; i<items.length; i++) {
		if (!items[i].length) continue; var lines=items[i].split('\n');
		var label=lines.shift(); var val=lines.join('\n');
		s.options[s.length]=new Option(label,val); s.options[s.length-1].title=val;
	}
	s.options[s.length]=new Option('[Edit custom formats...]','_edit');
	s.options[s.length-1].title='add/change custom format definitions...';
	s.size=Math.min(s.length,15);
	s.onclick=function(){ if (!this.value.length) return;
		if (this.value=='_edit') {
			alert(store.getTiddlerText('QuickEdit_custom##help'));
			story.displayTiddler(story.findContainingTiddler(this.button),
				'QuickEdit_customList',DEFAULT_EDIT_TEMPLATE);
		} else {
		        var e=config.quickEdit.getField(this.button); if (!e) return false;
			e.focus(); var txt=config.quickEdit.getSelection(e);
			replaceSelection(e, this.value.replace(/\$\x31/g,txt)
				.replace(/\$\[\[[^\]]+\]\]/g, function(t){
					x=t.substr(3,t.length-5).split('|');
					var msg=x[0]; var def=x[1]||'';
					if (def.startsWith('{{')) {
						try{def=eval(def.substr(2,def.length-4))} catch(ex){showException(ex)}
					}
					return prompt(msg,def)||'';
				})
			);
		}
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>custom</a></html>
timestamp
$[[enter a date|{{new Date().formatString('DDD, MMM DDth, YYYY hh12:0mm:0ssam')}}]]
----
scrollbox
@@display:block;height:10em;overflow:auto;$[[enter scrolling content|$1]]@@@@display:block;text-align:right;^^scroll for more...^^@@
----
nested slider
+++[$1]<<tiddler $1>>===
----
big red
@@font-size:36pt;color:red;$1@@
----
/%
|Name|QuickEdit_font|
|Source|http://www.TiddlyTools.com/#QuickEdit_font|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - select font family|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="set font-family CSS attribute - @@font-family:facename;...@@"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a font family...','');
	var fonts=store.getTiddlerText('QuickEdit_fontList','').split('\n');
	for (var i=0; i<fonts.length; i++) {
		if (!fonts[i].length) continue;
		s.options[s.length]=new Option(fonts[i],fonts[i]);
		s.options[s.length-1].style.fontFamily=fonts[i];
	}
	s.options[s.length]=new Option('[Edit font list...]','_edit');
	s.options[s.length-1].title='enter fonts, one per line...';
	s.size=Math.min(s.length,15);
	s.onclick=function(){
		if (this.value=='_edit')
			story.displayTiddler(story.findContainingTiddler(this.button),'QuickEdit_fontList',DEFAULT_EDIT_TEMPLATE);			
		else
			config.quickEdit.wrapSelection(this.button,'@@font-family:\x22'+this.value+'\x22;','@@');
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>font</a></html>
Arial,helvetica,sans-serif
Times New Roman,times,serif
Courier,monospaced
/%
|Name|QuickEdit_format|
|Source|http://www.TiddlyTools.com/#QuickEdit_format|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - basic text formats, headings, blockquotes, etc.|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="plain text (remove ALL formatting)" accesskey="P" 
onclick="var e=config.quickEdit.getField(this); if (e) e.focus(); var txt=config.quickEdit.getSelection(e);
	config.quickEdit.setSelection(e,wikifyPlainText(txt)); return false;"
>&nbsp;~&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="''bold''" accesskey="B"
onclick="config.quickEdit.wrapSelection(this,'\x27\x27','\x27\x27'); return false;"
>&nbsp;B&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="//italics//" accesskey="I" 
onclick="config.quickEdit.wrapSelection(this,'//','//'); return false;"
>&nbsp;I&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="__underline__" accesskey="U" 
onclick="config.quickEdit.wrapSelection(this,'__','__'); return false;"
>&nbsp;U&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="--strikethrough--" accesskey="S" 
onclick="config.quickEdit.wrapSelection(this,'--','--'); return false;"
>&nbsp;S&nbsp;</a></html>/%

%/ &nbsp;/%  SPACER

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="format text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select text format...','');
	s.options[s.length]=new Option('CSS class wrapper','{{$1{,}}},Enter a CSS classname');
	s.options[s.length-1].title='CSS class wrapper - {{classname classname etc{...}}}';
	s.options[s.length]=new Option('inline CSS styles','@@$1,@@,Enter CSS (attribute:value;attribute:value;...;)');
	s.options[s.length-1].title='inline CSS styles - @@attr:value;attr:value;...@@';
	s.options[s.length]=new Option('heading 1','\n!,\n');
	s.options[s.length-1].title='H1 heading - !';
	s.options[s.length]=new Option('heading 2','\n!!,\n');
	s.options[s.length-1].title='H2 heading - !!';
	s.options[s.length]=new Option('heading 3','\n!!!,\n');
	s.options[s.length-1].title='H3 heading - !!!';
	s.options[s.length]=new Option('heading 4','\n!!!!,\n');
	s.options[s.length-1].title='H4 heading - !!!!';
	s.options[s.length]=new Option('heading 5','\n!!!!!,\n');
	s.options[s.length-1].title='H5 heading - !!!!!';
	s.options[s.length]=new Option('blockquote','\n\<\<\<\n,\n\<\<\<\n');
	s.options[s.length-1].title='indented blockquote - \<\<\<';
	s.options[s.length]=new Option('monospaced','{{{,}}}');
	s.options[s.length-1].title='inline monospaced text - {{{...}}}';
	s.options[s.length]=new Option('plain text','\n{{{\n,\n}}}\n');
	s.options[s.length-1].title='multi-line monospaced text box - {{{...}}}';
	s.options[s.length]=new Option('superscript','^^,^^');
	s.options[s.length-1].title='^^superscript^^';
	s.options[s.length]=new Option('subscript','~~,~~');
	s.options[s.length-1].title='~~subscript~~';
	s.options[s.length]=new Option('HTML','<html>,<\x2fhtml>');
	s.options[s.length-1].title='HTML syntax - <html>...<\x2fhtml>';
	s.options[s.length]=new Option('comment','/%,%/');
	s.options[s.length-1].title='comment (hidden content) - /%...%/';
	s.size=s.length;
	s.onclick=function(){ if (!this.value.length) return;
		var parts=this.value.split(',');
		var prefix=parts[0]; var suffix=parts[1]; var ask=parts[2];
		if (ask) {
			var val=prompt(ask); if (!val) { Popup.remove(); return false; }
			prefix=prefix.replace(/\$1/g,val); suffix=suffix.replace(/\$1/g,val);
		}
		config.quickEdit.wrapSelection(this.button,prefix,suffix);
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>format</a></html>
/%
|Name|QuickEdit_image|
|Source|http://www.TiddlyTools.com/#QuickEdit_image|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - embed an image|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
	title="embed an image (jpg/gif/png) - [img[tooltip|URL]] or [img[tooltip|path/to/file.ext]]"
	onclick="var fn=config.quickEdit.promptForFilename(
		'Enter/select an image file',getLocalPath(document.location.href),'');
	if (!fn) return false;  /* cancelled by user */
	var h=document.location.href; var p=decodeURIComponent(h.substr(0,h.lastIndexOf('/')+1));
	if (fn.startsWith(p)) fn=fn.substr(p.length); /* use RELATIVE path/filename.ext */
	var tip=prompt('Enter a tooltip for this image',''); if (!tip) tip=''; else tip+='|';
	return config.quickEdit.setSelection(this,'[img['+tip+fn+']]');"
>image</a></html>
/%
|Name|QuickEdit_insert|
|Source|http://www.TiddlyTools.com/#QuickEdit_insert|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - insert content from another tiddler or external file|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="insert content from another tiddler or external file"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';

	var s2=createTiddlyElement(p,'select'); s2.title='filter by tag';
	s2.options[0]=new Option('filter by tag...','');
	s2.options[s2.length]=new Option('[all tiddlers]','');
	var tags=store.getTags();
	for (var t=0; t<tags.length; t++) s2.options[s2.length]=new Option(tags[t][0],tags[t][0]);
	s2.onchange=function(){
		var tag=this.value;
		var tids=tag.length?store.reverseLookup('tags',tag,true):store.reverseLookup('tags','excludeLists');
		var list=this.nextSibling.nextSibling;
		while (list.length) list.options[0]=null;
		var prompt='select a tiddler or file...';
		if (tag.length) prompt='select a tagged tiddler ['+tids.length+' matches]...';
		list.options[0]=new Option(prompt,'');
		if (!tag.length) list.options[list.length]=new Option('[browse for file...]','_file');
		for (var t=0; t<tids.length; t++) {
			list.options[list.length]=new Option(tids[t].title,tids[t].title);
			list.options[list.length-1].title=tids[t].getSubtitle();
		}
		list.size=Math.min(list.length,10);
		list.selectedIndex=0; list.focus();
		this.style.width=list.offsetWidth+'px';
		if (!tag.length) this.selectedIndex=0;
	};
	createTiddlyElement(p,'br');

	var s=createTiddlyElement(p,'select'); s.button=this;
	s.title='select a tiddler or file';
	s.options[0]=new Option('select a tiddler or file...','');
	s.options[s.length]=new Option('[browse for file...]','_file');
	var tids=store.reverseLookup('tags','excludeLists');
	for (var t=0; t<tids.length; t++) {
		s.options[s.length]=new Option(tids[t].title,tids[t].title);
		s.options[s.length-1].title=tids[t].getSubtitle();
	}
	s.size=Math.min(s.length,10);
	s.onclick=function(){ if (!this.value.length) return false;
		if (this.value=='_file') {
			var fn=config.quickEdit.promptForFilename(
				'Enter/select a text file',getLocalPath(document.location.href),'');
			if (!fn) return false; /* cancelled by user */
			var txt=loadFile(getLocalPath(fn));
			if (!txt) { alert('Error: unable to read contents from \0027'+fn+'\0027'); return; }
		}
		else var txt=store.getTiddlerText(this.value);
		if (!txt) {
			displayMessage(this.value+' not found');
			this.selectedIndex=0; this.focus();
			return false;
		}
		config.quickEdit.setSelection(this.button,txt);
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s2.style.width=s.offsetWidth+'px';
	s.focus();
	return config.quickEdit.processed(event);"
>insert</a></html>
/%
|Name|QuickEdit_link|
|Source|http://www.TiddlyTools.com/#QuickEdit_link|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - link to tiddler or external file|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="add a link to a tiddler or external file - [[link text|TiddlerName]]"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';

	var s2=createTiddlyElement(p,'select'); s2.title='filter by tag';
	s2.options[0]=new Option('filter by tag...','');
	s2.options[s2.length]=new Option('[all tiddlers]','');
	var tags=store.getTags();
	for (var t=0; t<tags.length; t++) s2.options[s2.length]=new Option(tags[t][0],tags[t][0]);
	s2.onchange=function(){
		var tag=this.value;
		var tids=tag.length?store.reverseLookup('tags',tag,true):store.reverseLookup('tags','excludeLists');
		var list=this.nextSibling.nextSibling;
		while (list.length) list.options[0]=null;
		var prompt='select a tiddler or file...';
		if (tag.length) prompt='select a tagged tiddler ['+tids.length+' matches]...';
		list.options[0]=new Option(prompt,'');
		if (!tag.length) list.options[list.length]=new Option('[browse for file...]','_file');
		for (var t=0; t<tids.length; t++) {
			list.options[list.length]=new Option(tids[t].title,tids[t].title);
			list.options[list.length-1].title=tids[t].getSubtitle();
		}
		list.size=Math.min(list.length,10);
		list.selectedIndex=0; list.focus();
		this.style.width=list.offsetWidth+'px';
		if (!tag.length) this.selectedIndex=0;
	};
	createTiddlyElement(p,'br');

	var s=createTiddlyElement(p,'select'); s.button=this;
	s.title='select a tiddler or file';
	s.options[0]=new Option('select a tiddler or file...','');
	s.options[s.length]=new Option('[browse for file...]','_file');
	var tids=store.reverseLookup('tags','excludeLists');
	for (var t=0; t<tids.length; t++) {
		s.options[s.length]=new Option(tids[t].title,tids[t].title);
		s.options[s.length-1].title=tids[t].getSubtitle();
	}
	s.size=Math.min(s.length,10);
	s.onclick=function(){ if (!this.value.length) return false;
		var title=this.value; var txt=title;
		if (title=='_file') {
			title=config.quickEdit.promptForFilename('Select a file',
				getLocalPath(document.location.href),'');
			if (!title) { this.selectedIndex=0; this.focus(); return false; }
			var txt=title.substr(title.lastIndexOf('/')+1);
		}
		var txt=prompt('Enter the text to display for this link',txt);
		if (!txt) { this.selectedIndex=0; this.focus(); return false; }
		config.quickEdit.setSelection(this.button,'[['+txt+'|'+title+']]');
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s2.style.width=s.offsetWidth+'px';
	s.focus();
	return config.quickEdit.processed(event);"
>link</a></html>
/%
|Name|QuickEdit_macro|
|Source|http://www.TiddlyTools.com/#QuickEdit_macro|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - embed a macro with 'guide text'|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

Note:
Optional 'guideText' can be used to add suggested defaults/placeholders for specific macro parameters.
Add guideText to your own plugin-defined macros using:
	config.macros.macroName.guideText='guide text goes here';

%/<<tiddler {{
	/* define guide text for a few common TW core macros */
	config.macros.edit.guideText='fieldname #rows';
	config.macros.view.guideText='fieldname (link,wikified,date) format';
	config.macros.slider.guideText='cookie TiddlerName label tooltip';
	config.macros.option.guideText='(txtCookieName,chkCookieName)';
	config.macros.tiddler.guideText='TiddlerName with: params...';
	''; /* must return blank to suppress output */ }}>>/%

%/<html><hide linebreaks><a href='javascript:;' class='tiddlyLink' tabindex='-1' 
title='add a macro - \<\<macroName ...\>\>'
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a macro...','');
	var macros=[]; for (var m in config.macros) if (config.macros[m].handler) macros.push(m); macros.sort();
	for (var i=0; i<macros.length; i++) { var m=macros[i];
		var help=config.macros[m].guideText; if (!help) help=''; else help=' '+help;
		s.options[s.length]=new Option(m,m+help);
		s.options[s.length-1].title='\<\<'+m+help+'\>\>';
	}
	s.size=Math.min(s.length,15);
	s.onclick=function(){ if (!this.value.length) return;
		config.quickEdit.setSelection(this.button,'\<\<'+this.value+'\>\>');
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>macro</a></html>
/%
|Name|QuickEdit_replace|
|Source|http://www.TiddlyTools.com/#QuickEdit_replace|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - find/replace selected text with replacement text|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="find/replace selected text with replacement text"
onclick="var here=story.findContainingTiddler(this); if (!here) return false;
	var e=config.quickEdit.getField(here);
	var s=config.quickEdit.getSelection(e); 
	var p=Popup.create(this,null,'popup sticky smallform'); if (!p) return false;
	var t=createTiddlyElement(p,'input'); t.onfocus=function(){this.select()};
	t.value=s.length?s:'enter target text';
	var r=createTiddlyElement(p,'input'); r.onfocus=function(){this.select()};
	r.value='enter replacement text';
	var tid=here.getAttribute('tiddler');
	var b=createTiddlyElement(p,'button',null,null,'?',{tid:tid});
	b.style.width='2em';
	b.title='FIND/FIND NEXT target text';
	b.onclick=function(ev) { /* FIND */
		var e=story.getTiddlerField(this.getAttribute('tid'),'text');
		if (!e||e.getAttribute('edit')!='text') return;
		var t=this.previousSibling.previousSibling;
		e.focus();
		if (e.setSelectionRange) { /* MOZ */
			var newstart=e.value.indexOf(t.value,e.selectionStart+1);
			if (newstart==-1) newstart=e.value.indexOf(t.value); /* wrap around */
			if (newstart==-1) { alert('\u0022'+t.value+'\u0022 not found'); t.focus(); return; }
			e.setSelectionRange(newstart,newstart+t.value.length);
			var linecount=e.value.split('\n').length;
			var thisline=e.value.substr(0,e.selectionStart).split('\n').length;
			e.scrollTop=Math.floor((thisline-1-e.rows/2)*e.scrollHeight/linecount);
		} else if (document.selection) { /* IE */
			var range=document.selection.createRange();
			if(range.parentElement()==e) {
				range.collapse(false);
				var found=false; try{found=range.findText(t.value,e.value.length,4)}catch(e){}
				if (found) range.select();
				else { alert('\u0022'+t.value+'\u0022 not found'); t.focus(); }
			}
		}
	};
	b=createTiddlyElement(p,'button',null,null,'=',{tid:tid});
	b.style.width='2em';
	b.title='REPLACE selected text';
	b.onclick=function(ev) { /* REPLACE */
		var e=story.getTiddlerField(this.getAttribute('tid'),'text');
		if (!e||e.getAttribute('edit')!='text') return;
		var t=this.previousSibling.previousSibling.previousSibling;
		var r=this.previousSibling.previousSibling;
		if (   (e.selectionStart!==undefined && e.selectionEnd==e.selectionStart)
		    || (document.selection && document.selection.createRange().text==''))
			this.previousSibling.click(); /* no selection... do FIND first */
		if (   (e.selectionStart!==undefined && e.selectionEnd==e.selectionStart)
		    || (document.selection && document.selection.createRange().text==''))
			{ t.focus(); return; } /* still no selection... goto target input */
		e.focus(); replaceSelection(e,r.value);
	};
	b=createTiddlyElement(p,'button',null,null,'+',{tid:tid});
	b.style.width='2em';
	b.title='REPLACE selected text AND FIND NEXT target text';
	b.onclick=function(ev) { /* REPLACE and FIND NEXT */
		this.previousSibling.click();
		this.previousSibling.previousSibling.click();
	};
	b=createTiddlyElement(p,'button',null,null,'!',{tid:tid});
	b.style.width='2em';
	b.title='REPLACE ALL occurrences of target text';
	b.onclick=function(ev) { /* REPLACE ALL */
		var e=story.getTiddlerField(this.getAttribute('tid'),'text');
		if (!e||e.getAttribute('edit')!='text') return;
		var t=this.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
		var r=this.previousSibling.previousSibling.previousSibling.previousSibling;
		if (!t.value.length) { alert('Please enter the target text'); t.focus(); return; }
		var m='This will replace all occurences of:\n\n';
		m+='\''+t.value+'\'\n\nwith:\n\n\''+r.value+'\'\n\nAre you sure?';
		if (!confirm(m)) { r.focus(); r.select(); return; }
		e.value=e.value.replace(new RegExp(t.value.escapeRegExp(),'gm'),r.value);
		e.focus(); e.select(); Popup.remove();
	};
	Popup.show();
	if (!s.length) {t.focus();t.select()} else {r.focus();r.select()}
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>replace</a></html>
/%
|Name|QuickEdit_sort|
|Source|http://www.TiddlyTools.com/#QuickEdit_sort|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - sort lines of text|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="sort lines of text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select sort order...','');
	s.options[s.length]=new Option('ascending','A');
	s.options[s.length-1].title='ascending';
	s.options[s.length]=new Option('descending','D');
	s.options[s.length-1].title='descending';
	s.size=s.length;
	s.onclick=function(){ if (!this.value.length) return;
		var e=config.quickEdit.getField(this.button); if (!e) return false;
		var lines=config.quickEdit.getSelection(e).split('\n').sort();
		if (this.value=='D') lines=lines.reverse();
		replaceSelection(e,lines.join('\n'));
		e.focus();
		Popup.remove(); return false;
	};
	s.onkeyup=config.quickEdit.keyup;
	Popup.show();
	s.focus();
	return config.quickEdit.processed(event);"
>sort</a></html>
/%
|Name|QuickEdit_split|
|Source|http://www.TiddlyTools.com/#QuickEdit_split|
|Version|2.4.3|
|Author|Eric Shulman|
|License|see http://www.TiddlyTools.com/#QuickEditPlugin|
|Type|html|
|Requires|QuickEditPlugin|
|Description|quickedit - move selection to new tiddler and insert link, embedded tiddler, or slider|

Usage: see  http://www.TiddlyTools.com/#QuickEditToolbar

Based on ideas originally developed by YannPerrin
(http://yann.perrin.googlepages.com/twkd.html#easySlicer)

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="move selection to new tiddler and insert link, embedded tiddler, or slider"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	p.style.whiteSpace='nowrap';
	var i=createTiddlyElement(p,'input');
	i.defaultValue='Enter a new tiddler title';
	i.onfocus=function(){this.select()};
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select type...','');
	s.options[0].title='select split type';
	s.options[1]=new Option('link','link');
	s.options[1].title='replace with [[TiddlerName]]';
	s.options[2]=new Option('embed','embed');
	s.options[2].title='replace with \<\<tiddler TiddlerName\>\>';
	s.options[3]=new Option('slider','slider');
	s.options[3].title='replace with \<\<slider \u0022\u0022 [[TiddlerName]] [[label]] [[tooltip]]\>\>';
	s.onchange=function(){
		if (s.previousSibling.value==s.previousSibling.defaultValue)
			{ alert('A tiddler title is required'); s.selectedIndex=0; s.previousSibling.focus(); return false; }
		var tid=s.previousSibling.value;
		if (store.tiddlerExists(tid) && !confirm(config.messages.overwriteWarning.format([tid])))
			{ s.previousSibling.focus(); return false; }
		switch(s.value) {
			case 'link':
				var newtxt='[['+tid+']]';
				break;
			case 'embed':
				var newtxt='\<\<tiddler [['+tid+']]\>\>';
				break;
			case 'slider':
				var label=prompt('Enter a slider label',tid);
				if (!label) { Popup.remove(); return false; }
				var tip=prompt('Enter a slider tooltip',label);
				if (!tip) { Popup.remove(); return false; }
				var newtxt='\<\<slider \u0022\u0022 [['+tid+']] [['+label+']] [['+tip+']]\>\>';
				break;
		}
		var txt=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		store.saveTiddler(tid,tid,txt,config.options.txtUserName,new Date(),[],{});
		story.displayTiddler(story.findContainingTiddler(this.button),tid);
		config.quickEdit.setSelection(this.button,newtxt);
		Popup.remove(); return false;
	};
	Popup.show();
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>split</a></html>
Click the picture to generate a new set of colorful dots.
(:graph({width:400,height:400,scales:[-0.5,5.5,-0.5,5.5],coords:"none"})
setAction("mousedown",refresh);
var c = new String("0123456789"+"abcdef");
for(j=0;j<300;j++){
ma=[runif(0,5,2),runif(0,5,2)]
mb=runif(0,1,2)
mc=runif(0.05,0.3,4)
d="#"+randomString(6,c);
circle(ma,mc,{stroke:"none",fill:d,fillopacity:mb})
}
:)
(:graph({pos:"inline",height:200,width:240,scales:[0,20,4,15]})
plot("3+0.5*x",{stroke:"red"});
dynamic.data = [[10,8.04], [8,6.95], [13,7.58], [9,8.81], [11,8.33], [14,9.96], [6,7.24], [4,4.26], [12,10.84], [7,4.82], [5,5.68]];
path(dynamic.data,{marker:"***",stroke:"none",size:4});
:)(:graph({pos:"inline",height:200,width:240,scales:[0,20,4,15]})
plot("3+0.5*x",{stroke:"red"});
dynamic.data = [[10,9.14], [8,8.14], [13,8.74], [9,8.77], [11,9.26], [14,8.10], [6,6.13], [4,3.10], [12,9.13], [7,7.26], [5,4.74]];
path(dynamic.data,{marker:"***",stroke:"none",size:4});
:)
(:graph({pos:"inline",height:200,width:240,scales:[0,20,4,15]})
plot("3+0.5*x",{stroke:"red"});
dynamic.data = [[10,7.46], [8,6.77], [13,12.74], [9,7.11], [11,7.81], [14,8.84], [6,6.08], [4,5.39], [12,8.15], [7,6.42], [5,5.73]];
path(dynamic.data,{marker:"***",stroke:"none",size:4});
:)(:graph({pos:"inline",height:200,width:240,scales:[0,20,4,15]})
plot("3+0.5*x",{stroke:"red"});
dynamic.data = [[8,6.58],[8,5.76],[8,7.71],[8,8.84],[8,8.47],[8,7.04],[8,5.25],[19,12.50],[8,5.56],[8,7.91],[8,6.89]];
path(dynamic.data,{marker:"***",stroke:"none",size:4});
:)
/***
|Name|RunTiddlerPlugin|
|Source|http://www.TiddlyTools.com/#RunTiddlerPlugin|
|Version|1.2.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|command to invoke tiddler content as if tagged with systemConfig (i.e., a plugin)|
!!!!!Usage/Example
<<<
Toolbar command:
>{{{<<toolbar runTiddler>>}}} (in tiddler content)
>{{{<span class='toolbar' macro='toolbar runTiddler'></span>}}} (in ViewTemplate definition)
><<toolbar runTiddler>>
>when clicked, invokes the current tiddler as javascript code
Macro function:
>{{{<<runTiddler TiddlerName>>}}} or {{{<<runTiddler TiddlerName label tip>>}}}
>if only a TiddlerName is provided, the specified tiddler is automatically invoked as javascript code as soon as the macro is rendered.  If //optional// ''label'' and ''tip'' parameters are present, a command link is created that, when clicked, invokes the specified tiddler as javascript code.
<<<
!!!!!Revisions
<<<
2008.09.01 [1.2.1] fixed return value from command handler to prevent IE from attempt to leave the page
2008.08.26 [1.2.0] added optional label and tooltip params to macro (creates 'onclick' button to invoke specified tiddler)
2008.08.26 [1.1.0] added {{{<<runTiddler TiddlerName>>}}} macro to invoke specified tiddler
2007.09.27 [1.0.0] toolbar command based on run button functionality from TidIDEPlugin
<<<
!!!!!Code
***/
//{{{
version.extensions.RunTiddlerPlugin= {major: 1, minor: 2, revision: 1, date: new Date(2008,9,1)};
//}}}
//{{{
config.commands.runTiddler = {
	text: 'run',
	tooltip: 'evaluate tiddler content as systemConfig (plugin) javascript code',
	warning: "Warning!!  Processing '%0' as a systemConfig (plugin) tiddler may produce unexpected results! Are you sure you want to proceed?",
	completed: "%0: Processing completed",
	handler: function(event,src,title) {
		var here=story.findContainingTiddler(src); if (!here) return;
		return this.invoke(here.getAttribute("tiddler"),true,false);
	},
	invoke: function(tid,ask,quiet) {
		if (ask && !confirm(this.warning.format([tid]))) return false;
		var text=store.getTiddlerText(tid); if (!text) return false;
		try { window.eval(text); if (!quiet) displayMessage(config.commands.runTiddler.completed.format([tid])); }
		catch(ex) { displayMessage(config.messages.pluginError.format([exceptionText(ex)])); }
		return false;
	}
};
//}}}
//{{{
config.macros.runTiddler = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var tid=params[0];
		var label=params[1];
		var tip=params[2]||config.commands.runTiddler.tooltip;
		if (!label) config.commands.runTiddler.invoke(tid,false,true);
		else createTiddlyButton(place,label,tip,function(){
			return config.commands.runTiddler.invoke(this.getAttribute("tid"),true,false);
		},"button").setAttribute("tid",tid);
	}
}
//}}}
*Shift + left mouse button (LMB) click -- show/hide toolbar
*LMB drag and drop -- pan
*Mouse wheel -- zoom in/out (also available in the toolbar)
*Shift + Mouse wheel -- resize (also available in the toolbar)
(:graph
 axes();
 area("step(3-x,sqrt(pow(3,2)-pow(x,2)))","step(2-x,sqrt(pow(2,2)-pow(x,2)))",{min:0, max:3, stroke:"none",fill:"#ddd"});
:)
(:graph({width:300,height:200,scales:[-0.7,5.5,-0.07,0.55],coords:'none'})
 axes({dx:1,dy:0.1});
 a=[0.25, 0.45, 0.19, 0.09, 0.02]
 p=[[0,0]];
 for (i = 0; i < a.length; i += 1) {
  rect([i,0],[i+1,a[i]],{stroke:'red',fill:"orange"});
  text([i+0.5,a[i]+0.02],a[i],{pos:"n"});
  p.push([i+0.5,a[i]]);
 }
 p.push([a.length,0]);
 path(p,{stroke:"blue",fill:"none",curve:""});
:)
Experiments with [[detachable learning objects]] by [[Franco Bagnoli]]
[[MathNotebook]]
(:graph({width:300,height:300,scales:[-3.4,3.4,-3.4,3.4]})
slopeField("x+y",{dx:0.5, dy:0.5, marker:"-->",size:4, markerstroke:"pink",stroke:"pink"})
axes()
:)
(:graph
axes();
line([-2,0],[0,-2],{marker:"<->"});
dot([3,1.5]);
line([2,2.5],[4,2.5],{marker:">->"});
line([0,0],[1.5,1.5],{marker:"-->"});
loop([0,1],{direction:[2,2],marker:"-->"});
arc({start:[2,2],end:[4,2],marker:"*->"});
arc({start:[-2,2],end:[-4,2],marker:"|->"});
arc({center:[0,0],startangle:0,endangle:-PI/2,radius:1,marker:"<->",largearc:0});
setOptions({fill:'green', stroke:'red'});
arc({center:[-3.5,0],radius:1,startangle:PI/2,endangle:0,marker:"**",closed:true});
polygon([[-1,-1],[-1,-2],[-2,-1]],{marker:"xxx",label:["A","B","C"]});
line([0,0],[2,-2],{stroke: "yellow", strokewidth: 5});
line([0,0],[-2,1],{marker:'--o'});

rect([2,-3],[3,-1],{rx:0.2,ry:0.2});
var p=[[1,1],[2,0.5],[3.5,0.5],[1,1]];
curve(p)
:)
Click the picture to generate a new drawing.
(:graph({width:600,height:400,scales:[-36,36]})
setAction("mousedown",refresh);
  var c = new String("0123456789"+"abcdef");
axes({dx:5});grid({dx:5}); s = ""; r = runif(1,30);
setOptions({strokewidth:3});
for (i=0; i < r; i++) s += runif(1,9).toString();
text([-35,-23],s+" Length="+s.length,{pos:"ne"});
spirolateral(s);
//spirolateral("614937966"); //use this to draw a specific spirolateral
function spirolateral(st) {
  var i, j, x=0, y=0, nx=1, ny=1;
  j = runif(0,3); //start in any of the 4 directions
  while ((nx!=0 || ny!=0) && abs(x) < 100 && abs(y) < 100) {

    setOptions({stroke: "#"+randomString(6,c)});
    for (i=0; i< st.length; i++) {
      d = parseInt(st.charAt(i));
      nx = x+(j==0?d:(j==1?0:(j==2?-d:0)));
      ny = y+(j==0?0:(j==1?d:(j==2?0:-d)));
      line([x,y],[nx,ny]);
      x = nx;
      y = ny;
      j = (j+1)%4;
    }
  }
}
:)
(:graph
axes();
plot("step(x)+step(x-1,2)-step(x-2)");
:)

(:graph
axes();
plot("step(x)+step(x-1,2)-step(x-2)",{steps:[0,1,2],leftMarkers:"o",rightMarkers:"*"});
:)
(:graph
setScales(-5,5);
axes({dx:1,dy:1});
grid();
setOptions({stroke: "blue", strokedasharray: "10,10"});
a=1
c=1
plot("a*tan(x+c)")  // the predefined function
setOptions({stroke: "red", strokedasharray: "none"});

// Replace the "0" below with a matching function
// using numbers instead of a,c and click Update.

plot("0")
:)
/***
|Name|TiddlyLifePlugin|
|Source|http://www.TiddlyTools.com/#TiddlyLifePlugin|
|Documentation|http://www.TiddlyTools.com/#TiddlyLifePlugin|
|Version|1.6.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Cellular Automata: Conway's "Game of Life"|
!!!!!Documentation
<<<
[[TiddlyLife]] is a TiddlyWiki-enabled javascript version of Conway's "Game of Life" cellular automata simulator.  It provides a "life matrix" on which to place cells, run the simulation, and observe the results.  The speed of the simulation is related to the total size of the matrix (i.e., rows X cols): the larger the matrix, the longer it takes to compute each 'generation' of cells.

You can set the number of rows and columns in the matrix, as well as the size of each cell and the color of the cells, grid, and background.  You can use the mouse to click/drag over the grid to add/delete cells (hold shift to add "walls").  The current life matrix can be saved as text in a tiddler and then reloaded later from a popup list of tiddlers tagged with<<tag tiddlyLife>>

Please see Wikipedia for an overview of [[Conway's "Game of Life"|http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life]].
<<<
!!!!!Syntax
<<<
{{{
<<life	cellcolor:... gridcolor:... bgcolor:... wallcolor:...
	cellsize:... gridwidth:... delay:... limit:... stability:...
	autostart nomenu nostats noedit width:... height:... tid:...>>
}}}
where all parameters are optional (default values are shown in parentheses):
*''cellcolor:'' (//green//), ''gridcolor:'' (//#111//), ''bgcolor:'' (//black//) and ''wallcolor:'' (//gray//)<br>are CSS color names or RGB values (e.g.: "black", "blue",  "#fff", "#9af", etc.)
*''cellsize:'' (//1em//), and ''gridwidth:'' (//1px//)<br>are CSS dimensions, including units (e.g., px,em,cm,in)
*''delay:'' (//0//)<br>delay time (in msec) between simulation ticks (a larger number results in a slower simulation, but also leaves more CPU cycles available for other processes)
*''limit:'' (//10000//)<br>automatically stop stimulation after the indicated number of generations (use 0 for no limit)
*''stability:'' (//500//)<br>automatically stop simulation if population count remains stable for the indicated number of generations (use 0 for no limit)
*''autostart'' (//keyword//)<br>when present, causes the simulation to begin running as soon as the macro is rendered
*''nomenu'' (//keyword//)<br>when present, suppresses display of command menu (use with ''autostart'')
*''nostats'' (//keyword//)<br>when present, suppresses display of the current matrix statistics (generation #, population count/min/avg/max, birthrate/deathrate, average age)
*''noedit'' (//keyword//)<br>when present, prevent hand editing of cells in the matrix.  Instead, clicking on the matrix starts/stops the simulation (useful with ''nomenu'' and ''autostart'')
*''width:'' (//30//) and ''height:'' (//30//)<br>are dimensions for an empty life matrix
*''tid:'' (//no default//)<br>specifies a tiddler containing a saved life matrix definition.  note: when using a saved matrix, the width/height are determined by the stored definition and any width/height macro parameters that are present will be ignored.
<<<
!!!!!Examples
<<<
"Multi-cellular organisms" can be constructed by arranging blocks in specific patterns that exhibit emergent behaviors such as movement, symmetry, oscillation and generative abilities.  Two well-known organisms that are [[discussed in the Wikipedia article|http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life]] are ''//gliders//'' and ''//Gosper's glider gun//'':

[[GliderDance]]: many small moving organisms just missing each other!
{{{<<life cellsize:.8em tid:GliderDance>>}}}
<<life cellsize:.8em tid:GliderDance>>
[[GliderGun]]: generates a stream of gliders that hits a wall
{{{<<life cellsize:.6em tid:GliderGun>>}}}
<<life cellsize:.6em tid:GliderGun>>
... and here's an ''empty life matrix'' for you to play with:
{{{<<life>>}}}
<<life>>
<<<
!!!!!Revisions
<<<
2008.10.11 [1.6.5] added 'step' command.  Also, for performance, removed birth/death stats and don't display average age (but //do// calculate it)
2008.10.10 [1.6.0] added birthrate, deathrate, and average age to statistics
2008.10.09 [1.5.0] use //named// params.  changed matrix values: 0==empty, >0==alive, <0==wall, where value=generation # in which cell was created
2008.10.08 [1.4.0] added 'stability' and 'limit' options (replaces 'autostop' checkbox)
2008.10.08 [1.3.0] added optional 'autostart', 'nomenu' and 'nostats' macro params
2008.10.07 [1.2.1] fixed update handling so multiple timers will no longer be created
2008.10.06 [1.2.0] added support for walls (unchanging dead cells) using dead="-", alive="O", wall="#"
2008.10.06 [1.1.1] redraw optimization: 300% speed improvement by setting CSS only when cell state *changes*
2008.10.05 [1.1.0] drag to draw (set/clear) multiple cells, new option controls (rows,cols,cellsize,delay,autostop), popup list for opening saved matrix
2008.10.04 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TiddlyLifePlugin= {major: 1, minor: 6, revision: 5, date: new Date(2008,10,11)};
config.shadowTiddlers.TiddlyLife="<<life>>";
config.macros.life={
//}}}
// // DEFAULTS
//{{{
	cellcolor:	"green",
	cellsize:	"1em",
	gridcolor:	"#111",
	gridwidth:	"1px",
	bgcolor:	"black",
	wallcolor:	"gray",
	width:		30,
	height:		30,
	stability: 	300,
	limit:		5000,
	delay:		0,
//}}}
// // TRANSLATE
//{{{
	lifeTag:	"tiddlyLife",
	titlePrompt:	"Enter a new tiddler title",
	openErr:	"Could not open '%0'",
	limitMsg:	"stopped: completed %0 generations",
	stableMsg:	"stopped: no growth for %0 generations",
	cellEditTip:	"CLICK=set/clear, SHIFT-CLICK=set wall",
	noEditTip:	"CLICK=start/stop simulation",
	startLabel:	"start",
	stopLabel:	"<b>STOP</b>",
	stats:		"gen: <b>%0</b> pop: <b>%1</b> min: <b>%2</b> avg: <b>%3</b> max: <b>%4</b> %5",
	cmds:		"<a href='#' title='start/stop simulation'\
				onclick='return config.macros.life.toggle(\"%0\")'>%1</a> \
			 | <a href='#' title='advance simulation by one generation'\
				onclick='return config.macros.life.step(\"%0\")'>step</a> \
			 | <a href='#' title='reload the starting life matrix'\
				onclick='return config.macros.life.reset(\"%0\")'>reset</a> \
			 | <a href='#' title='clear the life matrix'\
				onclick='return config.macros.life.clear(\"%0\")'>clear</a> \
			 | <a href='#' title='load a life matrix from a tiddler'\
				onclick='return config.macros.life.open(this,event,\"%0\")'>open</a> \
			 | <a href='#' title='save the current life matrix to a tiddler'\
				onclick='return config.macros.life.save(\"%0\")'>save</a> \
			 | <a href='#' title='change simulation option settings'\
				onclick='var s=this.nextSibling.style; var show=s.display==\"none\"; \
					s.display=show?\"block\":\"none\"; \
					return false;'>options</a><span style='display:none'>%2</span>",
	opts:		"delay:<input type='text' title='delay between generations (msec)' \
				value='%1' style='width:4em;font-size:90%;text-align:center;'>\
			 limit:<input type='text' title='automatically stop after N generations (0=no limit)' \
				value='%2' style='width:4em;font-size:90%;text-align:center;'>\
			 stability:<input type='text' title='stop if population count is stable for N generations (0=no limit)'\
				value='%3' style='width:4em;font-size:90%;text-align:center;'><br>\
			 rows:<input type='text' title='matrix height' \
				value='%4' style='width:3em;font-size:90%;text-align:center;'>\
			 cols:<input type='text' title='matrix width' \
				value='%5' style='width:3em;font-size:90%;text-align:center;'>\
			 cells:<input type='text' title='cellsize' \
				value='%6' style='width:3em;font-size:90%;text-align:center;'>\
			 <input type='button' value='OK' style='font-size:90%;' \
				title='change the life matrix dimensions' \
				onclick='var ins=this.parentNode.getElementsByTagName(\"input\"); \
					var t=ins[0].value; var l=ins[1].value; var a=ins[2].value; \
					var h=ins[3].value; var w=ins[4].value; var s=ins[5].value; \
					return config.macros.life.setoptions(\"%0\",w,h,s,t,a,l)'>",
	msgfmt: 	"<br><span title='use \"options\" command to change autostop settings' \
			onclick='this.style.display=\"none\"' \
			style='display:block;position:absolute;padding:0 .5em;cursor:pointer; \
			margin:.5em;color:%1;background-color:%2;border:1px solid %1'>%3</span>",

//}}}
// // GENERAL UTILITIES
//{{{
	empty: function(w,h) { // generate an empty matrix
		var m=[]; for (var r=0; r<h; r++) { m[r]=[]; for (var c=0; c<w; c++) m[r][c]=0; } return m;
	},
	paste: function(row,col,m1,m2) { // copy one matrix into another
		for (var r=row; r<m1.length && r<m2.length; r++)
			for (var c=col; c<m1[r].length && c<m2[r].length; c++)
				m2[r][c]=m1[r][c];
	},
	zeroPad: function(v,m) { // formatting for population stats
		var t=("0000"+v.toString());
		return t.substr(t.length-Math.max(m.toString().length,v.toString().length));
	},
	getValue: function(s) { // cell value from stored matrix symbol
		return s=='O'?1:s=='#'?-1:0;
	},
	getSymbol: function(v) { // stored matrix symbol from cell value
		return v>0?'O':v<0?'#':'-';
	},
	getColor: function(v,d) { // color from cell value
		return v>0?d.cellcolor:v<0?d.wallcolor:'';
	},
	getAge: function(v,d) { // age of a cell or wall
		return v?(d.gen||1)-Math.abs(v):0;
	},
	isAlive: function(v) { // 0 if dead, 1 if alive
		return v>0;
	},
	isWall: function(v) { // 1 if cell is a wall
		return v<0;
	},
	isAncient: function(v,d) { // true if cell age is more than ten times the average age
		return d.avgage>0 && this.getAge(v,d)>10*d.avgage;
	},
//}}}
// // MACRO HANDLER
//{{{
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var autostart	=params.contains("autostart");
		var nomenu	=params.contains("nomenu");
		var nostats	=params.contains("nostats");
		var noedit	=params.contains("noedit");
		params = paramString.parseParams("anon",null,true,false,false);
		var cellcolor	=getParam(params,"cellcolor",this.cellcolor);
		var wallcolor	=getParam(params,"wallcolor",this.wallcolor);
		var cellsize	=getParam(params,"cellsize",this.cellsize);
		var gridcolor	=getParam(params,"gridcolor",this.gridcolor);
		var gridwidth	=getParam(params,"gridwidth",this.gridwidth);
		var bgcolor	=getParam(params,"bgcolor",this.bgcolor);
		var tid		=getParam(params,"tid",this.tid);
		var w		=getParam(params,"rows",this.width);
		var h		=getParam(params,"cols",this.height);
		var delay	=getParam(params,"delay",this.delay);
		var stability	=getParam(params,"stability",this.stability);
		var limit	=getParam(params,"limit",this.limit);
		var m=this.load(tid); if (!m) var m=this.empty(w,h);
		var id="tiddlyLife_"+new Date().getTime()+Math.random();
		var e=createTiddlyElement(place,"span",id,"tiddlyLife");
		e.data={w:w, h:h, tid:tid, matrix:m, gen:0, stopped:!autostart,
			gencount:0, stable:0, total:0, birthrate:0, deathrate:0, age:0, 
			cellcolor:cellcolor, wallcolor:wallcolor, gridcolor:gridcolor, bgcolor:bgcolor,
			cellsize:cellsize, gridwidth:gridwidth, delay:delay, stability:stability, limit:limit,
			nostats:nostats, nomenu:nomenu, noedit:noedit };
		this.draw(id); if (autostart) this.go(id);
	},
//}}}
// // COMMAND HANDLERS
//{{{
	toggle: function(id) { // toggle simulation
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		if (d.stopped) this.go(id); else this.stop(id);
		return false;
	},
	go: function(id) { // start simulation and set command text
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		var b=e.getElementsByTagName("a")[0]; if (b) b.innerHTML=this.stopLabel;
		d.stopped=false; d.stable=0; d.gencount=0; clearTimeout(d.timer); this.refresh(id);
		return false;
	},
	stop: function(id) { // stop simulation and set command text
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		var b=e.getElementsByTagName("a")[0]; if (b) b.innerHTML=this.startLabel;
		d.stopped=true; clearTimeout(d.timer);		
		return false;
	},
	reset: function(id) { // reload initial matrix
		var e=document.getElementById(id); if (!e) return; var d=e.data;
		var m=this.load(d.tid); if (!m) var m=this.empty(d.w,d.h);
		this.stop(id); d.matrix=m; d.gen=0; this.draw(id);
		return false;
	},
	clear: function(id) { // load empty matrix
		var e=document.getElementById(id); if (!e) return; var d=e.data;
		var tid=d.tid; d.tid=""; this.reset(id); d.tid=tid;
		return false;
	},
	setoptions: function(id,w,h,s,t,a,l) { // options: width,height,cellsize,delaytime,autostop,limit
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		clearTimeout(d.timer); // stop simulation while changing matrix content
		d.w=w; d.h=h; d.stability=a; d.limit=l; d.cellsize=s; d.delay=t;
		var m2=this.empty(w,h); this.paste(0,0,m,m2); d.matrix=m2; this.draw(id);
		d.min=Math.min(d.min,d.count); d.max=Math.max(d.max,d.count);
		if (!d.stopped) d.timer=setTimeout('config.macros.life.refresh("'+id+'")',d.delay);
		return false;
	},
//}}}
// // I/O HANDLERS
//{{{
	load: function(tid) { // read tiddler into matrix
		var t=store.getTiddlerText(tid); if (!t) return;
		var lines=t.split("\n"); var m=[];
		if (lines[0]=="{{{") lines.shift();
		if (lines[lines.length-1]=="}}}") lines.pop();
		for (var r=0; r<lines.length; r++) { m[r]=[];
			for (var c=0; c<lines[r].length; c++) m[r].push(this.getValue(lines[r].substr(c,1)));
		}
		return m;
	},
	save: function(id) { // write matrix to tiddler
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		var tid=d.tid; var msg=config.messages.overwriteWarning.format([tid]);
		while (!tid||!tid.length ||(store.tiddlerExists(tid)&&!confirm(msg)))
			{ tid=prompt(this.titlePrompt,tid); if (!tid||!tid.length) return false; }
		d.tid=tid;
		var out=[];
		out.push('{{{');
		for (var r=0; r<m.length; r++) { var row='';
			for (var c=0; c<m[r].length; c++) row+=this.getSymbol(m[r][c]);
			out.push(row);
		}
		out.push('}}}');
		var t=store.getTiddler(tid);
		var txt=out.join('\n');
		var who=t&&config.options.chkForceMinorUpdate?t.modifier:config.options.txtUserName;
		var when=t&&config.options.chkForceMinorUpdate?t.modified:new Date();
		var tags=t?t.tags:[]; tags.pushUnique(this.lifeTag);
		var fields=t?t.fields:{};
		store.saveTiddler(tid,tid,txt,who,when,tags,fields);
		story.displayTiddler(null,tid); story.refreshTiddler(tid,null,true);
		return false;
	},
	open: function(here,event,id) { // select from a list of saved matrix tiddlers
		var p=Popup.create(here); if (!p) return false;
		p.style.padding="2px .5em";
		var tids=store.getTaggedTiddlers(this.lifeTag);
		for (var t=0; t<tids.length; t++) {
			var b=createTiddlyButton(createTiddlyElement(p,"li"),tids[t].title,tids[t].title,
				function() {
					var cml=config.macros.life;
					var id=this.getAttribute("id");
					var e=document.getElementById(id); if (!e) return false; var d=e.data;
					var tid=this.getAttribute("tid");
					var m=cml.load(tid);
					if (!m) { displayMessage(this.openErr.format([tid])); return false; }
					cml.stop(id); d.tid=tid; d.matrix=m; d.gen=0; cml.draw(id);
					return false;
				});
			b.setAttribute("id",id);
			b.setAttribute("tid",tids[t].title);
		}
		Popup.show();
		event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();
		return false;
	},
//}}}
// // EDIT HANDLERS
//{{{
	mousedown: function(here,ev,id,r,c) { // start manual edit
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		d.savedstop=d.stopped; this.stop(id); d.draw=!this.isAlive(m[r][c])?(d.gen||1):0;
		return this.setcell(here,id,r,c,ev&&ev.shiftKey?-(d.gen||1):d.draw);
	},
	mouseover: function(here,ev,id,r,c) { // drag edit
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		if (d.draw!==undefined) this.setcell(here,id,r,c,ev&&ev.shiftKey?-(d.gen||1):d.draw);
		return false;
	},
	mouseup: function(here,ev,id,r,c) { // end manual edit
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		if (d.savedstop!==undefined) d.stopped=d.savedstop; if (!d.stopped) this.go(id);
		d.draw=undefined; d.savedstop=undefined;
		return false;
	},
	setcell: function(here,id,r,c,v) { // set cell content and revise stats display
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		if (m[r][c]==v) return;
		if (this.isAlive(m[r][c]) && !this.isAlive(v)) { d.count--; d.min=Math.min(d.min,d.count); }
		if (!this.isAlive(m[r][c]) && this.isAlive(v)) { d.count++; d.max=Math.max(d.max,d.count); }
		m[r][c]=v; here.style.background=this.getColor(v,d);
		this.showstats(id,'');
		return false;
	},
//}}}
// // RENDER
//{{{
	draw: function(id) { // render entire tiddlyLife container (menu, stats, and table)
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		var out=[]; var count=0; var maxwidth=0;
		var style="border:%0 solid %1;background:%2;height:%3 !important;width:%3; !important";
		var onmousedown=d.noedit?"":"return config.macros.life.mousedown(this,event,'%4',%5,%6);";
		var onmouseover=d.noedit?"":"return config.macros.life.mouseover(this,event,'%4',%5,%6);";
		var onmouseup  =d.noedit?"":"return config.macros.life.mouseup(this,event,'%4',%5,%6);";
		var onclick    =d.noedit?"return config.macros.life.toggle('%4');":"";
		var tip="[%7,%8] "+(d.noedit?this.noEditTip:this.cellEditTip);
		var cell='<td style="margin:0;padding:0;'+style +'" title="'+tip+'" onclick="'+onclick
			+'" onmousedown="'+onmousedown+'" onmouseover="'+onmouseover+'" onmouseup="'+onmouseup+'"></td>';
		out.push('<table style="table-layout:fixed;border-collapse:collapse;'
			+'margin:0;padding:0;border:0;background-color:'+d.bgcolor+'">');
		for (var r=0; r<m.length; r++) {
			if (m[r].length>maxwidth) maxwidth=m[r].length;
			out.push('<tr style="margin:0;padding:0;border:0;">');
			for (var c=0; c<m[r].length; c++) {
				out.push(cell.format([d.gridwidth,d.gridcolor,this.getColor(m[r][c],d),
					d.cellsize,id,r,c,r+1,c+1]));
				count+=this.isAlive(m[r][c]);
			}
			out.push('</tr>');
		}
		out.push('</table>');
		d.count=count;
		if (!d.gen) { d.gencount=d.stable=d.total=d.oldest=d.maxage=d.avgage=0; d.min=d.max=d.avg=count; }
		var hdr=[];
		if (!d.nomenu) hdr.push(this.cmds.format([id,d.stopped?this.startLabel:this.stopLabel,
			this.opts.format([id,d.delay,d.limit,d.stability,m.length,maxwidth,d.cellsize])]));
		if (!d.nostats) hdr.push('<div style="font-size:90%">'
			+this.stats.format([d.gen,d.count,d.min,d.avg,d.max])+'</div>');
		e.innerHTML=hdr.join('')+out.join('');
		return false;
	},
//}}}
// // RUN SIMULATION
//{{{
	refresh: function(id) { // timer-based refresh cycle
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		this.step(id); if (!d.stopped) d.timer=setTimeout('config.macros.life.refresh("'+id+'")',d.delay);
		return false;
	},
	step: function(id) { // calc new matrix, gather stats and display changes
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		// calculate next generation
		var m2=[]; var count=agecount=agetotal=oldest=0; d.gen++; d.gencount++;
		var table=e.getElementsByTagName("table")[0]; if (!table) return;
		var rows=table.getElementsByTagName("tr");
		for (var r=0; r<m.length; r++) {
			m2[r]=[];
			var cells=rows[r].getElementsByTagName("td");
			for (var c=0; c<m[r].length; c++) {
				var v=this.tick(d.gen,m,r,c); // apply Conway's 23/3 rule
				m2[r].push(v);
				var color=this.getColor(v,d);
				if (cells[c].style.backgroundColor!=color)
					cells[c].style.backgroundColor=color;
				if (this.isAlive(v)) {
					var a=this.getAge(v,d);
					if (!this.isAncient(v,d)) { agecount++; agetotal+=a; }
					oldest=Math.max(oldest,a);
					count++;
				}
			}
		}
		d.matrix=m2; // update matrix
		this.calcstats(id,count,agecount,agetotal,oldest); // calculate statistics
		var msg=this.autostop(id); // autostop if conditions apply
		this.showstats(id,msg); // show statistics and message (if any)
		return false;
	},
	tick: function(gen,m,r,c) { // apply Conway's 23/3 rule
		if (this.isWall(m[r][c])) return m[r][c]; // walls don't change
		var prevrow=r>0?r-1:(m.length-1);
		var nextrow=r<m.length-1?r+1:0;
		var prevcol=c>0?c-1:(m[r].length-1);
		var nextcol=c<m[r].length-1?c+1:0;
		var near=this.isAlive(m[prevrow][prevcol]) + this.isAlive(m[prevrow][c]) + this.isAlive(m[prevrow][nextcol])
			+this.isAlive(m[r][prevcol])       + this.isAlive(m[r][nextcol])
			+this.isAlive(m[nextrow][prevcol]) + this.isAlive(m[nextrow][c]) + this.isAlive(m[nextrow][nextcol]);
		if (!this.isAlive(m[r][c])&&near==3) return gen; // birth
		if (this.isAlive(m[r][c])&&near==2||near==3) return m[r][c]; // stay alive
		return 0; // death
	},
	autostop: function(id) { // autostop if run limit reached or no changes for N generations
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		var msg='';
		var limited=d.limit>0 && d.gencount>=d.limit;
		var stabilized=d.stability>0 && d.stable>=d.stability;
		if (limited || stabilized) {
			this.stop(id); 
			msg=stabilized?this.stableMsg.format([d.stability]):this.limitMsg.format([d.limit]);
			msg=this.msgfmt.format([id,d.cellcolor,d.bgcolor,msg]);
		}
		return msg;
	},
	calcstats: function(id,count,agecount,agetotal,oldest) {
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		d.stable+=(count==d.count)?1:-d.stable; // add one or reset to zero
		d.count=count; d.total+=count;
		d.min=Math.min(d.min,count); d.max=Math.max(d.max,count); d.avg=Math.floor(d.total/d.gen);
		d.avgage=agecount?agetotal/agecount:0; d.oldest=oldest; d.maxage=Math.max(d.maxage,oldest);
		return false;
	},
	showstats: function(id,msg) {
		var e=document.getElementById(id); if (!e) return; var d=e.data; var m=d.matrix;
		var stats=e.getElementsByTagName("div")[0];
		if (stats) stats.innerHTML=this.stats.format([d.gen,this.zeroPad(d.count,d.max),d.min,d.avg,d.max,msg]);
		return false;
	}
}
//}}}
midi/stairway_to_heaven.mid
Stairway to Heaven
----
midi/greatgiginthesky.mid
Great Gig in the Sky
----
midi/shineon.mid
Shine On You Crazy Diamond
----
midi/whiter_shade_of_pale.mid
A Whiter Shade of Pale
----
midi/a_day_in_the_life.mid
A Day in the Life
----
midi/help_from_my_friends.mid
Help From My Friends
----
midi/california_dreaming.mid
California Dreaming
----
midi/peanuts.mid
Peanuts
----
midi/ppanther.mid
Pink Panther
----
midi/georgia_on_my_mind2.mid
Georgia on My Mind
----
midi/jingle_bells_jazz.mid
Jingle Bell Jazz
----
midi/GMajorBlues.mid
G Major Blues
----
midi/Justblue.mid
Just Blue
----
midi/Mission_Impossible.mid
Mission Impossible
----
midi/bond.mid
James Bond
----
midi/birdland.mid
Birdland
----
midi/Olympic_Winter_Games.mid
Winter Olympics Fanfare
----
midi/sing_sing_sing.mid
Sing! Sing! Sing!
----
midi/jcycle.mid
J Cycle
----
midi/marslove.mid
Martian Love
----
midi/fly_like_an_eagle.mid
Fly Like an Eagle
----
midi/johnny_b_goode.mid
Johnny B Goode
----
midi/sweet_emotion.mid
Sweet Emotion
----
midi/thewayitis.mid
The Way It Is
----
midi/beeth6-1.mid
Beethoven's 6th: Pastoral
----
midi/eine_kleine_nachtmusik.mid
Eine Kleine Nachtmusik
----
midi/Gmfigaro.mid
Figaro Overture
----
The Sky's The Limit
FNM: The Sky's The Limit (mp3)
----
audio/fnm/030502-5.mp3
FNM: In The Shadows (mp3)
----
audio/fnm/020830-6.mp3
FNM: Good Morning, Elijah (mp3)
----
http://somafm.com/groovesalad.asx
SoMaFM.com - Groove Salad
/***
|Name|TiddlyPodPlugin|
|Source|http://www.TiddlyTools.com/#TiddlyPodPlugin|
|Version|1.4.4|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|TiddlyPodList|
|Overrides||
|Description|autoplay music randomly selected from playlist using embedded player|
!!!!!Usage
<<<
{{{
<<tiddlyPod autoplay loop verbose track:... width:... height:... size:... @TiddlerName>>
}}}
where:
* ''autoplay'' / ''noautoplay'' (keyword, default=''autoplay'')<br>the selected item will play immediately, without pressing the PLAY button.
* ''loop'' / ''noloop'' (keyword, default=''noloop'')<br>the current item is repeatedly played until you press the stop button.
* ''verbose'' (keyword, default=//none//)<br>a message will be displayed whenever an item is selected.
* ''track:...'' (number, default=//last played//)<br>the index into the playlist for the initial item to load into the player.  If no item is specified, the last one played is re-loaded (tracked in a browser cookie).  If no cookie exists (i.e., the first time you play after installing, or after clearing cookies, etc.), then the first item in the playlist is used.
* ''width:...'' and ''height:...'' (default=115x15 for QuickTime or, if using Internet Explorer, 90x44 for Windows Media Player)<br>specify a non-default width/height dimensions for the embedded player (using pixels).
* ''size:xxxx'' (default="auto")<br>a fixed height for the playlist popup container itself (using CSS measurement units, e.g., "px", "em", "cm", "in", etc.).  If the items in the list overflow this height, then a scrollbar is automatically added to the popup list.  "auto" shows //all// playlist entries without scrolling, using a variable height popup.
* ''@~TiddlerName'' (default=[[TiddlyPodList]])<br>specifies a tiddler containing the list of items to play.  Entries in the list are separated by "----", and each entry consist of two lines: the first line is the location (or URL) of the media file to be played.  The second line is a title to be displayed when that item is playing.
<<<
!!!!!Examples
<<<
{{{<<tiddlyPod noautoplay loop track:1 @TiddlyPodList>>}}}
<<tiddlyPod noautoplay loop track:1 @TiddlyPodList>>
<<<
!!!!!Revisions
<<<
2008.03.22 [1.4.4] added [[TiddlyPod]] shadow definition.
2008.03.21 [1.4.3] removed {{{pluginspage="http://www.apple.com/quicktime/download/"}}} param from HTML {{{<embed>}}}, so that FireFox (and other browsers) don't //prefer// QuickTime over other installed media players.  ''It is still up to the browser to determine which player to use.''.
2007.11.09 [1.4.2] in handler(), corrected default initialization of chkTiddlyPodAutoPlay and chkTiddlyPodLoopPlay.
2007.06.12 [1.4.1] in play(), don't call removeChildren(), since browser will clean up objects when assignment to innerHTML is made
2007.02.23 [1.4.0] added support for using 'attachment tiddlers' (see AttachFilePlugin) for self-contained playback.  This seems to work well with QuickTime.  Other embedded players may vary in support for the data:// URI.  Note: IE6/7 does NOT support data:// URI.  Attachments should always have local and/or remote fallbacks defined.
2007.02.23 [1.3.1] added support for scrollbar to playlist popup.  Use size:xxx to set the length of the playlist, where 'xxx' is any valid CSS measurement.  Use "auto" to show all playlist items without scrolling.  Also, added popup items for controlling autoplay/loopplay preferences.
2007.02.21 [1.3.0] added playlist popup and rewrote getPod() and play() to use innerHTML instead of wikify().  Eliminates all dependency on InlineJavascriptPlugin when rendering output.
2007.02.20 [1.2.1] added optional 'track:#' parameter to specify initial track, instead of starting with a random track
2007.02.20 [1.2.0] added optional 'loop' parameter to trigger looping playback
2007.02.20 [1.1.0] removed link for "edit playlist" to reduce clutter and provide a 'playback only' interface.  When changing the play list is appropriate, a link to [[TiddlyPodList]] (or any alternative playlist tiddler) can be directly added to surrounding tiddler content as needed.
2007.02.19 [1.0.0] initial release (converted from inline script)
<<<
!!!!!Code
***/
//{{{
version.extensions.TiddlyPodPlugin= {major: 1, minor: 4, revision: 4, date: new Date(2008,3,22)};

config.shadowTiddlers['TiddlyPod']='<<tiddlyPod>>';

config.macros.tiddlyPod= {
	verbose: false, // set to true to display messages
	playlist: "TiddlyPodList", // tiddler containing list of tunes
	size: "auto", // maximum length (using CSS) of playlist to show before adding a scrollbar
	width: config.browser.isIE?90:115, // width of embedded player (IE w/WinMedia vs FireFox w/QuickTime)
	height: config.browser.isIE?44:15, // height of embedded player (IE w/WinMedia vs FireFox w/QuickTime)
	getPlayer: function(src,w,h,auto,loop) {
		var out='';
		out+='<EMBED WIDTH="'+w+'" HEIGHT="'+h+'" ';
		out+='	style="height:'+h+'px;width:'+w+'px;margin:0;padding:0;" ';
		out+='	src="'+src+'" ';
		out+='	autostart="'+(auto?'true':'false')+'" autoplay="'+(auto?'true':'false')+'" ';
		out+='	loop="'+(loop?'true':'false')+'" ';
		out+='	controller="show" volume="100" EnableJavaScript="true" ';
		out+='	showtracker="1" showpositioncontrols="0" showaudiocontrols="0" ';
		out+='	showdisplay="0" showstatusbar="0" showgotobar="0"> ';
		out+='</EMBED>';
		return out;
	},
	getPod: function(playlist,which) {
		var txt=store.getTiddlerText(playlist); if (!txt) return;
		var songs=txt.split("\n----\n");
		var first=0;
		var last=songs.length-1;
		if (which===undefined) which=config.options.txtTiddlyPodNowPlaying;
		if (which<first) which=first; if (which>last) which=last;
		var next=(which-1)+2; if (next>last) next=last;
		var prev=which-1; if (prev<first) prev=first;
		var src=songs[which].split("\n")[0];
		var descr=songs[which].split("\n")[1];

		// if src is a tiddlername, check for attachment
		if (config.macros.attach!=undefined) // if AttachFilePlugin is installed
			if ((tid=store.getTiddler(src))!=null && tid.isTagged("attachment")) // if src is attachment tiddler title
				src=config.macros.attach.getAttachment(src); // replace TiddlerTitle with attachment-expanded src URL

		var out='';
		var tip=config.messages.externalLinkTooltip.format([src]); // use core defined tooltip
		out+='<div><a href="'+src+'" target="_blank" class="button" title="'+tip+'" style="white-space:normal">'+descr+'</a></div>';
		out+=this.getPlayer(src,this.width,this.height,config.options.chkTiddlyPodAutoPlay,config.options.chkTiddlyPodLoopPlay);
		out+='<div class="small">';
		out+='<a href="javascript:;" class="button" title="[first] track '+(first+1)+' - '+songs[first].split("\n")[1]+'" ';
		out+='	onclick="config.macros.tiddlyPod.play(this.parentNode.parentNode,'+first+'); return false;">&lt;&lt;</a>';
		out+='&nbsp;';
		out+='<a href="javascript:;" class="button" title="[previous] track '+(prev+1)+' - '+songs[prev].split("\n")[1]+'" ';
		out+='	onclick="config.macros.tiddlyPod.play(this.parentNode.parentNode,'+prev+'); return false;">&nbsp;&lt;&nbsp;</a>';
		out+='&nbsp;';
		out+='<a href="javascript:;" class="button" title="[playlist]" ';
		out+='	onclick="config.macros.tiddlyPod.showpopup(this,event); return false;">...</a>';
		out+='&nbsp;';
		out+='<a href="javascript:;" class="button" title="[next] track '+(next+1)+' - '+songs[next].split("\n")[1]+'" ';
		out+='	onclick="config.macros.tiddlyPod.play(this.parentNode.parentNode,'+next+'); return false;">&nbsp;&gt;&nbsp;</a>';
		out+='&nbsp;';
		out+='<a href="javascript:;" class="button" title="[last] track '+(last+1)+' - '+songs[last].split("\n")[1]+'" ';
		out+='	onclick="config.macros.tiddlyPod.play(this.parentNode.parentNode,'+last+'); return false;">&gt;&gt;</a>';
		out+='</div>';

		if (this.verbose) displayMessage('now playing... track '+(which+1)+' - "'+descr+'"');
		return out;
	},
	play: function(target,which) {
		if (which==undefined) which=config.options.txtTiddlyPodNowPlaying; // if not specified, use most recently played item
		if (which==undefined) which=0; // default to first item in playlist if no previous item
		target.innerHTML=this.getPod(this.playlist,which);
		config.options.txtTiddlyPodNowPlaying=which;
		saveOptionCookie("txtTiddlyPodNowPlaying");
		return;
	},
	showpopup: function(place,event) {
		var popup=Popup.create(place); if (!popup) return;
		var txt=store.getTiddlerText(this.playlist); if (!txt) return;
		var songs=txt.split("\n----\n");
		config.macros.tiddlyPod.target=place.parentNode.parentNode;
		createTiddlyButton(createTiddlyElement(popup,'li'),
			"play a randomly selected track", "shuffle play",
			function(){
				var t=config.options.chkTiddlyPodAutoPlay;
				config.options.chkTiddlyPodAutoPlay=true; // force autoplay
				config.macros.tiddlyPod.play(config.macros.tiddlyPod.target,Math.floor(Math.random()*songs.length));
				config.options.chkTiddlyPodAutoPlay=t;
				return false;
			});
		createTiddlyElement(popup,"hr");
		createTiddlyButton(createTiddlyElement(popup,'li'),
			(config.options.chkTiddlyPodAutoPlay?"[x]":"[_]")+" auto play",
			"automatically play tune when selected (if off, press PLAY button to start)",
			function(){
				config.options.chkTiddlyPodAutoPlay=!config.options.chkTiddlyPodAutoPlay;
				saveOptionCookie("chkTiddlyPodAutoPlay");
				config.macros.tiddlyPod.play(config.macros.tiddlyPod.target,config.options.txtTiddlyPodNowPlaying);
				return false;
			});
		createTiddlyButton(createTiddlyElement(popup,'li'),
			(config.options.chkTiddlyPodLoopPlay?"[x]":"[_]")+" repeat play",
			"when playback is finished, repeat the current selection again",
			function(){
				config.options.chkTiddlyPodLoopPlay=!config.options.chkTiddlyPodLoopPlay;
				saveOptionCookie("chkTiddlyPodLoopPlay");
				config.macros.tiddlyPod.play(config.macros.tiddlyPod.target,config.options.txtTiddlyPodNowPlaying);
				return false;
			});
		createTiddlyElement(popup,"hr");
		var playlist=createTiddlyElement(popup,"div",null,"fine"); // uses 'fine' CSS class to set font size
		playlist.style.padding="2px"; // room for dotted 'focus' indicator (prevent horizontal scrollbar from appearing)
		playlist.style.height=config.macros.tiddlyPod.size;
		playlist.style.overflow="auto";
		for (var s=0; s<songs.length; s++) {
			var src=songs[s].split("\n")[0];
			var descr=(s+1)+" - "+songs[s].split("\n")[1];
			var a=createTiddlyButton(createTiddlyElement(playlist,'li'), descr, src,
				function(){
					var t=config.options.chkTiddlyPodAutoPlay;
					config.options.chkTiddlyPodAutoPlay=true; // force autoplay
					config.macros.tiddlyPod.play(config.macros.tiddlyPod.target,this.getAttribute("which"));
					config.options.chkTiddlyPodAutoPlay=t;
					return false;
				});
			a.setAttribute("which",s); // song index
			if (s==config.options.txtTiddlyPodNowPlaying) a.style.fontWeight="bold";
		}
		createTiddlyElement(popup,"hr");
		createTiddlyButton(createTiddlyElement(popup,'li'), 'edit playlist...', '',
			function(){story.displayTiddler(null,config.macros.tiddlyPod.playlist,2);return false;});
		Popup.show(popup,false);
		if (!event) var event=window.event;
		if (event) event.cancelBubble = true;
		if (event && event.stopPropagation) event.stopPropagation();
	},
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		if (config.options.chkTiddlyPodAutoPlay==undefined)
			config.options.chkTiddlyPodAutoPlay=true; // default enable auto play
		if (config.options.chkTiddlyPodLoopPlay==undefined)
			config.options.chkTiddlyPodLoopPlay=false; // default disable loop play
		if (config.options.chkTiddlyPodNowPlaying==undefined)
			config.options.chkTiddlyPodNowPlaying=0; // default to first item in playlist
		while (p=params.shift()) {
			if (p=="autoplay")
				config.options.chkTiddlyPodAutoPlay=true; // enable auto play
			if (p=="noautoplay")
				config.options.chkTiddlyPodAutoPlay=false; // disable auto play
			else if (p=="loop")
				config.options.chkTiddlyPodLoopPlay=true; // enable loop play
			else if (p=="noloop")
				config.options.chkTiddlyPodLoopPlay=false; // disable loop play
			else if (p=="verbose")
				this.verbose=true; // enable message display
			else if (p.substr(0,1)=="@")
				this.playlist=p.substr(1); // alternative playlist tiddler 
			else if (p.substr(0,6)=="track:")
				config.options.txtTiddlyPodNowPlaying=p.substr(6)-1; // initial playlist index (0-based, e.g. track #1=index 0)
			else if (p.substr(0,6)=="width:")
				this.width=p.substr(6); // width of embedded player controls
			else if (p.substr(0,7)=="height:")
				this.height=p.substr(7); // height of embedded player controls
			else if (p.substr(0,11)=="size:")
				this.size=p.substr(11); // height of playlist in popup
		}
		this.play(createTiddlyElement(place,"span"),config.options.txtTiddlyPodNowPlaying);
	}
}
//}}}
http://www.tiddlyspot.com
http://www.tiddlytools.com
http://www.tiddlywiki.com
This tiddler is an example of an automatic "to do" list generator, where each "to do" item is stored in a separate, tagged tiddler: 
<<<
{{valignTop{
| ''<<tag [[To Do]] "Pending tasks">>'' | ''<<tag Done "Completed tasks">>'' |
|<<matchTags {{"<<tiddler CheckboxToggleTag with: Done [[To Do]] %0\>\> %0"}} "\n" To Do>>|<<matchTags {{"<<tiddler CheckboxToggleTag with: Done [[To Do]] %0\>\> %0"}} "\n" Done>>|
}}}
----
The following syntax:
{{{
<<matchTags {{"<<tiddler CheckboxToggleTag with: Done [[To Do]] %0\>\> %0"}} "\n" To Do OR Done>>
}}}
combines the {{{<<matchTags>>}}} macro (defined by [[MatchTagsPlugin]]) with the [[CheckboxToggleTag]] inline script (requires [[InlineJavascriptPlugin]]) to output a list of checkboxes and corresponding tiddler titles, one for each matched tiddler.  Setting/clearing any given checkbox toggles that tiddler between the two alternative tag values and also auto-refreshes the list display.

You can also display separate lists of //pending tasks// (tagged with <<tag [[To Do]]>>) and //completed tasks// (tagged with <<tag Done>>) by using two instances of the above syntax, each with different tag expressions for matching the appropriate tiddlers:
{{{
<<matchTags {{"<<tiddler CheckboxToggleTag with: Done [[To Do]] %0\>\> %0"}} "\n" To Do>>
<<matchTags {{"<<tiddler CheckboxToggleTag with: Done [[To Do]] %0\>\> %0"}} "\n" Done>>
}}}
<<<
/***

|Name|ToggleSideBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#ToggleSideBarMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button for toggling visibility of the SideBar. You can choose whether the SideBar should initially be hidden or displayed.

!Demo
<<toggleSideBar "Toggle Sidebar">>

!Usage:
{{{<<toggleSideBar>>}}} <<toggleSideBar>>
additional options:
{{{<<toggleSideBar 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:
{{{ .HideSideBarButton {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.toggleSideBar={};

config.macros.toggleSideBar.settings={
         styleHide :  "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
         styleShow : " ",
         arrow1: "<",
         arrow2: ">"
};

config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
          var tooltip= params[1]||'toggle sidebar';
          var mode = (params[2] && params[2]=="hide")? "hide":"show";
          var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
          var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;
          var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
          if (mode == "hide")
             { 
             (document.getElementById("sidebar")).setAttribute("toggle","hide");
              setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
             }
};

config.macros.toggleSideBar.onToggleSideBar = function(){
          var sidebar = document.getElementById("sidebar");
          var settings = config.macros.toggleSideBar.settings;
          if (sidebar.getAttribute("toggle")=='hide')
             {
              setStylesheet(settings.styleShow,"ToggleSideBarStyles");
              sidebar.setAttribute("toggle","show");
              this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
              }
          else
              {    
               setStylesheet(settings.styleHide,"ToggleSideBarStyles");
               sidebar.setAttribute("toggle","hide");
               this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
              }

     return false;
}

setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 20px;}\n","ToggleSideBarButtonStyles");

//}}}
<<toggleSideBar '' 'Toggle the sidebar' show>>[[?|What is this?]] [[About]] | [[ASCIIMathML|http://www1.chapman.edu/~jipsen/mathml/asciimath.html]]
!Active tickets <<tag open>>
!Closed tickets <<tag closed>>
/***
Description: Contains the stuff you need to use Tiddlyspot
Note, you also need [[UploadPlugin]], [[PasswordOptionPlugin]] and [[LoadRemoteFileThroughProxy]]
from http://tiddlywiki.bidix.info for a complete working Tiddlyspot site.
***/
//{{{

// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'mathnotebook';

// 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?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
 "<<tiddler TspotControls>>",
 "See also GettingStarted.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki.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 :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),

'TspotControls':[
 "| tiddlyspot password:|<<option pasUploadPassword>>|",
 "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
 "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[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")

});
//}}}
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 16/09/2009 08:50:19 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . | ok |
| 16/09/2009 08:53:49 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . | ok |
| 16/09/2009 08:55:25 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . |
| 16/09/2009 09:05:35 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . | ok |
| 16/09/2009 09:08:41 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . | ok |
| 16/09/2009 09:19:20 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . | ok |
| 16/09/2009 09:24:34 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . |
| 19/09/2009 10:50:03 | FrancoBagnoli | [[/|http://mathnotebook.tiddlyspot.com/]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] | . |
| 30/09/2009 10:04:42 | YourName | [[mathnotebook.html|file:///F:/franco/onda%20solitaria/mathnotebook.html]] | [[|file:///F:/franco/onda%20solitaria/]] | . | [[mathnotebook.html | file:///F:/franco/onda%20solitaria/mathnotebook.html]] |  | failed |
| 30/09/2009 10:05:33 | YourName | [[mathnotebook.html|file:///F:/franco/onda%20solitaria/mathnotebook.html]] | [[store.cgi|http://mathnotebook.tiddlyspot.com/store.cgi]] | . | [[index.html | http://mathnotebook.tiddlyspot.com/index.html]] |  |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''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|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 4, minor: 1, revision: 3,
	date: new Date("Feb 24, 2008"),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0'
};

//
// 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
		if (!params) params = {};
		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}
				
			]);
	},
	options: [
		"txtUploadUserName",
		"pasUploadPassword",
		"txtUploadStoreUrl",
		"txtUploadDir",
		"txtUploadFilename",
		"txtUploadBackupDir",
		"chkUploadLog",
		"txtUploadLogMaxLine"		
	],
	refreshOptions: function(listWrapper) {
		var opts = [];
		for(i=0; i<this.options.length; i++) {
			var opt = {};
			opts.push();
			opt.option = "";
			n = this.options[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 = new 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,username,password,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 = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
		var rssString = generateRss();
		// no UnicodeToUTF8 conversion needed when location is "file" !!!
		if (document.location.toString().substr(0,4) != "file")
			rssString = convertUnicodeToUTF8(rssString);	
		bidix.upload.httpUpload(rssUploadParams,rssString,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 == 404)
			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; ;charset=UTF-8; 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');


// Backstage
merge(config.tasks,{
	uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");


//}}}

(:graph({width:300,coords:'none'})
 a=-2
 text([a,2],"$(A \\cap B) \\cup C$",{pos:"n"})
 text([a-1.8,1],"A")
 text([a+1.5,1],"B")
 text([a+0,-2.5],"C")
 setOptions({fill:"red"});
 arc({start:[a,0.866],end:[a,-0.866],radius:1})
 arc({start:[a,-0.866],end:[a,0.866],radius:1})
 circle([a,-0.866],1)
 setOptions({fill:"none"});
 circle([a-.5,0],1)
 circle([a+.5,0],1)
 a=2
 text([a,2],"$(A \\cup C) \\cap B$",{pos:"n"})
 text([a-1.8,1],"A")
 text([a+1.5,1],"B")
 text([a,-2.5],"C")
 setOptions({fill:"red"});
 arc({start:[a,0.866],end:[a,-0.866],radius:1})
 arc({start:[a,-0.866],end:[a,0.866],radius:1})
 arc({start:[a+1,-0.866],end:[a-.5,0],radius:1})
 arc({start:[a-.5,0],end:[a+1,-0.866],radius:1})
 setOptions({fill:"none"});
 circle([a,-0.866],1)
 circle([a-.5,0],1)
 circle([a+.5,0],1)
:)
This is a  [[TiddlyWiki|http://www.tiddlywiki.com]] (version <<version>> ©2009 [[UnaMesa|http://www.unamesa.org]]). Um ~TiddlyWiki é uma excelente ferramenta para colocar //online// informação fragmentada de uma forma muito eficiente. According to its author, Jeremy Ruston:
>A ~TiddlyWiki is like a blog because it's divided up into neat little chunks, but it encourages you to read it by hyperlinking rather than sequentially: if you like, a non-linear blog analogue that binds the individual microcontent items into a cohesive whole.
!usage
{{{[img[application_add.png]]}}}
[img[application_add.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/application_add.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH9SURBVDjLpZM9aFRREIW/ue9FF2IULDQuaYIGtTBRWGFJAgqSUsEmjZVgo4mFWBiwVVjBHwjGwsbCShExIAghoEUMARGNGFJYhIC7isXGRbORvJ0Zi/dWY5fFCwOnuHz3nDsz4u78z5HTlx6NDB4v3KjWvd0dMMPNUFPcHHPDVTF3XBU1Y/uWZHVxsXzl6e3hibgwUBhvy7WH3bmWHm5fres4MBHXEw/16s+Wra8lHgBiV+f6mX0tA86VlkkBbgCsNxQH3Bw1MBwzR83Qhqflxro63Z0dqGkKIOuCBEHc8SC4OGJCCIJIQESRyIksEDfS+9bIAE1SAFwEBCIHEzBzIocgEbGAiqMhdWxqWQTL5kAE3P8BiYCrYwIuQBAii1JAM0JTpAxJxQaQxUJsxvTbSV7NP6e2ukLSSFjT/cBJ4kaS/HEggLsjIvgG0Is3T3hfnuLYwFG6dvbwcuEZcx+nKY7mbwbPskSAZC4k00GEIMLk64ccPtCHBqVvzxAqCcVD/QAjwcz+Rsg+M4gQbahv37/QJts4dfAiAJdP3Gfvrl6AXFxeWn58/k4ybKqYGqqKmaFJgplh7lRrKyxUZpmvzDA29IDS1Fly0VaAX7KZbSyO5q91de+42t87SE/nET59fcfshxk+L9VuyWbXuTiaLwEXgA7gB3Bv7m5l7Dd8kw6XoJxL0wAAAABJRU5ErkJggg==
!usage
{{{[img[application_form_edit.png]]}}}
[img[application_form_edit.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/application_form_edit.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJcSURBVDjLpZPvS1NRGMfvv9Db6FUvIpDqLwj6AZER1EhBkvTFTALNlWJrkwKRoWKGjZltaUmuYmsIq7SEtrSt1qakzh/TtunSdq9j8253u3fL1vh27t2KNAqsAx+ecw7n+z0PzzkPBYD6HyjZZVNNpzXINz0OQP2IYPwI1YMFXOmfQ+O9WTT0eVFvmMQl/Qcobo+jVueG2uDkRZ1koLEEc9qRNWwXRddYTjIQb/4XqjtGIRmojX6k0+ltI2+15Q1UA4sQBAG8BA+e56W5w+H4jQmbDgsPy+C3ajDVdwzT3UUVlFiwZDKJshbvT1JkLQp+HQJtBWNXIuF9DqTCiHstcN04vkaJ1U5wHLgEgUsUIrfJQKCHwM43Y2P1KZjRDqRnBvEt5MTM/eoMJT4Vy8YRj8elKBFnSWTJHovoEhHPXkMu7UQ6WIt1z0X4BuRw6+XwaGV7qIbeacRiMUQLiPNYNCZl4LF1g51RIZdxQQhUIrNSjuS8GqH+06i73psvoqJnApFIZFMNxPXrwXYw48qCuAKZT2fBzTZhyXASjM+JkkZL3qBO5wHDMIS1QmTge2fE/MtGkvYbZJbl+LJyDgmSSUB/Al85WjpzpsGcN6jVvkc4TBPCoAnuoR7MDasx/aILn92lEJbLsT51Ff67p7C6OAmaFs/RkNWb8KMXTBduOqSfVdVmh7n9KJAMYcFQArt6J97eKcZw8yHUqPQk7SfkZhOIRsQkGWztrpbzRdkNlw4b7ltwaw7DXLUrNaLaf+CP3bh1o/Tgjkxr5d6sra04+6rzyNgz5b7df2vn7z39IYTVO0xbAAAAAElFTkSuQmCC
!usage
{{{[img[arrow_undo.png]]}}}
[img[arrow_undo.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/arrow_undo.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIJSURBVDjLpVM9aJNRFD35GsRSoUKKzQ/B0NJJF3EQlKrVgijSCBmC4NBFKihIcXBwEZdSHVoUwUInFUEkQ1DQ4CKiFsQsTrb5xNpgaZHw2Uog5t5zn0NJNFaw0guX97hwzuPcc17IOYfNlIdNVrhxufR6xJkZjAbSQGXjNAorqixSWFDV3KPhJ+UGLtSQMPryrDscPwLnAHOEOQc6gkbUpIagGmApWIb/pZRX4fjj889nWiSQtgYyBZ1BTUEj6AjPa0P71nb0Jfqwa+futIheHrzRn2yRQCUK/lOQhApBJVQJChHfnkCqOwWEQ+iORJHckUyX5ksvAEyGNuJC+s6xCRXNHNxzKMmQ4luwgjfvZp69uvr2+IZcyJ8rjIporrxURggetnV0QET3rrPxzMNM2+n7p678jUTrCiWhphAjVHR9DlR0WkSzf4IHxg5MSF0zXZEuVKWKSlCBCostS8zeG7oV64wPqxInbw86lbVXKEQ8mkAqmUJ4SxieeVhcnANFC02C7N2h69HO2IXeWC8MDj2JnqaFNAMd8f3HKjx6+LxQRmnOz1OZaxKIaF1VISYwB9ARZoQaYY6o1WpYCVYxt+zDn/XzVBv/MOWXW5J44ubRyVgkelFpmF/4BJVfOVDlVyqLVBZI5manPjajDOdcswfG9k/3X9v3/vfZv7rFBanriIo++J/f+BMT+YWS6hXl7QAAAABJRU5ErkJggg==
!usage
{{{[img[asterisk_yellow.png]]}}}
[img[asterisk_yellow.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/asterisk_yellow.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ5SURBVDjLpZPNS1RhFMaff2EWLWo5tGnRaqCFRBAM0cZFwVSQpVHNQAWVMQwaSSZWtimLiKnsO5lEjKzs4y1zRK3oItfMj1FnnJkaUtNrjo45H3eejpCKNa5anMX73vs855zfOS9I4n9i2SHbCpvph8q8A9PNcCzcz76EM9EETj+DmmqENaeBiJ3mRyuzQy5mwyVMKqiFbzNN0MxgKZOd2zj5GMZE/ZL5ooHZAntGW89s7Bw5Ws25llWcfQHrzHPYE/51ZOQ0M4Fiitj4UQdbzhZSb+FJ63ZypJqp7p0UsTf+FN6kvoMMl3GmNY9jj+BckcF8/HoFldLzpZIqxhthJPVdkr2cifdb5sXefyAKLFvyzVJJAssisIxstILZ0DEyeJzpHifHfNBGamFZ+C9yC7bhG7BBxCrZZqWQpoiNP6S1TMBFDh4gA0VMdxfy+0NosftQX+8gGKkBY741HLoGhbnXUOZwKTn+gGa4nOlBN9MDxdJzCTmwj+wvEKPDTPUc5Zx+kOk+NxmqZOJTIXsviYGQVgKLAos/n0CbbIAS0ir1eY9kF4O+3UzpBYzehhaugQpdR3DwKth7EeyqEoO/oYzXwyKwDDN0ipme/VKFi0l9L8M3oYW8SwxWnIKI1XT7Vqb6i/ntLoLTHdulhROcUJsZuJJjCsvEPpyf8m8io5U0VB6FtFNIe6da84XFEcYaNrDzLDw5DUZ9cEwqm6zxGWYGPBTShogtQtoerV0rLA5JKy5+ubya7SdzbKKMyRG7ByPeIfvebKfAWszUdQFavKOI0bqNbCuF4XfneAvzIaStQrpOxEpIL746rQKOD2VQbSXwtLiXg/wNTNvAOhsl8oEAAAAASUVORK5CYII=
!usage
{{{[img[camera.png]]}}}
[img[camera.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/camera.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIrSURBVDjLxVPLjhJBFD3V3dCYSZjwDipDRjCOCcTgLGalJmxYufAD0E/QHV9g3LjSsGDhik/QjTEaTdgaEsQQINEFJjwEecmr6Yf3lkJmPwsruXWrq+85dc+9VcJxHFxkKLjg0HgqlUpP1+t1drvdXrIsS2w2G9dqtXKzt21b6Lpu+P3+N4VC4QnH5/P5U3Lfy+XyL1EsFg9VVZ1kMhmwHAJIa1Tf4eH96zC+vcKLDyfwRm6i1Wo/Go/HLwnsJWPtZ2oikainUil/JBJBp9NBr9fDcDjE5aMTfPz8E835bdw6vQMhBLrd7gNFUXSPxwNN08RsNrur0alJr9eLer2OcDiMdDoNkgKSglAohEajgUqlgkAggGw2i36/j8lkImOazeYNjQMHgwGCwSC2B0d4/n6FhSlgU366cOHe1Wvwz+eUfgucJQPb7Tai0aiUqvC0WCwQi8Xw+ouBjaPA4yJzK7AUFz79OJDA0WgkwYZhgAq8z1JjAqq2tN+Wm4AqNGouXw9Bk+G4QR2SxmCO4zV7mQGz7Fh5OI79F0wkCpmqCCyXSxlzPoM9wS4DqijcjgHTJv22Q+k5ksiNFabTqQSapilJOJ79noAZa7UaMoc9qOYSG9oziUSxlriy+YpqtbrXvSPZEWjMxidwewLjMc6Oj2VxOGBO1WdivhvJZFLusf54PC5lMYHI5XKPqa/P6EP3+XyCry4T8E/2BHDoEIdv6fmH92/9Vvz31/gHd9iUVZFEDKoAAAAASUVORK5CYII=
!usage
{{{[img[cog.png]]}}}
[img[cog.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/cog.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGSSURBVCjPVVFNSwJhEF78Ad79Cf6PvXQRsotUlzKICosuRYmR2RJR0KE6lBFFZVEbpFBSqKu2rum6llFS9HHI4iUhT153n6ZtIWMOM+/MM88z7wwH7s9Ub16SJcnbmrNcxVm2q7Z8/QPvEOtntpj92NkCqITLepEpjix7xQtiLOoQ2b6+E7YAN/5nfOEJ2WbKqOIOJ4bYVMEQx4LfBBQDsvFMhUcCVU1/CxVXmDBGA5ZETrhDCQVcYAPbyEJBhvrnBVPiSpNr6cYDNCQwo4zzU/ySckkgDYuNuVpI42T9k4gLKGMPs/xPzzovQiY2hQYe0jlJfyNNhTqiWDYBq/wBMcSRpnyPzu1oS7WtxjVBSthU1vgVksiQ3Dn6Gp5ah2YOKQo5GiuHPA6xT1EKpxQNCNYejgIR457KKio0S56YckjSa9jo//3mrj+BV0QQagqGTOo+Y7gZIf1puP3WHoLhEb2PjTlCTCWGXtbp8DCX3hZuOdaIc9A+aQvWk4ihq95p67a7nP+u+Ws+r0dql9z/zv0NCYhdCPKZ7oYAAAAASUVORK5CYII=
!usage
{{{[img[cross.png]]}}}
[img[cross.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/cross.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIhSURBVDjLlZPrThNRFIWJicmJz6BWiYbIkYDEG0JbBiitDQgm0PuFXqSAtKXtpE2hNuoPTXwSnwtExd6w0pl2OtPlrphKLSXhx07OZM769qy19wwAGLhM1ddC184+d18QMzoq3lfsD3LZ7Y3XbE5DL6Atzuyilc5Ciyd7IHVfgNcDYTQ2tvDr5crn6uLSvX+Av2Lk36FFpSVENDe3OxDZu8apO5rROJDLo30+Nlvj5RnTlVNAKs1aCVFr7b4BPn6Cls21AWgEQlz2+Dl1h7IdA+i97A/geP65WhbmrnZZ0GIJpr6OqZqYAd5/gJpKox4Mg7pD2YoC2b0/54rJQuJZdm6Izcgma4TW1WZ0h+y8BfbyJMwBmSxkjw+VObNanp5h/adwGhaTXF4NWbLj9gEONyCmUZmd10pGgf1/vwcgOT3tUQE0DdicwIod2EmSbwsKE1P8QoDkcHPJ5YESjgBJkYQpIEZ2KEB51Y6y3ojvY+P8XEDN7uKS0w0ltA7QGCWHCxSWWpwyaCeLy0BkA7UXyyg8fIzDoWHeBaDN4tQdSvAVdU1Aok+nsNTipIEVnkywo/FHatVkBoIhnFisOBoZxcGtQd4B0GYJNZsDSiAEadUBCkstPtN3Avs2Msa+Dt9XfxoFSNYF/Bh9gP0bOqHLAm2WUF1YQskwrVFYPWkf3h1iXwbvqGfFPSGW9Eah8HSS9fuZDnS32f71m8KFY7xs/QZyu6TH2+2+FAAAAABJRU5ErkJggg==
!usage
{{{[img[css.png]]}}}
[img[css.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/css.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGeSURBVDjLxVNNS0JRED3qA0MRoqCFouBGN9Yia9HGRa3b9x/6M62jf9CuTS0EV0arXASG0gcUYWIgmvi6792P7sz1WUI7Fw0Mc70z59wz88aYMQbLWBxL2tIEXrN5+mcPWkvrBsZQVNYDSKmglLTZ0J4lwjCER8XZ7OYcSDMxRs/cEdCZSKKoNeUU7u/rjoBMiE8GuKQrcCA1A0XuFK2sZKwC3xE4Zo1UahX5/Dam0yH6/Q4KhV17H+Lu7gKVyiESCQ/dbgPD4QvfSykQlzKcMxP4+fnGJr4seAdPT01MJh8oFve4uNOp20fWQBilQqvAEtBQqE+6IBuPe3h8bML3hyiX95FOr6HXayOT2UCpdIDR6I1r6VF6KK61z5N1ROAkvdBuX+H6+oznksttodE4wevrLbdC8h1GwCMZJF+pgIdSrR6xtCCYWLnrnBuP31GrHfN5MHhgcDRUj3pzbAFarfOFSUf++4tEA3dRwhNCsKRkMv2r+Oe7R7+jvbArNotu/6wC3/Z7yX3TdhkjbDS8eUTi5EoGuLhosX//N34Dm6aVPfzbYjIAAAAASUVORK5CYII=
!usage
{{{[img[delete.png]]}}}
[img[delete.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/delete.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==
A learning object is a piece of information that may constitute a lesson, with relative exercises. The idea is that of specifying, for each object, the set of prerequisites needed to understand the lesson. Each object moreover specifies the piece of knowledge furnished, the time required to be assimilated, and maybe the level of difficulty. These two last quantities are measured
!usage
{{{[img[disk.png]]}}}
[img[disk.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/disk.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH+SURBVBgZBcE9i11VGAbQtc/sO0OCkqhghEREAwpWAWUg8aMVf4KFaJEqQtAipTZWViKiCGOh2Ap2gmJhlSIWFsFOxUK0EsUM3pl79n4f12qHb3z3Fh7D83gC95GOJsDe0ixLk5Qq/+xv/Lw9Xd+78/HLX3Y8fXTr2nWapy4eCFKxG7Fby97SnDlYtMbxthyfzHO//nl85fNvfvnk8MbX5xa8IHx1518Vkrj54Q+qQms2vVmWZjdiu5ZR2rT01166/NCZg/2PFjwSVMU6yjoC1oq+x6Y3VbHdlXWExPd379nf7Nmejv2Os6OC2O4KLK0RNn3RNCdr2Z5GJSpU4o+/TkhaJ30mEk5HwNuvX7Hpi76wzvjvtIwqVUSkyjqmpHS0mki8+9mPWmuWxqYvGkbFGCUAOH/+QevYI9GFSqmaHr5wkUYTAlGhqiRRiaqiNes6SOkwJwnQEqBRRRJEgkRLJGVdm6R0GLMQENE0EkmkSkQSVVMqopyuIaUTs0J455VLAAAAAODW0U/GiKT0pTWziEj44PZ1AAAAcPPqkTmH3QiJrlEVDXDt0qsAAAAAapa5BqUnyaw0Am7//gUAAAB49tEXzTmtM5KkV/y2G/X4M5fPao03n/sUAAAAwIX7y5yBv9vhjW/fT/IkuSp5gJKElKRISYoUiSRIyD1tufs/IXxui20QsKIAAAAASUVORK5CYII=
!usage
{{{[img[exclamation.png]]}}}
[img[exclamation.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/exclamation.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJPSURBVDjLpZPLS5RhFMYfv9QJlelTQZwRb2OKlKuINuHGLlBEBEOLxAu46oL0F0QQFdWizUCrWnjBaDHgThCMoiKkhUONTqmjmDp2GZ0UnWbmfc/ztrC+GbM2dXbv4ZzfeQ7vefKMMfifyP89IbevNNCYdkN2kawkCZKfSPZTOGTf6Y/m1uflKlC3LvsNTWArr9BT2LAf+W73dn5jHclIBFZyfYWU3or7T4K7AJmbl/yG7EtX1BQXNTVCYgtgbAEAYHlqYHlrsTEVQWr63RZFuqsfDAcdQPrGRR/JF5nKGm9xUxMyr0YBAEXXHgIANq/3ADQobD2J9fAkNiMTMSFb9z8ambMAQER3JC1XttkYGGZXoyZEGyTHRuBuPgBTUu7VSnUAgAUAWutOV2MjZGkehgYUA6O5A0AlkAyRnotiX3MLlFKduYCqAtuGXpyH0XQmOj+TIURt51OzURTYZdBKV2UBSsOIcRp/TVTT4ewK6idECAihtUKOArWcjq/B8tQ6UkUR31+OYXP4sTOdisivrkMyHodWejlXwcC38Fvs8dY5xaIId89VlJy7ACpCNCFCuOp8+BJ6A631gANQSg1mVmOxxGQYRW2nHMha4B5WA3chsv22T5/B13AIicWZmNZ6cMchTXUe81Okzz54pLi0uQWp+TmkZqMwxsBV74Or3od4OISPr0e3SHa3PX0f3HXKofNH/UIG9pZ5PeUth+CyS2EMkEqs4fPEOBJLsyske48/+xD8oxcAYPzs4QaS7RR2kbLTTOTQieczfzfTv8QPldGvTGoF6/8AAAAASUVORK5CYII=
Keep an eye on Firefox 3 implementation of ''foreignObject'' for ~MathML inclusion in SVG
!usage
{{{[img[help.png]]}}}
[img[help.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/help.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKkSURBVDjLpZPdT5JhGMb9W+BPaK3matVqndXWOOigA6fmJ9DUcrUMlrN0mNMsKTUznQpq6pyKAm8CIogmypcg8GIiX8rHRHjhVbPt6o01nMvZWge/k3vP9duuZ/edAyDnf/hjoCMP2Vr3gUDj3CdV6zT1xZ6iFDaKnLEkBFOmPfaZArWT5sw60iFP+BAbOzTcQSqDZzsNRyCNkcVoaGghzDlVQKylOHJrMrUZ2Yf52y6kc36IxpyoH1lHF7EBgyMKV4jCJ5U/1UVscU4IZOYEa3I1HtwI01hwxlDLhDoJD/wxGr5YGmOLAdRIrVCuhmD3JdA6SQabx12srGB0KSpc86ew4olDOGjH4x4z0gdHDD9+c4TaQQtq+k2Yt0egXYugTmoVZgV9cyHSxXTtJjZR3WNCVfcK/NE0ppYDUNu2QTMCtS0IbrsOrVMOWL27eNJtJLOCDoWXdgeTEEosqPxoBK/TwDzWY9rowy51gJ1dGr2zLpS2aVH5QQ+Hbw88sZ7OClrGXbQrkMTTAQu4HXqUv9eh7J0OSfo7tiIU+GItilpUuM/AF2tg98eR36Q+FryQ2kjbVhximQu8dgPKxPMoeTuH4tfqDIWvCBQ2KlDQKEe9dBlGTwR36+THFZg+QoUxAL0jgsoOQzYYS+wjskcjTzSToVAkA7Hqg4Spc6tm4vgT+eIFVvmb+eCSMwLlih/cNg0KmpRoGzdl+BXOb5jAsMYNjSWAm9VjwesPR1knFilPNMu510CkdPZtqK1BvJQsoaRZjqLGaTzv1UNp9EJl9uNqxefU5QdDnFNX+Y5Qxrn9bDLUR6zjqzsMizeWYdG5gy6ZDbk8aehiuYRz5jHdeDTKvlY1IrhSMUxe4g9SuVwpdaFsgDxf2i84V9zH/us1/is/AdevBaK9Tb3EAAAAAElFTkSuQmCC
!usage
{{{[img[html.png]]}}}
[img[html.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/html.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHUSURBVDjLxZM7a1RhEIafc3J2z6qJkIuCKChItBNSBQ0iIlZiK4gWItj6HwRbC7FRf4CVnSCIkH9gJVjYiCDximCyZ7/zfXOz2A0I2qVwmmFg3rm870wVEezFavZoey7Q3Hv+/Z87qDsiTlZFBJIGKStZlFSCTpyUlAZgfXXfH9BAPTCberVANBB3RAJRR8wp6jzd/DotALA9UcyZgZxis2QNijpZjSJBVqeIszTfkMY65cAjuHxmgSzGlbUFrp1d5ObGErcuLLNxep5hU3H93AqjYcXti4cZZ2OSDU9CnVURddqmIovTDmoev/5GVcGDF585tjzg1JGWo0tDDgxrThxq6XojieOd0nRZ6dVpBxU3zi/T1BVdViKCcTbcYX11ngB6cca9MSlGlprojHqcglycVJyHL79Q1Jn0TgBdb1gEbz9OeL81IYsRAakYvQSeC/WvVOiLE8GsM4xnvsuGe/Do1RY/dpRenIP753hyZxURJ3JQXbr/Lq6uLfLpZ6aIk9XJssv8VK5dNcQcmcl7fKVl89kHmu0dJRVjYTRHGVSMpELaQLVCtEY8EAvMHHUwn067+0LVybtvok9KSODZiaKEOJENihPm01gD3P+62Oq/f+Nv2d9y2D8jLUEAAAAASUVORK5CYII=
!usage
{{{[img[i4logo.gif]]}}}
[img[i4logo.gif]]
!notes
&copy; 1995 ELS Design Studios - do not use without explicit prior permission
!type
image/gif
!file
./images/i4logo.gif
!url

!data
data:image/gif;base64,R0lGODlhIwAoALMAAAAAAAAQAAAYAAAhAAApAAAxAABCAABSAABeAAB2AACMAACUAACcAAClAACtAADGACH5BAEAAAAALAAAAAAjACgAQAT+EMhJq704S/WewQoTBJ2jaUinriyTFaupJZ1yAqlq33zPGyrBScD6SAIMBIX4kF0GigbrEdDAHovbtePyaQLSVcFLLlMGDaUZ1AirT5zVgILcAWiP9wnpMG66FHEJBAp2GQEIaXAdYydbHXoXDB0EPJMqfmsVYR2ZmhMslZ8Sj1MJo6gXAUKpFQQOHq0TByqAPAenGSFIjD1xDw0WAQs7QA+GGQNTrABIuRJSDnM8eH2ByDk2AciHgU2F4L+YZQjh4bDAhdMYAQa/jewqVRnGLNwVeM8aTCXrF/w9ctSAgwDBvD0smKUSF2kUvw4HF65o+KkepVaEpjgwOIoAAgMKBAqMCFkwopkIAAA7
!usage
{{{[img[information.png]]}}}
[img[information.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/information.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKcSURBVDjLpZPLa9RXHMU/d0ysZEwmMQqZiTaP0agoaKGJUiwIxU0hUjtUQaIuXHSVbRVc+R8ICj5WvrCldJquhVqalIbOohuZxjDVxDSP0RgzyST9zdzvvffrQkh8tBs9yy9fPhw45xhV5X1U8+Yhc3U0LcEdVxdOVq20OA0ooQjhpnfhzuDZTx6++m9edfDFlZGMtXKxI6HJnrZGGtauAWAhcgwVnnB/enkGo/25859l3wIcvpzP2EhuHNpWF9/dWs/UnKW4EOGDkqhbQyqxjsKzMgM/P1ymhlO5C4ezK4DeS/c7RdzQoa3x1PaWenJjJZwT9rQ1gSp/js1jYoZdyfX8M1/mp7uFaTR8mrt29FEMQILr62jQ1I5kA8OF59jIItVA78dJertTiBNs1ZKfLNG+MUHX1oaURtIHEAOw3p/Y197MWHEJEUGCxwfHj8MTZIcnsGKxzrIURYzPLnJgbxvG2hMrKdjItjbV11CYKeG8R7ygIdB3sBMFhkem0RAAQ3Fuka7UZtRHrasOqhYNilOwrkrwnhCU/ON5/q04vHV48ThxOCuoAbxnBQB+am65QnO8FqMxNCjBe14mpHhxBBGCWBLxD3iyWMaYMLUKsO7WYH6Stk1xCAGccmR/Ozs/bKJuXS39R/YgIjgROloSDA39Deit1SZWotsjD8pfp5ONqZ6uTfyWn+T7X0f59t5fqDhUA4ry0fYtjJcWeZQvTBu4/VqRuk9/l9Fy5cbnX+6Od26s58HjWWaflwkusKGxjm1bmhkvLXHvh1+WMbWncgPfZN+qcvex6xnUXkzvSiYP7EvTvH4toDxdqDD4+ygT+cKMMbH+3MCZ7H9uAaDnqytpVX8cDScJlRY0YIwpAjcNcuePgXP/P6Z30QuoP4J7WbYhuQAAAABJRU5ErkJggg==
!usage
{{{[img[layout.png]]}}}
[img[layout.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/layout.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFySURBVBgZpcE7a1RBGMfh3xwnRziwBlOoBEG28FYriMSU9oKkTop8AcFWEKystRDEL2BnIVbapdVC8EbAYCEokgsL2T05M+/fd9CFRTcYyfMESRxGxK08fHMLOANcAy6BhAiYqKpAFcDMsMz2TNT6+dPHLmPi9s0LAUksP3j9WP/p/tN3ckR+WcQ9WdtkTOxvdWGOD1+2W1ykMJ3it7MnjlKEwFQfv7UUw1FX4yJOUoMT8Ol7y0Eo54CLOJkibnVhjoOybBQRJ1PALd19ycgMEzy/d53PX3eYpj8/iyxTVDiZUfwYdly5eJLNYWKs19T0mppeU9NrasaUMkWFk4liMMp0ErttYlKXRZfFJLNEUeGCGUXbdgy7TB51/IvSHkXECTEm8ZeZI4E/SYki4iyZgIB7sbbBpMHuHtPIJFzEZbMNoP/20Q0m9edn2Y+kLVykyPZs6c6rc5KuYnbcLIEMWUaWQBmZIQmQwAZQvccFSRzGT6Th9AjEKBwhAAAAAElFTkSuQmCC
!usage
{{{[img[page.png]]}}}
[img[page.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAINSURBVBgZBcG/r55zGAfg6/4+z3va01NHlYgzEfE7MdCIGISFgS4Gk8ViYyM2Mdlsko4GSf8Do0FLRCIkghhYJA3aVBtEz3nP89wf11VJvPDepdd390+8Nso5nESBQoq0pfvXm9fzWf19453LF85vASqJlz748vInb517dIw6EyYBIIG49u+xi9/c9MdvR//99MPPZ7+4cP4IZhhTPbwzT2d+vGoaVRRp1rRliVvHq+cfvM3TD82+7mun0o/ceO7NT+/4/KOXjwZU1ekk0840bAZzMQ2mooqh0A72d5x/6sB9D5zYnff3PoYBoWBgFKPKqDKqjCpjKr//dcu9p489dra88cydps30KswACfNEKanSaxhlntjJ8Mv12Paie+vZ+0+oeSwwQ0Iw1xAR1CiFNJkGO4wu3ZMY1AAzBI0qSgmCNJsJUEOtJSMaCTBDLyQ0CknAGOgyTyFFiLI2awMzdEcSQgSAAKVUmAeNkxvWJWCGtVlDmgYQ0GFtgg4pNtOwbBcwQy/Rife/2yrRRVI0qYCEBly8Z+P4qMEMy7JaVw72N568e+iwhrXoECQkfH91kY7jwwXMsBx1L93ZruqrK6uuiAIdSnTIKKPLPFcvay8ww/Hh+ufeznTXu49v95IMoQG3784gYXdTqvRmqn/Wpa/ADFX58MW3L71SVU9ETgEIQQQIOOzub+fhIvwPRDgeVjWDahIAAAAASUVORK5CYII=
!usage
{{{[img[page_copy.png]]}}}
[img[page_copy.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page_copy.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIpSURBVDjLddM9aFRBFIbh98zM3WyybnYVf4KSQjBJJVZBixhRixSaShtBMKUoWomgnaCxsJdgIQSstE4nEhNREgyoZYhpkogkuMa4/3fuHIu7gpLd00wz52POMzMydu/Dy958dMwYioomIIgqDa+VnWrzebNUejY/NV6nQ8nlR4ufXt0fzm2WgxUgqBInAWdhemGbpcWNN9/XN27PPb1QbRdgjEhPqap2ZUv5+iOwvJnweT1mT5djZKjI6Ej/udz+wt1OJzAKYgWyDjJWyFghmzFsbtcY2gsTJwv09/Vc7RTgAEQgsqAKaoWsM8wu/z7a8B7vA8cHD3Fr+ktFgspO3a+vrdVfNEulJ/NT4zWngCBYY1oqSghKI465fvYwW+VAatPX07IZmF7YfrC0uDE8emPmilOFkHYiBKxAxhmSRPlZVVa2FGOU2Ad2ap4zg92MDBXJZczFmdflx05VEcAZMGIIClZASdesS2cU/dcm4sTBArNzXTcNakiCb3/HLRsn4Fo2qyXh3WqDXzUlcgYnam3Dl4Hif82dbOiyiBGstSjg4majEpl8rpCNUQUjgkia0M5GVAlBEBFUwflEv12b/Hig6SmA1iDtzhcsE6eP7LIxAchAtwNVxc1MnhprN/+lh0txErxrPZVdFdRDEEzHT6LWpTbtq+HLSDDiOm2o1uqlyOT37bIhHdKaXoL6pqhq24Dzd96/tUYGwPSBVv7atFglaFIu5KLuPxeX/xsp7aR6AAAAAElFTkSuQmCC
!usage
{{{[img[page_edit.png]]}}}
[img[page_edit.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page_edit.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAK5SURBVBgZBcFPaJZ1HADwz+95n3e6uTnREGdljRKtGCYiHTLxkIUmQeeCOnXzVnQIoi5BQV08TMo6GIiHiKI6ZEWgszzEmtpqSDP7s9ycm9NN977vnuf37fNJEWH/G6df6l676vki2YXVSCAhEpFVOU8uzMX36daNV88MH+oApIhw8O2zZz45vOuhokjrgoYAIALC7NKKEz8vmP67fee3XyfWjwwfakMJRSNt6yob68avaRQpkYhMHVlVheWV2r6tffYPjNi4eLyncWCodf7jI1Jr6sUSUkq9EdHoajQkIZALZOpEIWlPf27r4jndQy/oH9xp4c9tJk4de7eEIEGBlAgJREqKRP/yKXVcsH7r4+Ynf9eVOvrWbtK7YUt/CRBB2SBJIiW5Doqkd3nEllWj+gef1r56UldP8tfYhJt3UhTtuR0FRBAoU6FISYFGkaxePG1LfKv/gYNa/30oNW9o9vbpzvOOXj+wsvvwZ5cKCGSkRJGSIiWtK19af/uU/gef1ZoaVjRXdG7db+bMed173zJVD2QoIFdEkBG4fflrPYs/2vjIMzrTxzS6QvvWfWZGRs3tGZY2bFdnoICcQ0QQTI+e1L3wk5W82dWLR2Qtt+fvNnNuwuLeo1LvgNXNpK4CFFBn6iAysxc/8vCel636Z8SlL84a+2be+Hdjlh57R9WzWaDZKFSdCpSQq5AjvPlLx9DkrM74VwZ3POHm7JzJsUk/7PvU9Sv3yipwYlPTSjuDEqqqVtcMrG0a/+Oa9z8Ytnv7oOXNOyw9edyjffeIIIIL1yqRw0qrAiVU7ZyrnKNTS+te/9flFCYlkJdIS5UcRJEUOSnLlKs6V1DCSqueWdPVuOu1oc6aiCgEGdDfXYIIuptJSnKzkRbrKk9BCSnFe0+9cvq5lNLOED0AgkAIIEAr5zxaFk7A/5IUWNTkV3l/AAAAAElFTkSuQmCC
!usage
{{{[img[page_find.png]]}}}
[img[page_find.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page_find.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAMBSURBVBgZBcFLaJxVGIDh9zvn/2cmmWTSJk1oxUu1xCZoi1qvi6gggpRIdd2Niy6KVRChiCBeNiK4KOiiGxGKkNiCpKIhQrzUxiINkmJqQqdt2iQzk8xkkiZNOpfMnHM+n0dUFYBXP774VksmedQIh4AUIAAIoAIacCHMbazpb7K5fnLi9GADQFQVgMOfX5r47t1D/cbIDgWLAgCAKoBSvtdk6J8Niovb1dn/rnX+dXpwOwIAMFb2JyK7Y2YFa0RAQAN4DTin1Jqel3vbee7RiMuh3Kqhb/2ld0Z3iqry0Rdfdy4vFdYsgTeOHufst1/RdJ73Pz2FD4GGU+oNz4u9KWbKitPA+L9Ffp+YG7b5tWrHzq7uTzq7up+/OjVJ/4GnufTHGP0Hn2AuO8O+/Y+DWDxKrE160sqeNsvBPUnOTxb7zX0P7M3MTk8dWy2VuFepc/XKJNve0AyGP8dHqWyuE1khYQ0314TLi44LN6okY4tExpmx82eP16qVtof7HqPn/oco37lLJtPOru7dtLam+encGSIRYmtIJiyphCWViFEMiME80tv3dro9wy8jQ1RW83S2JSjl5vj53DeUlnOMjQwTWyE2QhwZEtaSjAwBUIWoPdPRMvj6EW4t5FiazzLwymEKuXleGzzCcqnM+OgPGBEiq6ACCorgA/gAkXMu6bwnOzvNxmqJ4lIesQYxhts3r1FYmAdAEEQhMhCAVAzeKaaytclifol6rUY+l6OytcXd9Ttcz2ZZXSmyVi4SVPEBFAgKCsTW4BqOKL94+/rI92eoONv7YE+X/LjSwq0bC8zOF6hVq/iuvXx2pQmAKgQAYGh3THM7IKoKwMCHF2vDJ59NfTmT4KkeQ1DwCl4gKCigCqowveI49QIMvHehHgEAuO0QXAja8MjfBU8QRREAgoKgBAU1gglCFElwPrgIAKBZ96V0wu764EAjraoGhQAAdLREAKhCSyyIEGIrW96FgqgqAM+c+PWEa+qbIvKkoq0AACgooCgAKAD1EMKUgaH/AfiQhzSolJNMAAAAAElFTkSuQmCC
!usage
{{{[img[page_go.png]]}}}
[img[page_go.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page_go.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKdSURBVBgZBcFLiFZlGADg5/3OmRlHbbwkpmQ37WZlmBYWIrnRRUnRolVQbcRN7Yp20SLauSvENgaB1C6KdpnlBbHMFl2IMsK7Ntg43mbm/8/53p4nMtO2dw+9Pj4x9koJGzEPAQIZZNXV+vfVK3kgrk29fXjPjgFAZKbnPjh6+NM3N64tJRYnjQQgE9LkjaH9J666dGbu1u+//rH0yJ4dc9BCaeKh0bZZ/Nu/mhJBkJU+q65LM8Pe1gdus+nB1vE6OT/rw1PPvvH1ku8/fH6uQEQszMxmtClGCm3QFJoggiJQrZwYteOple69f2y8nViwDwokAQUlKBFKhBKhRChNuPjfjHsWDj2yNOx85nbNSPMytACZtA0hZITaJyW0DaNZnLqSBrVT68CW1WOiLR20kEmijSKlRJQQyEo2hVFKDbU2UiEKKJCoiKBEKBFKhMgw0oSREr448YLPjm421hYVmUCB2pFJRSIzkUqhRGgb5rqhVcvW+uib9fpKX4EWak2ZSZIS7P12K9kb1M6g66xcssbaFZtcn73p1X336bvPQQt9pU+yUgFdHdj26Gv6rPraq9KF6bPWrdrsxmDGT7e2z3v8/ZlooXapZnrv54GQarCoG+izOn3lL8Pa6erQsB+6Nnfd+ru2uDG85fg/R2Zb6Lpe37NyYsSG5UVNDlyY1fWdOybu1tVen9XF6TOWLlzh5Nmjjv15OmfT4ha6uVq7WnPQi2PnezXSrW7gk2O7DerAbDewZtlaT6/e7sfTR5ybvmR8cs/NUx8/P9PCcLa/vGC0WfbOusGCzCyS+tgvYNF4C17ce6co4yavT/ly1w/TG3YePA8tROTu7W8deikinkg5H0CSSOnG8rmxc1PfxeLLX119ctfBk22xH/4HCmFTpxr5rC8AAAAASUVORK5CYII=
!usage
{{{[img[page_link.png]]}}}
[img[page_link.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page_link.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALQSURBVBgZBcFfaJVlHADg532/bzvNo9MtY1oXRlRWsCREIlFXoaBmUEIkaH9uCsokEIK6qbtg4UVBIN0kFETQnVQ3FmXOxMwg1BApA9GdTdFJbLqzc87763lSRNjy/i+vDgw2dudkLe5AAgmRiKJbyj83r8eP6b+Zd44d3LEAkCLC9g+PH/ty39qHc07LgkoAEAHh2mzHV7/fNHWpfeuvs+eHJw7uaEMNuUqr++tq2bmrqpwSiSj0ouh2w+1Oz5MPLPH4g7WT5dqiKA/NjL313dDRT59pZ0gpLY6Iqr/K+jJ1ospUiZTIEoqVg/12rFvp3vsbA/Vg8xBkCBJk5EROSU5JTklOSa6S1o3bVi3ueGQ4ee2JO1V91QtQA0RQVyRJpKT0gpzUFf2R/X09LJSuUhZsvK8h1bkLNUQQqFMWQiDlJCEKUWX6ySUppRIyKYMaAgUpkSSBQBT6KkDKUi+JHAoigBpKlwgKEiIC5IyS1FUQiSAkvUKvADWUEiKCYL5927k/jpu8eMby4SFTV69b9/ROA0uGHDt8yMhdQ36dmTE0O1iPjb3brKFX6AWdhY4jh7/WiFkv79ltbm7O5cuX/Tbxrap/wM7nnlXXlVarpe/06frI+cEPaijdUCK8980xq69d9NKeXd7+6HOzF064e+UKo6OjWlf+deDAKZOtKevXrze2aaNLly69nqHb7en1qKfOGh5sgqde2W9+oWPXrl02bNhg27Zttm7d6la7440394GlS5c2aui2S+mWEnnpinS5dRL8dGhc9HrGx8c1m00wNzcnlfDJxwdiy+bN6cqVK/M1dOZ7083+avn+7WuaX3x2NE/8fNSLY4+yadT09LQLFy5oNBpWrVplZGREztnEiVO9ycnJqRQR1u39YW+3E88n8VhemF68/Mb3ffeMLEuNRp+EM3OrO920KNYs+rM/KdFuL5RWa3rm1uzMlv8B/jBGW3bkYMYAAAAASUVORK5CYII=
!usage
{{{[img[page_refresh.png]]}}}
[img[page_refresh.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/page_refresh.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALsSURBVBgZBcFtaJVlGMDx/3U/9znz7LjjfMGXYiq1VkkrUiRoZQUhhoOKrAi/hEH0IUHFZQSREu1TQh8CP0TaEBQtIYikfRD3ciSWc0rlWpuzEmbT5TZ1O8fzPPd9Xf1+8uLHvW8XSnXbnbABWAAIAAKYgClBdXz2lp2ROzMd/YfaUwAAAHnps3L/0Z0bHnVOGg0SDAAAzACMqbmMY4OzTF6rVYZ/H1lSPtReAwDwLpGH8z5pvHyTxImAgClEU0Iwqlnk+YcaeKrFM6BT9aaPzDz3/o+Le7/cWgNwIrLQzJJ84sg58AKJg0RABBwCKKtKeYorvmdtc67gS8UjAADOQAAc4AScCE4EJ4ITwSXCv9NV1izMmKtOEOq+JsklrwMAeAAz8AkIgomg0biRjjH03w9cn/uDMB4JaaCpYTVZmKd+5QkHzwLgzcAALw7DMGCyNsb5qe+4r34Jjy9tR02JFlGLBI1UKgNuyxcvXPlp19lmb4ACIiAIBozdHmBZvsjywgqGJgYZmxwlSwNNi1cTQ2T4SqrdHWebAZwGMAMFDDAzrs5cYuj6BU799i3zFcfuZ06ye9Mpbk1XCRVHqLyTtu3fWADwqoaZgYFhAOxYdxAzUIOokeODnWxb/xGL8is58MonvNw5yLlPz1cBfFSIBqagAAAYQVOEHF+V93G3OosavNV2gA+Ovsdc7ZcFT+wKFrLwj9dgqBn7L6YIhgqYCagjvfkhTQ23qcsH9nzzNFkaeLBpLdu3vcHwyJ/09p/r9iFEYoRVpRzrlzvUIBqc7nuN+xtLtDa3Ei3yWMs6okXUIqNXx+npK1+IIR73oaYaVC2NyM8TERXDEJa2nOTvy3uozA+QhcDwyAghDYQsouGBGELc+1fXtR6f3Ys3ivlk2b7WtGhmDgMFABZt/JyOrnep3Jmm3PkrImgh7+627uieGO3a0gPgRezg5r19r4rIk4bVAwBgYIDxJjE5nGvbeSYD7qnqkHccAwD4HyXFhGV2sNBxAAAAAElFTkSuQmCC
!usage
{{{[img[printer.png]]}}}
[img[printer.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/printer.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJtSURBVDjLjZPfS1NhGMfPXfh3OG/E/yBImNkqrYGCzAthh+WNgXihwQYb2CoYukGwsdRLoYUWQbRAhqzc2Q91IrrVhlhLqznL5Tyb23m3s317z1szBzM68Lk47/N9Pud5XjgcAK7OVfM7/a2piE87HalRoLVHStrp1VKvLVi7fE9wns/WaXi58UgoH4kl/CxIyOZ/cyRKSKRFmF/tw/B4p3jl7utLFwp6baHiySnBxheZUkHkM8HKrgSpUsVGWsaDN/tQG/1PLxT02EIlRbBJBZtfZaztlSF8JEgdFqBMdnh8im7LSqWpYHJysqXHFiS5AkGMfi12UP0zRRm+D6fwxvPI0dWu3Q8QvV7f0iCgzQZKnl4WjqkgcVDDeyrYpqLoXoWtsbxTpLUyrlsFDA4O5vv7+w1MQBu7Z2dnEY1GcXsqjCwVJDM1JCixb1Vs0VXCdIoAXSVLBTcfhhEIBDA+Pg6NRtOtCLbpg0wmA7PZ/F8oWUEQMDAwsKsIiCzLUFhfX4coiv8kFAqhnh8bG6txFosFhBDG4uIiUqkUEzVDqc3Pz5/leZ4HZzKZkEgkGG63G8lkEn6/vylKxuFwnOU7OzvBTUxMwOfzMex2O+LxOJaWlpoSi8VgtVrP8u3t7eDoHvB6vQyXywV6Jwyj0YjR0VE2Zl9fH7q6uqBWq9lZPd/W1gZuZGSk6vF42IHSuPD8JZbfBpvybOEFOjo6WHZubg6tra3gDAbDzNDQ0LZOpwPvCqNYIjg6IfhBOcxJSGdL2PtewKeMiKJUBu8MQ6VSKc1bFFPDv8C7ItXhJ2sYdv/lDmOVodR4Z6R6vucXuxIEyKz+W40AAAAASUVORK5CYII=
!usage
{{{[img[script_code.png]]}}}
[img[script_code.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/script_code.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALtSURBVBgZTcFLaFxVAIDh/5577jwzj0wSUmqMtKIiBltbbJ1FUCxVoQu3FrHGVRU3BVcKrkTcKOhCUOtOAyJ23WIQtFawpoooZWKJpnbsNJN5PzP3PO5xArPo93nOOfasXCgfAz48mE8UhzpiqCN0FLFrog7QA+qABVpAA/gC+FYyERlz/NC+qeIbT85xt4GKckMV5Voju6A09ELLzXqfi38PTgLnJBORMfPZmMeectsSeB7SA19CPBAsxgW+EAQ+PLaQZH8uXTj/S+UDwYTVOitxmAh6yqOjoR1CZwSdETR2Yadv2fPm6i2KB9IszQZzkgkVmvnLZcuP21VeO1rgs+tdAu1YOZxlKiHw8fA9iADPdvn5nxa/3epUBGOH39sqjETu2UJG4oUwDB2RcmRSHuevdtjpWgZhxEBH4KDaDflobbNrlVoRh97demHpgfTth+5J5ZpNw5kjWQxw6mCa7aYlk4bPr7X54XqfkfGIHNjAYpQ6cOH1x9fEw/cnP13M+Ik7bc3ZYxniMR9PQCElObmYptox7E97XK0MscbhHJgwxKrQMiZ+v9Y9u3knHBUCn08ut6m2DQJHe6C5WOqQl4KbVcXR2QSxwENbS38wNEapLmNi4/0Hv/r3zxvHN0p1YnGP1e/r4ODr9TbZlKBTU7xSnKG4lCUZQKMfYkJVvfT2c44xyVjKr6lpEUI3g3UOPIE1lu6O5aUTcyRjPjhISUGttYtVYYUJuXxudRZ4p/jIvZx+eoHvSopmz/Ly8jyJwBFIkD7EfMimYLM8xChVZUJapU4Ap34tbdHalfRDh7aOUHsoE2FsROQchVyOV5/Zx3ZjiFWqxoS0Wh95/qlHk2+9+AR3sw60dSgDOPj4UoVUAL3+EKt1gwlptd7arnf4cq1EfipJPpsgn46TS8fJpGLEY4K4FJxenicuodbsYbX+jwkZGfPNlfWNhSvrG/cBM8AMMA1MA7lELAgSiYBsOkk+m+KPv8o3gJ+Y+B9yFXCQeyJWrQAAAABJRU5ErkJggg==
!usage
{{{[img[server_go.png]]}}}
[img[server_go.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/server_go.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJUSURBVDjLpVPNaxNBFP8lqY1JSJOGFBtSU11BaEulUUFB7EUalB70kINCQfBv8FgNgvRUJCdPUj36FxgqKahpi18NSQXBikRbE6UfYpNtsruzO+ubTTaHNoLgwuMxs/P7eG/eOEzTxP98Xfs38vn8Y13XpxhjXZRB2QpN00R+mkwmb3QkKBaLAQI8CgaDSbfbC5VA4ByWP3LZ2xvE/HzmOq0OEhQKhcsCHA6Hoz6fD6WvZQh1zk1wkxORCYPIVFXtXAIdzsRiMWuj0VDACPyhuEIEvB0TiStWGR0JRI3d3d2oVqtNZcPA8MiYpW621EWz/+pAMBsEEofEpQjrxcI7yoalLv5FJq92dOAQoGw2a8bjcdRqNTrEUK5st9XtnNm+g7omQ+O698mt1YZN4LQdNJttWmEIZaNZ+5a/hLnfaSg6w0B4CApj9WsPj3kOlNAGt4DPNqdJmUH9weCjvvSFTmKo/xxqyh6K31/L47OhwKvbv2SLQDTHnkhhWfRA5xomRm7CoLXliCaisruB0YELkLWGc2X95e6p+85Q24G4BZfL1aybXCi6ZoG/7XwG4zoR0kQaDFW1hrGjFyGzuvNNaXHH2XLwNpfLQZZl+P1+HPa4iUCBbug40hNDf88gIgEJh1we9PmjyG8sYenL4lZdw1mHbT2dTk/SPNyLRCJnjksn8GB1Cgo506gU4UYKD+O8lMD79WUsrD3/qem4VJkxPzr2v8ZUKpUgolmKUfsxibwcncPpwXG8WFsoa9wCf2rPwb980l3HnsFd3gY3pM0Zs2Tv/wEq26vP9fcF2QAAAABJRU5ErkJggg==
!usage
{{{[img[sitemap.png]]}}}
[img[sitemap.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/sitemap.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAACoSURBVCjPY/jPAIMMCgxmYKiAEAOKwhmMDGZ//v/5/+M/qhI0BW/+gxQBlTDiUPDl/3v8Cn7//4VfwR/cVkB8kfI27S0WR+7rm/ui70X7i9YX88O7whtflANh7ouUPqgCBsbZLyBGAq1hRLBiX4BZiODBxgIpgAWPOYM/BgukGCl4En9jsswYkIIHKIzBgiiABg9QGINlxoAUPEBhDJYZwhdmDDZYWAoAtTEEdnXdy7IAAAAASUVORK5CYII=
!usage
{{{[img[star.png]]}}}
[img[star.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/star.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIwSURBVDjLlZLNS5RRFMafe9/3vjPOjI1jaKKEVH40tGgRBWEibfoPQoKkVdtoEQQF4T/QqkVtWrSTFrVsF1FgJbWpIAh1k2PNh+PrfL4f95zTQk0HHKkDD/cc7vP8uHCuEhF0q/KnmXNgGR248PZFN4/GISXMC8L89DBPV0Dp4/SsazJjrtfb9/vdxfn/BgjzY5M8Aq8nBya+V3h93vtnQHFxat4kszntJAAAxus1YvnZQV5V/jyTEZarwnwFLGeFZdT0ZFOJdD84qoCDOpQ7grZfRNj020JSEOKvwvxGiF+q0tL0N5PuO+Mk0nC0B0BDsYCCImyzAIktBBloMwKJLSgKYcMAcdhC2KpVlIig+H5qxcv0n0xmj4Gbq+BwC2wtJLbgHUlMEFJwUpMIGpto16u+kJzSACAk+WCzvNbe+AVljkOYIcQQou3TbvdOJo+g4aNdqzaF+PT43HJVA8DQpcVIiPPtaqlEUQzlDELsTpgYwgTAQIjQqlUCtpQfn1spdmxh+PJSQyw9CrbKgM7tvcISQAxlBhC3GuCYXk3cWP25m3M7dk88qbWBRDVApaATOSjPBdXXwYEP5QyCgvjE/kwHgInHtHYBnYA2owhrPiiuw0sOw3EZFEagIB7qChDiYaUcNIoFtP1KxCTPhWiDw7WbXk9vKpnOgsI4exjg6Mbq96YQPxm79uPOvqvbXx4O3KrF6w8osv2df17kr5YXJq7vnw/S0v3k7Ie7xtud/wAaRnP+Cw8iKQAAAABJRU5ErkJggg==
!usage
{{{[img[table.png]]}}}
[img[table.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/table.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHISURBVDjLpVPNK0RRFP+9D98syMwUspHkm9I0YkFZWBFKkZ0s7a3Ewh+ilChK7FgoZCJFKYlYKB8zk2+Z5t0P577He29kQU7dd+6575zf+d1zztWklPiPmOozt/U4SThjXIoyIQS4AJjSXO0lGGlvcXAm6Vzsz4xUhm0AIeX4QLig+C+ZpxbOG1wGhGYHr1zMUmZGWRgs0ha3PE1nX/8mWmdgWTzLB+DUYbhm9FfZ35IEyrhXA3VXJfPbsV8B9LQUIeUHYJ8ASobag1jcucNgW8g9W4reYSDi2YnnZDoDiwCokDANct6NwTB0LEdj0HRA/wxa2SN25JNBEdWluUhZ366gqmAaGvrCAXKOozccTGPgt8+vn8GYSGcgyTYp3dpBnBg42nbQPRBTo5bTvqYkmxL6AQhNTWQGBXY3B7BxlEBXozcW64dxRKoKUZBju+P06gl5WaaviMJBM3TNDlbypemIZgHYOnlwASsCmW7nHADGnBoQ3c76YmweJ9BR5zFYjsbRHwm4tmJg6PhWA7pCXXk+bu7fURHKweXtq/sWaksz7SC/CCGFrwtyZ3r+rCnFRZ7qr1qc6mLZj4f9OEyPL8lVpbX/PucPv5QPKHB1TdEAAAAASUVORK5CYII=
!usage
{{{[img[tag_blue.png]]}}}
[img[tag_blue.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/tag_blue.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHcSURBVDjLhZPZihpBFIbrJeY2wbcQmjxdIGSSTC4zQxLyAK4o7igoKm7TPW49LoiYjqLG3DWpZmx7/tQpsR1xycW5qTr/9/+n+jTTdR3dbhftdhutVgvNZhOapkFVVTQajSsA7FKxTqcDx3GOajqdSki1Wr0IYeRMAsMwpPNkMnEhdCZSoFQqnYUwikzN5EYH9XpdNU0Ttm3LcwJWKhXk8/mTEEauu0YhfhKRDcuysDBt5H5tk4zHYxSLReRyuSMII+dd5M1mAxL//uvgw8Mz3t4DWWN7NxqNKAXS6fQBhIkZ+Wq1kk3r9Rpz4XytPeNLF/iqAx8f9pDhcEgpEI/HXQir1WpvxIx8uVzKps7Kls53AvCjB3x7PIQMBgNKgUgkIiGSUi6XFTEjXywWsunxj433qoM7fQ+51oDMzy2k1+tRCoRCoSt3lkKhoIgZ+Xw+P4J8F4DPTeDm3oK92aZIJpMIBAKvD15UzKdks1k+m81cyDsB+SRGuG2tYVpPL8Ued4SXlclklFQqxWkTCaILyG3bgWXvnf1+v8d9xFPLkUgklFgsxmkTd5+YxOL8QHwWQBWNRr3ipTktWL/fPym+CKAKh8PeYDDISezz+TwnV/l/v6tw9Qrxq3P3/wBazDrstPR7KQAAAABJRU5ErkJggg==
!usage
{{{[img[tick.png]]}}}
[img[tick.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/tick.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLvZPZLkNhFIV75zjvYm7VGFNCqoZUJ+roKUUpjRuqp61Wq0NKDMelGGqOxBSUIBKXWtWGZxAvobr8lWjChRgSF//dv9be+9trCwAI/vIE/26gXmviW5bqnb8yUK028qZjPfoPWEj4Ku5HBspgAz941IXZeze8N1bottSo8BTZviVWrEh546EO03EXpuJOdG63otJbjBKHkEp/Ml6yNYYzpuezWL4s5VMtT8acCMQcb5XL3eJE8VgBlR7BeMGW9Z4yT9y1CeyucuhdTGDxfftaBO7G4L+zg91UocxVmCiy51NpiP3n2treUPujL8xhOjYOzZYsQWANyRYlU4Y9Br6oHd5bDh0bCpSOixJiWx71YY09J5pM/WEbzFcDmHvwwBu2wnikg+lEj4mwBe5bC5h1OUqcwpdC60dxegRmR06TyjCF9G9z+qM2uCJmuMJmaNZaUrCSIi6X+jJIBBYtW5Cge7cd7sgoHDfDaAvKQGAlRZYc6ltJlMxX03UzlaRlBdQrzSCwksLRbOpHUSb7pcsnxCCwngvM2Rm/ugUCi84fycr4l2t8Bb6iqTxSCgNIAAAAAElFTkSuQmCC
!usage
{{{[img[wrench.png]]}}}
[img[wrench.png]]
!notes
license: http://www.famfamfam.com/lab/icons/silk/
!type
image/png
!file
./images/silk/icons/wrench.png
!url

!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH0SURBVDjLlZPLbxJRGMX5X/xbjBpjjCtXLl2L0YWkaZrhNQwdIA4FZxygC22wltYYSltG1HGGl8nopCMPX9AUKQjacdW4GNPTOywak7ZAF/eRe/M73/nOzXUAcEwaqVTKmUgkGqIoWoIgWP/fTYSTyaSTgAfdbhemaSIej+NcAgRudDod9Pt95PN5RKPR8wnwPG/Z1XVdB8dxin0WDofBsiyCwaA1UYBY/tdqtVAqlRCJRN6FQiE1k8mg2WyCpunxArFY7DKxfFir1VCtVlEoFCBJEhRFQbFYhM/na5wKzq/+4ALprzqxbFUqFWiaBnstl8tQVRWyLMPr9R643W7nCZhZ3uUS+T74jR7Y5c8wDAO5XA4MwxzalklVy+PxNCiKcp4IkbbhzR4K+h9IH02wax3MiAYCgcBfv99/4TS3xxtfepcTCPyKgGl5gCevfyJb/Q3q6Q5uMcb7s3IaTZ6lHY5f70H6YGLp7QDx9T0kSRtr5V9wLbZxw1N/fqbAHIEXsj1saQR+M8BCdg8icbJaHOJBqo3r1KfMuJdyuBZb2NT2R5a5l108JuFl1CHuJ9q4NjceHgncefSN9LoPcYskT9pYIfA9Al+Z3X4xzUdz3H74RbODWlGGeCYPcVf4jksz08HHId6k63USFK7ObuOia3rYHkdyavlR+267GwAAAABJRU5ErkJggg==