Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

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

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

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

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

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

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

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

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

.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 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and need larger font sizes.
***/

/*{{{*/
body {font-size:0.8em;}

#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}

.subtitle {font-size:0.8em;}

.viewer table.listView {font-size:0.95em;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

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

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

----
Also see AdvancedOptions
The following are some tips and settings to try if the page transitions are slow or jerky in the LiveWindow.

On some systems, hardware acceleration actually slows down the page transitions to the point where they become unusable. As a result, starting with version 2.0 VirtMus is configured by default with the ~Direct3D pipeline disabled. On some other systems however, this hardware acceleration might works as intended and actually speed things up.

To re-enable this option, or to try different settings:
* Exit VirtMus
* Locate the directory that VirtMus is installed in
* Edit the {{{virtmus.conf}}} file in the {{{etc}}} sub-directory with Notepad or some other plain text editor (do not use Microsoft Word!).
* Modify the line that starts with {{{default_options}}} and set one of the following options to {{{true}}} or {{{false}}}:
** {{{-J-Dsun.java2d.d3d}}}
** {{{-J-Dsun.java2d.opengl}}}
* Restart VirtMus (these options are only read at start-up)
For example, to re-enable the ~Direct3D pipeline, use {{{-J-Dsun.java2d.d3d=true}}} (or simply remove the option altogether). Replacing the {{{-J-Dsun.java2d.d3d}}} option with {{{-J-Dsun.java2d.opengl=true}}} will use ~OpenGL instead of ~Direct3D.

The results obtained will depend on the type of graphics card present and on how good the installed video drivers are.

For full details and a complete list of options, see: http://java.sun.com/javase/6/webnotes/trouble/TSG-Desktop/html/java2d.html

Sections 3.1.3 through 3.1.5 are particularly relevant for the Windows OS.
! Version 3.20
* Features added:
** Better support for Windows 7
** When closing the application, the user now has the choice of saving some or all of the modified contents.
** PlayLists can now be tagged (from the "Properties" window)
** New toolbar button allows the user to quickly toggle the scrolling amount from 100% (a full page) to 50% (half a page at a time). This comes in handy when one image contains two music pages side-by-side (ex. when copied from a book). Toggling the scroll amount to 50% results in music pages being scrolled one at a time instead of two at a time.
** A secondary PDF renderer was added and is now being used for some types of PDF files that used to show gibberish with the original renderer.

* Improvements or bugs fixed:
** Better handling when the music repository is moved to a different drive or different location on the same drive.
** Upgraded to ~NetBeans 7.1.2
** Upgraded some of the external libraries used by VirtMus
** Errors and notifications are now shown in the bottom right corner of the application window
** In some cases, adding new annotations to a page already containing some, and then saving the song, would make the new annotations disappear (even though the file on disk contained the new annotations). This should be fixed now.

! Version 3.00
* Features added:
** Added the ability to undo annotations.
** A double-click, or a right-click on the thumbnails now displays them in the annotation window.
** Multi-threaded some operations to speed things up.
** A portable version of the app is now available. See http://portableapps.com for more details, and download the "VirtMus Portable" installer from http://sourceforge.net/projects/virtmus/files/ by looking for the file that ends in *.pdf.exe.

* Improvements or bugs fixed:
** ~PDFs that have different resolutions in the X and Y direction are now handled properly.
** Improved the display of help in Linux.
** Fixed rendering of rotated PDF pages.

! Version 2.62
* Features added:
** As you get to the end of the song, VirtMus will start caching the first pages to make a return to the beginning faster. This was a feature requested by a user.

* Bugs fixed:
** A few annoying bugs that were introduced in the rush to release v2.61 were fixed. An exception when bringing up the Options dialog box, and when changing the song and/or playlist path. In some cases the application would stop displaying new pages in the live view.

! Version 2.61
* Features added:
** Basic annotation tools (line, rectangle, freehand) are now available right in the annotations window (no need to use [[Inkscape|http://www.inkscape.org]] for simple edits).
** Playlists with stale songs (missing or moved) show up in bold. The missing songs are shown in the IDE log.
** Added File->Open Music Folder menu option

* Bugs fixed:
** Improved error handling for PDF documents.
** Improved handling of thumbnail reordering. This issue was especially prominent when the thumbnails were in a single column. Moving a thumbnail to the left used to be interpreted as a request to place the moved thumbnail before the previous one.
** Improved re-painting of the annotations window where sometimes the unused region was not properly cleaned up.
** Fixed an exception on Linux when displaying the Options
** Fixed crash when drawing on null music page

* Other changes:
** Upgraded to ~NetBeans 6.9
** Upgraded ~ICEpdf from 3.0 to 4.0.1
** Handle filenames with spaces.
** Made annotations tool bar better
** Updated documentation
*** on bilila.com products
*** to refer to Git instead of SVN

! Version 2.51
* Bugs fixed:
** Pages from a PDF document can be annotated using an external SVG editor now.
** Updates made using an external SVG editor show up right away now.

! Version 2.50
* Features added:
** Pages from a PDF document can be added to a song (as music pages).
** The property sheet now has an option to add tags to each song. There are plans to make use of tags more extensively in future versions.
** Page names in thumbnail view are now shortened by removing the middle part instead of truncating. In previous version the page number ended up being truncated usually making it difficult to identify the page.
** Thumbnails are now updated when annotations are drawn in the annotations window.

* Bugs fixed:
** Not really a bug, but the file format of song and playlist files became kind of messy. Should be cleaner now.

! Planned for the next version
* A tag hierarchy view
* Show the user a list of Songs or MusicPages that are missing
* Additional image editing tools

! Version 2.00
* Features added:
** A ~MS-Windows installer that can be used instead of the zip distribution
** Improved start-up for large collections
** Improved rendering of page transitions in the live window (in come cases the improvement is quite dramatic). See AcceleratedGraphics for more details.
** Songs can now be copied or moved between playlists
** Songs can be re-ordered a number of different ways
** Modified Songs or PlayLists are shown in italicized font
** Property sheets have been added for Songs and PlayLists
** PlayLists, Songs and MusicPages can now be renamed in place
** Added clipboard support and Edit menu entries
** Added memory usage graph in the tool bar
** A new script was contributed by one of the users to ConvertFromPdf directly to a song.

! Version 1.01
* Features added:
** The major change in this version is MusicPageAnnotations.
** Smoother animation for page flips in the live window
** Directories are searched recursively for [[Song|SongLists]] and [[PlayList|PlayLists]] files.
** Added installation instructions for JavaAdvancedImaging to improve performance.

! Version 0.53
* Bugs fixed:
** In the previous version, when a song was saved after changing the names of some of the music pages, the new names were not being saved. This is now fixed.

! Version 0.52
* Features added:
** Added a ''Help Contents'' help menu option that launches the default browser and brings up the HTML file you're reading now.
** Added an ''About ~VirtMus'' help menu option with the VirtMus home page address and version.
** When opening or saving a song/playlist, the dialog box now also shows directories by default.
** To a limited extent, songs (along with their associated music page images) and playlists can now be moved around on disk. You will need to re-save the songs (or playlists) after a move so that the new file path is recorded or else they will always appear as modified. This feature works as long as the song file is in the same directory as the music page images, or in any of the shallower directories (directories closer to the root of the file system).

* Bugs fixed:
** Fixed the problem that required the user to first select the Thumbs or Annotations tabs before the selections in the PlayList window would be reflected in those tabs.
** Hopefully also fixed the occasional AbstractLookup exception thrown during start-up.
This information is now deprecated. Starting with version 2.50, VirtMus reads PDF files directly without having to convert them to image files.

If [[ImageMagic|http://www.imagemagick.org/]] is installed as suggested in the VirtMusInstall instructions, ~PDFs can be converted to image files by using the {{{convert}}} command.

~PDFs can also be converted directly to a song file by using the [[script provided by Claudio Favi|http://wiki.epfl.ch/cfavi/virtmus]] and shown below. This requires the {{{bash}}} shell to be available. On Windows machines {{{bash}}} is part of the default [[CygWin install|http://www.cygwin.com/]]

{{{
#!/bin/bash

#uncomment for debug
#set -x

INPUTPDF=$1
OUTPUTJPG=${1##*/}
OUTPUTJPG=${OUTPUTJPG%.pdf}.jpg
SONGFILE=${OUTPUTJPG%.jpg}.song.xml

# NOTE: Adjust the -resize option to match the display resolution and orientation
convert -colorspace Gray -depth 8 -density 300x300 -resize x1050 "$INPUTPDF" "$OUTPUTJPG" || exit

#create the song.xml file
echo "<song>" > "$SONGFILE"
echo " <pages>" >> "$SONGFILE"

for f in "${OUTPUTJPG%.jpg}"*.jpg; do
echo " <page>" >> "$SONGFILE";
echo " <sourceFile>${f}</sourceFile>" >> "$SONGFILE";
echo " <rotation>Clockwise_0</rotation>" >> "$SONGFILE";
echo " </page>" >> "$SONGFILE";
done

echo " </pages>" >> "$SONGFILE";
echo -n "</song>" >> "$SONGFILE";
}}}


To process multiple PDF files at once:
* Save the script above to a file called pdf2song
* Add execute permissions to the script: {{{chmod a+x pdf2song}}}
* Execute the script as follows:
{{{
cd DESTDIR/
for f in ../SOURCEDIR/*.pdf; do pdf2song "$f"; done   
}}}
VirtMus
VirtMusGettingStarted
* Free
** This software is absolutely free. Just download it and use it. Hopefully you'll find it useful.

* Open
** This software does not use any proprietary file formats so you're not locked in.
** The music pages can be stored in any of the popular graphics file formats.
** The song and playlist files are stored as XML files which are human-readable using a basic text editor.
** The annotations are saved as SVG documents. For information on SVG see http://www.w3.org/Graphics/SVG/ and http://en.wikipedia.org/wiki/Scalable_Vector_Graphics

* Pristine sources
** This software does not modify any of your source material (your music pages). When you remove a page from a song, the image file remains on disk. Only the song.xml file is modified to indicate the page is no longer part of the song. Any annotations you make are stored in the song.xml file, leaving the music page you're annotating intact.

* Cross platform
** You should be able to use this software (and any associated software) on the platform of your choice.
If you want to help, see the ToDo list.

This application was built using the [[NetBeans 7.1.2|http://netbeans.org]] platform which can be downloaded from http://netbeans.org/

It uses the JavaAdvancedImaging library for most of the image manipulations. Follow the link for setup/installation details.

If you would like to contribute to this software, please contact the author (GabrielBurca)

The Git repository can be accessed at git://virtmus.git.sourceforge.net/gitroot/virtmus/virtmus

Versions prior to 2.50 were maintained in Subversion, but the SVN repository is now deprecated and all the old revisions have been imported into Git. Please see the RepositoryStructure information for how the old SVN was structured.

If you want to make changes to this TiddlyWiki document that you're reading now, right click on [[this link|index.html]] and select 'Save link as...' or 'Save target as...'.  Open the saved copy in your browser and edit as desired. When done, don't forget to click on the 'save changes' link in the upper right corner to save your changes. Changes can be submitted to GabrielBurca.

To publish the contents of this TiddlyWiki using static HTML files, see DocMaintenance.
This tiddler is used to generate flat HTML files out of the TiddlyWiki document.

By using SEOTiddlyWikiPlugin we can <html><a href="javascript:generateSEOFiles();">generate SEO files</a></html>

By using the PublishMacro we can <<doPublish>> all the tiddlers tagged with "Publish". The following tiddlers have not been tagged with "Publish":
<<allTagsExcept Publish>>

Either way, SiteUrl and SEOTiddlyWikiConfig needs to be updated.

! Step-by-step guide
# Click on <html><a href="javascript:generateSEOFiles();">generate SEO files</a></html>
# Copy all the subdirectories that were generated, along with {{{urllist.txt}}} and {{{sitemap.xml}}}, to the web root
# Create a sym-link for the {{{img}}} directory inside {{{publish}}} so that the images are at the right level relative to the static html pages (useful for those that have scripting disabled)
# (Optional) Remove all non "publish" entries from the sitemap.xml and urllist.txt and delete all non-publish directories
//{{{

version.extensions.email = {major: 0, minor: 1, revision: 2, date: new Date("Oct 15, 2005")};
config.macros.email = {}
config.macros.email.handler = function(place,macroName,params)
{
var temp = params.join(" ");
data = temp.split("?");
var recipient = data[0];
recipient = recipient.replace(" at ","@").replace(" dot ",".","g").replace(" dash ", "-");
recipient = recipient.replace(/\s/g,"");
var optional = data[1] ? "?" + data[1] : "";
var theLink = createExternalLink(place,"ma"+"il"+"to:"+recipient+optional);
theLink.appendChild(document.createTextNode(recipient))
}

//}}}
/***
|Name|ExportTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#ExportTiddlersPlugin|
|Version|2.3.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|select and extract tiddlers from your ~TiddlyWiki documents and save them to a local file|

When many people edit copies of the same TiddlyWiki document, the ability to easily copy and share these changes so they can then be redistributed to the entire group is very important.  This ability is also very useful when moving your own tiddlers from document to document (e.g., when upgrading to the latest version of TiddlyWiki, or 'pre-loading' your favorite stylesheets into a new 'empty' TiddlyWiki document.)

ExportTiddlersPlugin let you ''select and extract tiddlers from your ~TiddlyWiki documents and save them to a local file'' or a remote server (requires installation of compatible server-side scripting, still under development...).  An interactive control panel lets you specify a destination, and then select which tiddlers to export.  A convenient 'selection filter' helps you pick desired tiddlers by specifying a combination of modification dates, tags, or tiddler text to be matched or excluded.  ''Tiddler data can be output as ~TiddlyWiki "storeArea ~DIVs" that can be imported into another ~TiddlyWiki or as ~RSS-compatible XML that can be published for RSS syndication.''

!!!!!Inline interface (live)
<<<
<<exportTiddlers inline>>
<<<
!!!!!Usage
<<<
Optional "special tiddlers" used by this plugin:
* SiteUrl^^
URL for official server-published version of document being viewed (used in XML export)
default: //none//^^
* SiteHost^^
host name/address for remote server (e.g., "www.server.com" or "192.168.1.27")
default: //none//^^
* SitePost^^
remote path/filename for submitting changes (e.g., "/cgi-bin/submit.cgi")
default: //none//^^
* SiteParams^^
arguments (if any) for server-side receiving script
default: //none//^^
* SiteNotify^^
addresses (if any) for sending automatic server-side email notices
default: //none//^^
* SiteID^^
username or other authorization identifier for login-controlled access to remote server
default: current TiddlyWiki username (e.g., "YourName")^^
* SiteDate^^
stored date/time stamp for most recent published version of document
default: current document.modified value (i.e., the 'file date')^^
<<<
!!!!!Example
<<<
<<exportTiddlers>>
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your document:
''ExportTiddlersPlugin'' (tagged with <<tag systemConfig>>)

create/edit ''SideBarOptions'': (sidebar menu items) 
^^Add {{{<<exportTiddlers>>}}} macro^^
<<<
!!!!!Revision History
<<<
''2007.04.19 [2.3.0]'' in exportData(), pass SiteURL value as param to saveToRss().  Fixes 'undefined' appearing in tiddler link in XML output.  Also, in refreshExportList(), added 'sort by tags'.  Also, added 'group select'... selecting a heading (date,author,tag) auto-selects all tiddlers in that group.
''2007.03.02 [2.2.6]'' in onClickExportButton(), when selecting open tiddlers for TW2.2, look for "storyDisplay" instead of "tiddlerDisplay" but keep fallback to "tiddlerDisplay" for TW2.1 or earlier
''2007.03.01 [2.2.5]'' removed hijack of store.saveChanges() (was catching save on http:, but there are other solutions that do a much better job of handling save to server.
|please see [[ExportTiddlersPluginHistory]] for additional revision details|
''2005.10.09 [0.0.0]'' development started
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.exportTiddlers = {major: 2, minor: 3, revision: 0, date: new Date(2007,4,19)};
//}}}

// // macro handler
//{{{
config.macros.exportTiddlers = {
	label: "export tiddlers",
	prompt: "Copy selected tiddlers to an export document",
	newdefault: "export.html",
	datetimefmt: "0MM/0DD/YYYY 0hh:0mm:0ss" // for "filter date/time" edit fields
};

config.macros.exportTiddlers.handler = function(place,macroName,params) {
	if (params[0]!="inline")
		{ createTiddlyButton(place,this.label,this.prompt,onClickExportMenu); return; }
	var panel=createExportPanel(place);
	panel.style.position="static";
	panel.style.display="block";
}

function createExportPanel(place) {
	var panel=document.getElementById("exportPanel");
	if (panel) { panel.parentNode.removeChild(panel); }
	setStylesheet(config.macros.exportTiddlers.css,"exportTiddlers");
	panel=createTiddlyElement(place,"span","exportPanel",null,null)
	panel.innerHTML=config.macros.exportTiddlers.html;
	exportShowPanel(document.location.protocol);
	exportInitFilter();
	refreshExportList(0);
	return panel;
}

function onClickExportMenu(e)
{
	if (!e) var e = window.event;
	var parent=resolveTarget(e).parentNode;
	var panel = document.getElementById("exportPanel");
	if (panel==undefined || panel.parentNode!=parent)
		panel=createExportPanel(parent);
	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" ;
	if (panel.style.display!="none") refreshExportList(0); // update list when panel is made visible
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	return(false);
}
//}}}

// // IE needs explicit scoping for functions called by browser events
//{{{
window.onClickExportMenu=onClickExportMenu;
window.onClickExportButton=onClickExportButton;
window.exportShowPanel=exportShowPanel;
window.exportShowFilterFields=exportShowFilterFields;
window.refreshExportList=refreshExportList;
//}}}

// // CSS for floating export control panel
//{{{
config.macros.exportTiddlers.css = '\
#exportPanel {\
	display: none; position:absolute; z-index:12; width:35em; right:105%; top:6em;\
	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;\
}\
#exportPanel a, #exportPanel td a { color:#009; display:inline; margin:0px; padding:1px; }\
#exportPanel table { width:100%; border:0px; padding:0px; margin:0px; font-size:8pt; line-height:110%; background:transparent; }\
#exportPanel tr { border:0px;padding:0px;margin:0px; background:transparent; }\
#exportPanel td { color:#000; border:0px;padding:0px;margin:0px; background:transparent; }\
#exportPanel select { width:98%;margin:0px;font-size:8pt;line-height:110%;}\
#exportPanel input  { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%; }\
#exportPanel textarea  { width:98%;padding:0px;margin:0px;overflow:auto;font-size:8pt; }\
#exportPanel .box { border:1px solid black; padding:3px; margin-bottom:5px; background:#f8f8f8; -moz-border-radius:5px; }\
#exportPanel .topline { border-top:2px solid black; padding-top:3px; margin-bottom:5px; }\
#exportPanel .rad { width:auto;border:0 }\
#exportPanel .chk { width:auto;border:0 }\
#exportPanel .btn { width:auto; }\
#exportPanel .btn1 { width:98%; }\
#exportPanel .btn2 { width:48%; }\
#exportPanel .btn3 { width:32%; }\
#exportPanel .btn4 { width:24%; }\
#exportPanel .btn5 { width:19%; }\
';
//}}}

// // HTML for export control panel interface
//{{{
config.macros.exportTiddlers.html = '\
<!-- output target and format -->\
<table cellpadding="0" cellspacing="0"><tr><td width=50%>\
	export to\
	<select size=1 id="exportTo" onchange="exportShowPanel(this.value);">\
	<option value="file:" SELECTED>this computer</option>\
	<option value="http:">web server (http)</option>\
	<option value="https:">secure web server (https)</option>\
	<option value="ftp:">file server (ftp)</option>\
	</select>\
</td><td width=50%>\
	output format\
	<select id="exportFormat" size=1>\
	<option value="DIV">TiddlyWiki export file</option>\
	<option value="TW">TiddlyWiki document</option>\
	<option value="XML">RSS feed (XML)</option>\
	</select>\
</td></tr></table>\
\
<!-- export to local file  -->\
<div id="exportLocalPanel" style="margin-top:5px;">\
local path/filename<br>\
<input type="text" id="exportFilename" size=40 style="width:93%"><input \
	type="button" id="exportBrowse" value="..." title="select or enter a local folder/file..." style="width:5%" \
	onclick="this.previousSibling.value=window.promptForExportFilename(this);">\
<!--<input type="file" id="exportFilename" size=57 style="width:100%"><br>-->\
</div><!--panel-->\
\
<!-- export to http server -->\
<div id="exportHTTPPanel" style="display:none;margin-top:5px;">\
<table><tr><td align=left>\
	server location, script, and parameters<br>\
</td><td align=right>\
	<input type="checkbox" class="chk" id="exportNotify"\
		onClick="document.getElementById(\'exportSetNotifyPanel\').style.display=this.checked?\'block\':\'none\'"> notify\
</td></tr></table>\
<input type="text" id="exportHTTPServerURL" onfocus="this.select()"><br>\
<div id="exportSetNotifyPanel" style="display:none">\
	send email notices to<br>\
	<input type="text" id="exportNotifyTo" onfocus="this.select()"><br>\
</div>\
</div><!--panel-->\
\
<!-- export to ftp server -->\
<div id="exportFTPPanel" style="display:none;margin-top:5px;">\
<table cellpadding="0" cellspacing="0" width="32%"><tr valign="top"><td>\
	host server<br>\
	<input type="text" id="exportFTPHost" onfocus="this.select()"><br>\
</td><td width="32%">\
	username<br>\
	<input type="text" id="exportFTPID" onfocus="this.select()"><br>\
</td><td width="32%">\
	password<br>\
	<input type="password" id="exportFTPPW" onfocus="this.select()"><br>\
</td></tr></table>\
FTP path/filename<br>\
<input type="text" id="exportFTPFilename" onfocus="this.select()"><br>\
</div><!--panel-->\
\
<!-- notes -->\
notes<br>\
<textarea id="exportNotes" rows=3 cols=40 style="height:4em;margin-bottom:5px;" onfocus="this.select()"></textarea> \
\
<!-- list of tiddlers -->\
<table><tr align="left"><td>\
	select:\
	<a href="JavaScript:;" id="exportSelectAll"\
		onclick="onClickExportButton(this)" title="select all tiddlers">\
		&nbsp;all&nbsp;</a>\
	<a href="JavaScript:;" id="exportSelectChanges"\
		onclick="onClickExportButton(this)" title="select tiddlers changed since last save">\
		&nbsp;changes&nbsp;</a> \
	<a href="JavaScript:;" id="exportSelectOpened"\
		onclick="onClickExportButton(this)" title="select tiddlers currently being displayed">\
		&nbsp;opened&nbsp;</a> \
	<a href="JavaScript:;" id="exportToggleFilter"\
		onclick="onClickExportButton(this)" title="show/hide selection filter">\
		&nbsp;filter&nbsp;</a>  \
</td><td align="right">\
	<a href="JavaScript:;" id="exportListSmaller"\
		onclick="onClickExportButton(this)" title="reduce list size">\
		&nbsp;&#150;&nbsp;</a>\
	<a href="JavaScript:;" id="exportListLarger"\
		onclick="onClickExportButton(this)" title="increase list size">\
		&nbsp;+&nbsp;</a>\
</td></tr></table>\
<select id="exportList" multiple size="10" style="margin-bottom:5px;"\
	onchange="refreshExportList(this.selectedIndex)">\
</select><br>\
</div><!--box-->\
\
<!-- selection filter -->\
<div id="exportFilterPanel" style="display:none">\
<table><tr align="left"><td>\
	selection filter\
</td><td align="right">\
	<a href="JavaScript:;" id="exportHideFilter"\
		onclick="onClickExportButton(this)" title="hide selection filter">hide</a>\
</td></tr></table>\
<div class="box">\
<input type="checkbox" class="chk" id="exportFilterStart" value="1"\
	onclick="exportShowFilterFields(this)"> starting date/time<br>\
<table cellpadding="0" cellspacing="0"><tr valign="center"><td width="50%">\
	<select size=1 id="exportFilterStartBy" onchange="exportShowFilterFields(this);">\
		<option value="0">today</option>\
		<option value="1">yesterday</option>\
		<option value="7">a week ago</option>\
		<option value="30">a month ago</option>\
		<option value="site">SiteDate</option>\
		<option value="file">file date</option>\
		<option value="other">other (mm/dd/yyyy hh:mm)</option>\
	</select>\
</td><td width="50%">\
	<input type="text" id="exportStartDate" onfocus="this.select()"\
		onchange="document.getElementById(\'exportFilterStartBy\').value=\'other\';">\
</td></tr></table>\
<input type="checkbox" class="chk" id="exportFilterEnd" value="1"\
	onclick="exportShowFilterFields(this)"> ending date/time<br>\
<table cellpadding="0" cellspacing="0"><tr valign="center"><td width="50%">\
	<select size=1 id="exportFilterEndBy" onchange="exportShowFilterFields(this);">\
		<option value="0">today</option>\
		<option value="1">yesterday</option>\
		<option value="7">a week ago</option>\
		<option value="30">a month ago</option>\
		<option value="site">SiteDate</option>\
		<option value="file">file date</option>\
		<option value="other">other (mm/dd/yyyy hh:mm)</option>\
	</select>\
</td><td width="50%">\
	<input type="text" id="exportEndDate" onfocus="this.select()"\
		onchange="document.getElementById(\'exportFilterEndBy\').value=\'other\';">\
</td></tr></table>\
<input type="checkbox" class="chk" id=exportFilterTags value="1"\
	onclick="exportShowFilterFields(this)"> match tags<br>\
<input type="text" id="exportTags" onfocus="this.select()">\
<input type="checkbox" class="chk" id=exportFilterText value="1"\
	onclick="exportShowFilterFields(this)"> match titles/tiddler text<br>\
<input type="text" id="exportText" onfocus="this.select()">\
</div> <!--box-->\
</div> <!--panel-->\
\
<!-- action buttons -->\
<div style="text-align:center">\
<input type=button class="btn3" onclick="onClickExportButton(this)"\
	id="exportFilter" value="apply filter">\
<input type=button class="btn3" onclick="onClickExportButton(this)"\
	id="exportStart" value="export tiddlers">\
<input type=button class="btn3" onclick="onClickExportButton(this)"\
	id="exportClose" value="close">\
</div><!--center-->\
';
//}}}

// // initialize interface
// // exportShowPanel(which)
//{{{
function exportShowPanel(which) {
	var index=0; var panel='exportLocalPanel';
	switch (which) {
		case 'file:':
		case undefined:
			index=0; panel='exportLocalPanel'; break;
		case 'http:':
			index=1; panel='exportHTTPPanel'; break;
		case 'https:':
			index=2; panel='exportHTTPPanel'; break;
		case 'ftp:':
			index=3; panel='exportFTPPanel'; break;
		default:
			alert("Sorry, export to "+which+" is not yet available");
			break;
	}
	exportInitPanel(which);
	document.getElementById('exportTo').selectedIndex=index;
	document.getElementById('exportLocalPanel').style.display='none';
	document.getElementById('exportHTTPPanel').style.display='none';
	document.getElementById('exportFTPPanel').style.display='none';
	document.getElementById(panel).style.display='block';
}
//}}}

// // exportInitPanel(which)
//{{{
function exportInitPanel(which) {
	switch (which) {
		case "file:": // LOCAL EXPORT PANEL: file/path:
			// ** no init - security issues in IE **
			break;
		case "http:": // WEB EXPORT PANEL
		case "https:": // SECURE WEB EXPORT PANEL
			// url
			if (store.tiddlerExists("unawiki_download")) {
				var theURL=store.getTiddlerText("unawiki_download");
				theURL=theURL.replace(/\[\[download\|/,'').replace(/\]\]/,'');
				var title=(store.tiddlerExists("unawiki_host"))?"unawiki_host":"SiteHost";
				var theHost=store.getTiddlerText(title);
				if (!theHost || !theHost.length) theHost=document.location.host;
				if (!theHost || !theHost.length) theHost=title;
			}
			// server script/params
			var title=(store.tiddlerExists("unawiki_host"))?"unawiki_host":"SiteHost";
			var theHost=store.getTiddlerText(title);
			if (!theHost || !theHost.length) theHost=document.location.host;
			if (!theHost || !theHost.length) theHost=title;
			// get POST
			var title=(store.tiddlerExists("unawiki_post"))?"unawiki_post":"SitePost";
			var thePost=store.getTiddlerText(title);
			if (!thePost || !thePost.length) thePost="/"+title;
			// get PARAMS
			var title=(store.tiddlerExists("unawiki_params"))?"unawiki_params":"SiteParams";
			var theParams=store.getTiddlerText(title);
			if (!theParams|| !theParams.length) theParams=title;
			var serverURL = which+"//"+theHost+thePost+"?"+theParams;
			document.getElementById("exportHTTPServerURL").value=serverURL;
			// get NOTIFY
			var theAddresses=store.getTiddlerText("SiteNotify");
			if (!theAddresses|| !theAddresses.length) theAddresses="SiteNotify";
			document.getElementById("exportNotifyTo").value=theAddresses;
			break;
		case "ftp:": // FTP EXPORT PANEL
			// host
			var siteHost=store.getTiddlerText("SiteHost");
			if (!siteHost || !siteHost.length) siteHost=document.location.host;
			if (!siteHost || !siteHost.length) siteHost="SiteHost";
			document.getElementById("exportFTPHost").value=siteHost;
			// username
			var siteID=store.getTiddlerText("SiteID");
			if (!siteID || !siteID.length) siteID=config.options.txtUserName;
			document.getElementById("exportFTPID").value=siteID;
			// password
			document.getElementById("exportFTPPW").value="";
			// file/path
			document.getElementById("exportFTPFilename").value="";
			break;
	}
}
//}}}

// // exportInitFilter()
//{{{
function exportInitFilter() {
	// start date
	document.getElementById("exportFilterStart").checked=false;
	document.getElementById("exportStartDate").value="";
	// end date
	document.getElementById("exportFilterEnd").checked=false;
	document.getElementById("exportEndDate").value="";
	// tags
	document.getElementById("exportFilterTags").checked=false;
	document.getElementById("exportTags").value="";
	// text
	document.getElementById("exportFilterText").checked=false;
	document.getElementById("exportText").value="";
	// show/hide filter input fields
	exportShowFilterFields();
}
//}}}

// // exportShowFilterFields(which)
//{{{
function exportShowFilterFields(which) {
	var show;

	show=document.getElementById('exportFilterStart').checked;
	document.getElementById('exportFilterStartBy').style.display=show?"block":"none";
	document.getElementById('exportStartDate').style.display=show?"block":"none";
	var val=document.getElementById('exportFilterStartBy').value;
	document.getElementById('exportStartDate').value
		=getFilterDate(val,'exportStartDate').formatString(config.macros.exportTiddlers.datetimefmt);
	 if (which && (which.id=='exportFilterStartBy') && (val=='other'))
		document.getElementById('exportStartDate').focus();

	show=document.getElementById('exportFilterEnd').checked;
	document.getElementById('exportFilterEndBy').style.display=show?"block":"none";
	document.getElementById('exportEndDate').style.display=show?"block":"none";
	var val=document.getElementById('exportFilterEndBy').value;
	document.getElementById('exportEndDate').value
		=getFilterDate(val,'exportEndDate').formatString(config.macros.exportTiddlers.datetimefmt);
	 if (which && (which.id=='exportFilterEndBy') && (val=='other'))
		document.getElementById('exportEndDate').focus();

	show=document.getElementById('exportFilterTags').checked;
	document.getElementById('exportTags').style.display=show?"block":"none";

	show=document.getElementById('exportFilterText').checked;
	document.getElementById('exportText').style.display=show?"block":"none";
}
//}}}

// // onClickExportButton(which): control interactions
//{{{
function onClickExportButton(which)
{
	// DEBUG alert(which.id);
	var theList=document.getElementById('exportList'); if (!theList) return;
	var count = 0;
	var total = store.getTiddlers('title').length;
	switch (which.id)
		{
		case 'exportFilter':
			count=filterExportList();
			var panel=document.getElementById('exportFilterPanel');
			if (count==-1) { panel.style.display='block'; break; }
			document.getElementById("exportStart").disabled=(count==0);
			clearMessage(); displayMessage("filtered "+formatExportMessage(count,total));
			if (count==0) { alert("No tiddlers were selected"); panel.style.display='block'; }
			break;
		case 'exportStart':
			exportTiddlers();
			break;
		case 'exportHideFilter':
		case 'exportToggleFilter':
			var panel=document.getElementById('exportFilterPanel')
			panel.style.display=(panel.style.display=='block')?'none':'block';
			break;
		case 'exportSelectChanges':
			var lastmod=new Date(document.lastModified);
			for (var t = 0; t < theList.options.length; t++) {
				if (theList.options[t].value=="") continue;
				var tiddler=store.getTiddler(theList.options[t].value); if (!tiddler) continue;
				theList.options[t].selected=(tiddler.modified>lastmod);
				count += (tiddler.modified>lastmod)?1:0;
			}
			document.getElementById("exportStart").disabled=(count==0);
			clearMessage(); displayMessage(formatExportMessage(count,total));
			if (count==0) alert("There are no unsaved changes");
			break;
		case 'exportSelectAll':
			for (var t = 0; t < theList.options.length; t++) {
				if (theList.options[t].value=="") continue;
				theList.options[t].selected=true;
				count += 1;
			}
			document.getElementById("exportStart").disabled=(count==0);
			clearMessage(); displayMessage(formatExportMessage(count,count));
			break;
		case 'exportSelectOpened':
			for (var t = 0; t < theList.options.length; t++) theList.options[t].selected=false;
			var tiddlerDisplay = document.getElementById("tiddlerDisplay"); // for TW2.1-
			if (!tiddlerDisplay) tiddlerDisplay = document.getElementById("storyDisplay"); // for TW2.2+
			for (var t=0;t<tiddlerDisplay.childNodes.length;t++) {
				var tiddler=tiddlerDisplay.childNodes[t].id.substr(7);
				for (var i = 0; i < theList.options.length; i++) {
					if (theList.options[i].value!=tiddler) continue;
					theList.options[i].selected=true; count++; break;
				}
			}
			document.getElementById("exportStart").disabled=(count==0);
			clearMessage(); displayMessage(formatExportMessage(count,total));
			if (count==0) alert("There are no tiddlers currently opened");
			break;
		case 'exportListSmaller':	// decrease current listbox size
			var min=5;
			theList.size-=(theList.size>min)?1:0;
			break;
		case 'exportListLarger':	// increase current listbox size
			var max=(theList.options.length>25)?theList.options.length:25;
			theList.size+=(theList.size<max)?1:0;
			break;
		case 'exportClose':
			document.getElementById('exportPanel').style.display='none';
			break;
		}
}
//}}}

// // list display
//{{{
function formatExportMessage(count,total)
{
	var txt=total+' tiddler'+((total!=1)?'s':'')+" - ";
	txt += (count==0)?"none":(count==total)?"all":count;
	txt += " selected for export";
	return txt;
}

function refreshExportList(selectedIndex)
{
	var theList  = document.getElementById("exportList");
	var sort;
	if (!theList) return;
	// get the sort order
	if (!selectedIndex)   selectedIndex=0;
	if (selectedIndex==0) sort='modified';
	if (selectedIndex==1) sort='title';
	if (selectedIndex==2) sort='modified';
	if (selectedIndex==3) sort='modifier';
	if (selectedIndex==4) sort='tags';

	// unselect headings and count number of tiddlers actually selected
	for (var t=0,count=0; t < theList.options.length; t++) {
		if (!theList.options[t].selected) continue;
		if (theList.options[t].value!="")
			count++;
		else { // if heading is selected, deselect it, and then select and count all in section
			theList.options[t].selected=false;
			for ( t++; t<theList.options.length && theList.options[t].value!=""; t++) {
				theList.options[t].selected=true;
				count++;
			}
		}
	}

	// disable "export" button if no tiddlers selected
	document.getElementById("exportStart").disabled=(count==0);
	// show selection count
	var tiddlers = store.getTiddlers('title');
	if (theList.options.length) { clearMessage(); displayMessage(formatExportMessage(count,tiddlers.length)); }

	// if a [command] item, reload list... otherwise, no further refresh needed
	if (selectedIndex>4)  return;

	// clear current list contents
	while (theList.length > 0) { theList.options[0] = null; }
	// add heading and control items to list
	var i=0;
	var indent=String.fromCharCode(160)+String.fromCharCode(160);
	theList.options[i++]=
		new Option(tiddlers.length+" tiddlers in document", "",false,false);
	theList.options[i++]=
		new Option(((sort=="title"        )?">":indent)+' [by title]', "",false,false);
	theList.options[i++]=
		new Option(((sort=="modified")?">":indent)+' [by date]', "",false,false);
	theList.options[i++]=
		new Option(((sort=="modifier")?">":indent)+' [by author]', "",false,false);
	theList.options[i++]=
		new Option(((sort=="tags"	)?">":indent)+' [by tags]', "",false,false);
	// output the tiddler list
	switch(sort)
		{
		case "title":
			for(var t = 0; t < tiddlers.length; t++)
				theList.options[i++] = new Option(tiddlers[t].title,tiddlers[t].title,false,false);
			break;
		case "modifier":
		case "modified":
			var tiddlers = store.getTiddlers(sort);
			// sort descending for newest date first
			tiddlers.sort(function (a,b) {if(a[sort] == b[sort]) return(0); else return (a[sort] > b[sort]) ? -1 : +1; });
			var lastSection = "";
			for(var t = 0; t < tiddlers.length; t++)
				{
				var tiddler = tiddlers[t];
				var theSection = "";
				if (sort=="modified") theSection=tiddler.modified.toLocaleDateString();
				if (sort=="modifier") theSection=tiddler.modifier;
				if (theSection != lastSection)
					{
					theList.options[i++] = new Option(theSection,"",false,false);
					lastSection = theSection;
					}
				theList.options[i++] = new Option(indent+indent+tiddler.title,tiddler.title,false,false);
				}
			 break;
		case "tags":
			var theTitles = {}; // all tiddler titles, hash indexed by tag value
			var theTags = new Array();
			for(var t=0; t<tiddlers.length; t++) {
				var title=tiddlers[t].title;
				var tags=tiddlers[t].tags;
				if (!tags || !tags.length) {
					if (theTitles["untagged"]==undefined) { theTags.push("untagged"); theTitles["untagged"]=new Array(); }
					theTitles["untagged"].push(title);
				}
				else for(var s=0; s<tags.length; s++) {
					if (theTitles[tags[s]]==undefined) { theTags.push(tags[s]); theTitles[tags[s]]=new Array(); }
					theTitles[tags[s]].push(title);
				}
			}
			theTags.sort();
			for(var tagindex=0; tagindex<theTags.length; tagindex++) {
				var theTag=theTags[tagindex];
				theList.options[i++]=new Option(theTag,"",false,false);
				for(var t=0; t<theTitles[theTag].length; t++)
					theList.options[i++]=new Option(indent+indent+theTitles[theTag][t],theTitles[theTag][t],false,false);
			}
			break;
		}
	theList.selectedIndex=selectedIndex;		  // select current control item
}
//}}}

// // list filtering
//{{{
function getFilterDate(val,id)
{
	var result=0;
	switch (val) {
		case 'site':
			var timestamp=store.getTiddlerText("SiteDate");
			if (!timestamp) timestamp=document.lastModified;
			result=new Date(timestamp);
			break;
		case 'file':
			result=new Date(document.lastModified);
			break;
		case 'other':
			result=new Date(document.getElementById(id).value);
			break;
		default: // today=0, yesterday=1, one week=7, two weeks=14, a month=31
			var now=new Date(); var tz=now.getTimezoneOffset()*60000; now-=tz;
			var oneday=86400000;
			if (id=='exportStartDate')
				result=new Date((Math.floor(now/oneday)-val)*oneday+tz);
			else
				result=new Date((Math.floor(now/oneday)-val+1)*oneday+tz-1);
			break;
	}
	// DEBUG alert('getFilterDate('+val+','+id+')=='+result+"\nnow="+now);
	return result;
}

function filterExportList()
{
	var theList  = document.getElementById("exportList"); if (!theList) return -1;

	var filterStart=document.getElementById("exportFilterStart").checked;
	var val=document.getElementById("exportFilterStartBy").value;
	var startDate=getFilterDate(val,'exportStartDate');

	var filterEnd=document.getElementById("exportFilterEnd").checked;
	var val=document.getElementById("exportFilterEndBy").value;
	var endDate=getFilterDate(val,'exportEndDate');

	var filterTags=document.getElementById("exportFilterTags").checked;
	var tags=document.getElementById("exportTags").value;

	var filterText=document.getElementById("exportFilterText").checked;
	var text=document.getElementById("exportText").value;

	if (!(filterStart||filterEnd||filterTags||filterText)) {
		alert("Please set the selection filter");
		document.getElementById('exportFilterPanel').style.display="block";
		return -1;
	}
	if (filterStart&&filterEnd&&(startDate>endDate)) {
		var msg="starting date/time:\n"
		msg+=startDate.toLocaleString()+"\n";
		msg+="is later than ending date/time:\n"
		msg+=endDate.toLocaleString()
		alert(msg);
		return -1;
	}

	// scan list and select tiddlers that match all applicable criteria
	var total=0;
	var count=0;
	for (var i=0; i<theList.options.length; i++) {
		// get item, skip non-tiddler list items (section headings)
		var opt=theList.options[i]; if (opt.value=="") continue;
		// get tiddler, skip missing tiddlers (this should NOT happen)
		var tiddler=store.getTiddler(opt.value); if (!tiddler) continue; 
		var sel=true;
		if ( (filterStart && tiddler.modified<startDate)
		|| (filterEnd && tiddler.modified>endDate)
		|| (filterTags && !matchTags(tiddler,tags))
		|| (filterText && (tiddler.text.indexOf(text)==-1) && (tiddler.title.indexOf(text)==-1)))
			sel=false;
		opt.selected=sel;
		count+=sel?1:0;
		total++;
	}
	return count;
}
//}}}

//{{{
function matchTags(tiddler,cond)
{
	if (!cond||!cond.trim().length) return false;

	// build a regex of all tags as a big-old regex that 
	// OR's the tags together (tag1|tag2|tag3...) in length order
	var tgs = store.getTags();
	if ( tgs.length == 0 ) return results ;
	var tags = tgs.sort( function(a,b){return (a[0].length<b[0].length)-(a[0].length>b[0].length);});
	var exp = "(" + tags.join("|") + ")" ;
	exp = exp.replace( /(,[\d]+)/g, "" ) ;
	var regex = new RegExp( exp, "ig" );

	// build a string such that an expression that looks like this: tag1 AND tag2 OR NOT tag3
	// turns into : /tag1/.test(...) && /tag2/.test(...) || ! /tag2/.test(...)
	cond = cond.replace( regex, "/$1\\|/.test(tiddlerTags)" );
	cond = cond.replace( /\sand\s/ig, " && " ) ;
	cond = cond.replace( /\sor\s/ig, " || " ) ;
	cond = cond.replace( /\s?not\s/ig, " ! " ) ;

	// if a boolean uses a tag that doesn't exist - it will get left alone 
	// (we only turn existing tags into actual tests).
	// replace anything that wasn't found as a tag, AND, OR, or NOT with the string "false"
	// if the tag doesn't exist then /tag/.test(...) will always return false.
	cond = cond.replace( /(\s|^)+[^\/\|&!][^\s]*/g, "false" ) ;

	// make a string of the tags in the tiddler and eval the 'cond' string against that string 
	// if it's TRUE then the tiddler qualifies!
	var tiddlerTags = (tiddler.tags?tiddler.tags.join("|"):"")+"|" ;
	try { if ( eval( cond ) ) return true; }
	catch( e ) { displayMessage("Error in tag filter '" + e + "'" ); }
	return false;
}
//}}}

// // output data formatting
// // exportHeader(format)
//{{{
function exportHeader(format)
{
	switch (format) {
		case "TW":	return exportTWHeader();
		case "DIV":	return exportDIVHeader();
		case "XML":	return exportXMLHeader();
	}
}
//}}}

// // exportFooter(format)
//{{{
function exportFooter(format)
{
	switch (format) {
		case "TW":	return exportDIVFooter();
		case "DIV":	return exportDIVFooter();
		case "XML":	return exportXMLFooter();
	}
}
//}}}

// // exportTWHeader()
//{{{
function exportTWHeader()
{
	// Get the URL of the document
	var originalPath = document.location.href;
	// Check we were loaded from a file URL
	if(originalPath.substr(0,5) != "file:")
		{ alert(config.messages.notFileUrlError); return; }
	// Remove any location part of the URL
	var hashPos = originalPath.indexOf("#"); if(hashPos != -1) originalPath = originalPath.substr(0,hashPos);
	// Convert to a native file format assuming
	// "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
	// "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
	// "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
	// "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
	var localPath;
	if(originalPath.charAt(9) == ":") // pc local file
		localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
	else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file
		localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
	else if(originalPath.indexOf("file:///") == 0) // mac/unix local file
		localPath = unescape(originalPath.substr(7));
	else if(originalPath.indexOf("file:/") == 0) // mac/unix local file
		localPath = unescape(originalPath.substr(5));
	else // pc network file
		localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");
	// Load the original file
	var original = loadFile(localPath);
	if(original == null)
		{ alert(config.messages.cantSaveError); return; }
	// Locate the storeArea div's
	var posOpeningDiv = original.indexOf(startSaveArea);
	var posClosingDiv = original.lastIndexOf(endSaveArea);
	if((posOpeningDiv == -1) || (posClosingDiv == -1))
		{ alert(config.messages.invalidFileError.format([localPath])); return; }
	return original.substr(0,posOpeningDiv+startSaveArea.length)
}
//}}}

// // exportDIVHeader()
//{{{
function exportDIVHeader()
{
	var out=[];
	var now = new Date();
	var title = convertUnicodeToUTF8(wikifyPlain("SiteTitle").htmlEncode());
	var subtitle = convertUnicodeToUTF8(wikifyPlain("SiteSubtitle").htmlEncode());
	var user = convertUnicodeToUTF8(config.options.txtUserName.htmlEncode());
	var twver = version.major+"."+version.minor+"."+version.revision;
	var pver = version.extensions.exportTiddlers.major+"."
		+version.extensions.exportTiddlers.minor+"."+version.extensions.exportTiddlers.revision;
	out.push("<html><body>");
	out.push("<style type=\"text/css\">");
	out.push("#storeArea {display:block;margin:1em;}");
	out.push("#storeArea div");
	out.push("{padding:0.5em;margin:1em;border:2px solid black;height:10em;overflow:auto;}");
	out.push("#javascriptWarning");
	out.push("{width:100%;text-align:left;background-color:#eeeeee;padding:1em;}");
	out.push("</style>");
	out.push("<div id=\"javascriptWarning\">");
	out.push("TiddlyWiki export file<br>");
	out.push("Source"+": <b>"+convertUnicodeToUTF8(document.location.href)+"</b><br>");
	out.push("Title: <b>"+title+"</b><br>");
	out.push("Subtitle: <b>"+subtitle+"</b><br>");
	out.push("Created: <b>"+now.toLocaleString()+"</b> by <b>"+user+"</b><br>");
	out.push("TiddlyWiki "+twver+" / "+"ExportTiddlersPlugin "+pver+"<br>");
	out.push("Notes:<hr><pre>"+document.getElementById("exportNotes").value.replace(regexpNewLine,"<br>")+"</pre>");
	out.push("</div>");
	out.push("<div id=\"storeArea\">");
	return out;
}
//}}}

// // exportDIVFooter()
//{{{
function exportDIVFooter()
{
	var out=[];
	out.push("</div><!--POST-BODY-START-->\n<!--POST-BODY-END--></body></html>");
	return out;
}
//}}}

// // exportXMLHeader()
//{{{
function exportXMLHeader()
{
	var out=[];
	var now = new Date();
	var u = store.getTiddlerText("SiteUrl",null);
	var title = convertUnicodeToUTF8(wikifyPlain("SiteTitle").htmlEncode());
	var subtitle = convertUnicodeToUTF8(wikifyPlain("SiteSubtitle").htmlEncode());
	var user = convertUnicodeToUTF8(config.options.txtUserName.htmlEncode());
	var twver = version.major+"."+version.minor+"."+version.revision;
	var pver = version.extensions.exportTiddlers.major+"."
		+version.extensions.exportTiddlers.minor+"."+version.extensions.exportTiddlers.revision;
	out.push("<" + "?xml version=\"1.0\"?" + ">");
	out.push("<rss version=\"2.0\">");
	out.push("<channel>");
	out.push("<title>" + title + "</title>");
	if(u) out.push("<link>" + convertUnicodeToUTF8(u.htmlEncode()) + "</link>");
	out.push("<description>" + subtitle + "</description>");
	out.push("<language>en-us</language>");
	out.push("<copyright>Copyright " + now.getFullYear() + " " + user + "</copyright>");
	out.push("<pubDate>" + now.toGMTString() + "</pubDate>");
	out.push("<lastBuildDate>" + now.toGMTString() + "</lastBuildDate>");
	out.push("<docs>http://blogs.law.harvard.edu/tech/rss</docs>");
	out.push("<generator>TiddlyWiki "+twver+" plus ExportTiddlersPlugin "+pver+"</generator>");
	return out;
}
//}}}

// // exportXMLFooter()
//{{{
function exportXMLFooter()
{
	var out=[];
	out.push("</channel></rss>");
	return out;
}
//}}}

// // exportData()
//{{{
function exportData(theList,theFormat)
{
	// scan export listbox and collect DIVs or XML for selected tiddler content
	var out=[];
	for (var i=0; i<theList.options.length; i++) {
		// get item, skip non-selected items and section headings
		var opt=theList.options[i]; if (!opt.selected||(opt.value=="")) continue;
		// get tiddler, skip missing tiddlers (this should NOT happen)
		var thisTiddler=store.getTiddler(opt.value); if (!thisTiddler) continue; 
		if (theFormat=="TW")	out.push(convertUnicodeToUTF8(thisTiddler.saveToDiv()));
		if (theFormat=="DIV")	out.push(convertUnicodeToUTF8(thisTiddler.title+"\n"+thisTiddler.saveToDiv()));
		if (theFormat=="XML")	out.push(convertUnicodeToUTF8(thisTiddler.saveToRss(store.getTiddlerText("SiteUrl",""))));
	}
	return out;
}
//}}}

// // exportTiddlers(): output selected data to local or server
//{{{
function exportTiddlers()
{
	var theList  = document.getElementById("exportList"); if (!theList) return;

	// get the export settings
	var theProtocol = document.getElementById("exportTo").value;
	var theFormat = document.getElementById("exportFormat").value;

	// assemble output: header + tiddlers + footer
	var theData=exportData(theList,theFormat);
	var count=theData.length;
	var out=[]; var txt=out.concat(exportHeader(theFormat),theData,exportFooter(theFormat)).join("\n");
	var msg="";
	switch (theProtocol) {
		case "file:":
			var theTarget = document.getElementById("exportFilename").value.trim();
			if (!theTarget.length) msg = "A local path/filename is required\n";
			if (!msg && saveFile(theTarget,txt))
				msg=count+" tiddler"+((count!=1)?"s":"")+" exported to local file";
			else if (!msg)
				msg+="An error occurred while saving to "+theTarget;
			break;
		case "http:":
		case "https:":
			var theTarget = document.getElementById("exportHTTPServerURL").value.trim();
			if (!theTarget.length) msg = "A server URL is required\n";
			if (document.getElementById('exportNotify').checked)
				theTarget+="&notify="+encodeURIComponent(document.getElementById('exportNotifyTo').value);
			if (document.getElementById('exportNotes').value.trim().length)
				theTarget+="&notes="+encodeURIComponent(document.getElementById('exportNotes').value);
			if (!msg && exportPost(theTarget+encodeURIComponent(txt)))
				msg=count+" tiddler"+((count!=1)?"s":"")+" exported to "+theProtocol+" server";
			else if (!msg)
				msg+="An error occurred while saving to "+theTarget;
			break;
		case "ftp:":
		default:
			msg="Sorry, export to "+theLocation+" is not yet available";
			break;
	}
	clearMessage(); displayMessage(msg,theTarget);
}
//}}}

// // exportPost(url): cross-domain post uses hidden iframe to submit url and capture responses
//{{{
function exportPost(url)
{
	var f=document.getElementById("exportFrame"); if (f) document.body.removeChild(f);
	f=document.createElement("iframe"); f.id="exportFrame";
	f.style.width="0px"; f.style.height="0px"; f.style.border="0px";
	document.body.appendChild(f);
	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.location.replace(url);
 	return true;
}
//}}}

// // promptForFilename(msg,path,file) uses platform/browser specific functions to get local filespec
//{{{
function promptForExportFilename(here)
{
	var msg=here.title; // use tooltip as dialog box message
	var path=getLocalPath(document.location.href);
	var slashpos=path.lastIndexOf("/"); if (slashpos==-1) slashpos=path.lastIndexOf("\\"); 
	if (slashpos!=-1) path = path.substr(0,slashpos+1); // remove filename from path, leave the trailing slash
	var file=config.macros.exportTiddlers.newdefault;
	var result="";
	if(window.Components) { // moz
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
			var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
			var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
			picker.init(window, msg, nsIFilePicker.modeSave);
			var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
			thispath.initWithPath(path);
			picker.displayDirectory=thispath;
			picker.defaultExtension='html';
			picker.defaultString=file;
			picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
			if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
		}
		catch(e) { alert('error during local file access: '+e.toString()) }
	}
	else { // IE
		try { // XP only
			var s = new ActiveXObject('UserAccounts.CommonDialog');
			s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
			s.FilterIndex=3; // default to HTML files;
			s.InitialDir=path;
			s.FileName=file;
			if (s.showOpen()) var result=s.FileName;
		}
		catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
	}
	return result;
}
//}}}
Foot switches allow you to press the left/right mouse buttons using your feet (thus keeping your hands free to play the instrument).

If you want to be able to go forward and back, you will want a 2-button foot switch. If you only need to go forward (PageDown), a single button (the left mouse button) switch will do. Either way, you have a few options.

! Home baked solution
If you're not afraid of using a soldering gun, you can make your own switch by sacrificing a USB mouse. That's what I did. I already had two sustain pedals (the normally open type) and a spare optical mini mouse, so I bought two 1/4" jacks and soldered them to the mouse button switches on the mouse PCB. The sustain pedals can now be used to move back and forth through the song.

! Comercial solutions
''None of these have been verified to work with VirtMus'' by the VirtMus developers but from the description it looks like they might. If they act as a mouse and provide mouse-click events they should work.

http://www.bilila.com/ sells a foot pedal that can be used to "turn pages". Be aware that this device sends ~PgUp/~PgDn keys to the PC so VirtMus will always scroll a full page when the pedal is depressed. In order to scroll by less than a full page, the device must send left/right button mouse clicks. See:
* http://www.bilila.com/pagescore_turner

http://www.delcom-eng.com/ sells a number of USB foot switches that generate mouse click events. See for example:
* [[Dual USB HID Foot Switch - Mouse Left & Right Buttons|http://www.delcom-eng.com/productdetails.asp?productnum=803682]]
* [[USB HID Mouse Button Left Foot Switch|http://www.delcom-eng.com/productdetails.asp?productnum=803661]]

http://www.kinesis-ergo.com/ also sells a few types of foot switches that generate mouse click events. See for example:
* http://www.kinesis-ergo.com/fs-savant.htm
* http://www.kinesis-ergo.com/fs-savant-elite.htm

http://usb.brando.com/ sells 2 and 3 button foot switches:
* http://usb.brando.com/usb-double-foot-switch_p01364c046d015.html
* http://usb.brando.com/usb-triple-foot-switch_p01365c046d015.html
* How do I speed up VirtMus?
<<<
Follow some of the tips in MusicPages and/or the AcceleratedGraphics tips.
<<<
* How do I quickly search for a song?
<<<
Click on the ''~PlayList Window'' tab, open the ''All Songs'' playlist, and just start typing the song name. The selection will jump to the song matching your entry.
[img[img\QuickSearch.png]]
<<<
* How do I remove or modify a single annotation?
<<<
Install [[Inkscape|http://www.inkscape.org/]] (see the VirtMusInstall info) and click on the ''Edit Annotation'' toolbar button. Inkscape provides a full-blown editing environment for doing annotation editing.
<<<
* Where are the settings saved?
<<<
In the {{{Userdir}}} specified in the Help->About dialog box.
<<<
Gabriel Burca (gburca dash virtmus at ebixio dot com)
/***
|Name|ImportTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#ImportTiddlersPlugin|
|Version|3.5.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|config.macros.importTiddlers.handler|
|Description|interactive controls for import/export with filtering.|

When many people share and edit copies of the same TiddlyWiki document, the ability to quickly collect all these changes back into a single, updated document that can then be redistributed to the entire group is very important.  It can also be very extremely helpful when moving your own tiddlers from document to document (e.g., when upgrading to the latest version of TiddlyWiki, or 'pre-loading' your favorite stylesheets into a new 'empty' TiddlyWiki document.)

This plugin lets you selectively combine tiddlers from any two TiddlyWiki documents.  An interactive control panel lets you pick a document to import from, and then select which tiddlers to import, with prompting for skip, rename, merge or replace actions when importing tiddlers that match existing titles.  Automatically add tags to imported tiddlers so they are easy to find later on.  Generates a detailed report of import 'history' in ImportedTiddlers.
!!!!!Usage
<<<
{{{<<importTiddlers>>}}} or {{{<<importTiddlers core>>}}}
invokes the built-in importTiddlers macro (TW2.1.x+).  If installed in documents using TW2.0.x or earlier, fallback is to use 'link' display (see below)

{{{<<importTiddlers link label tooltip>>}}}
The ''link'' keyword creates an "import tiddlers" link that when clicked to show/hide import control panel.  ''label'' and ''tooltip'' are optional text parameters (enclosed in quotes or {{{[[...]]}}}, and allow you to override the default display text for the link and the mouseover help text, respectively.

{{{<<importTiddlers inline>>}}}
creates import control panel directly in tiddler content

<<importTiddlers inline>>

Press ''[browse]'' to select a TiddlyWiki document file to import, and then press ''[open]''.  Alternatively, you can type in the path/filename or a remote document URL (starting with http://).  When you have entered the desired source location, press ''[load]'' to retrieve the tiddlers from the remote source.  //Note: There may be some delay to permit the browser time to access and load the document before updating the listbox with the titles of all tiddlers that are available to be imported.//

Select one or more titles from the listbox (hold CTRL or SHIFT while clicking to add/remove the highlight from individual list items).  You can press ''[select all]'' to quickly highlight all tiddler titles in the list.  Use the ''[-]'', ''[+]'', or ''[=]'' links to adjust the listbox size so you can view more (or less) tiddler titles at one time.  When you have chosen the tiddlers you want to import and entered any extra tags, press ''[import]'' to begin copying them to the current TiddlyWiki document.

''select: all, new, changes, or differences''

You can click on ''all'', ''new'', ''changes'', or ''differences'' to automatically select a subset of tiddlers from the list. This makes it very quick and easy to find and import just the updated tiddlers you are interested in:
>''"all"'' selects ALL tiddlers from the import source document, even if they have not been changed.
>''"new"'' selects only tiddlers that are found in the import source document, but do not yet exist in the destination document
>''"changes"'' selects only tiddlers that exist in both documents but that are newer in the source document
>''"differences"'' selects all new and existing tiddlers that are different from the destination document (even if destination tiddler is newer)

''Import Tagging:''

Tiddlers that have been imported can be automatically tagged, so they will be easier to find later on, after they have been added to your document.  New tags are entered into the "add tags" input field, and then //added// to the existing tags for each tiddler as it is imported.

''Skip, Rename, Merge, or Replace:''

When importing a tiddler whose title is identical to one that already exists, the import process pauses and the tiddler title is displayed in an input field, along with four push buttons: ''[skip]'', ''[rename]'', ''[merge]'' and ''[replace]''.

To bypass importing this tiddler, press ''[skip]''.  To import the tiddler with a different name (so that both the tiddlers will exist when the import is done), enter a new title in the input field and then press ''[rename]''.   Press ''[merge]'' to combine the content from both tiddlers into a single tiddler.  Press ''[replace]'' to overwrite the existing tiddler with the imported one, discarding the previous tiddler content.

//Note: if both the title ''and'' modification date/////time match, the imported tiddler is assumed to be identical to the existing one, and will be automatically skipped (i.e., not imported) without asking.//

''Import Report History''

When tiddlers are imported, a report is generated into ImportedTiddlers, indicating when the latest import was performed, the number of tiddlers successfully imported, from what location, and by whom. It also includes a list with the title, date and author of each tiddler that was imported.

When the import process is completed, the ImportedTiddlers report is automatically displayed for your review.  If more tiddlers are subsequently imported, a new report is //added// to ImportedTiddlers, above the previous report (i.e., at the top of the tiddler), so that a reverse-chronological history of imports is maintained.

If a cumulative record is not desired, the ImportedTiddlers report may be deleted at any time. A new ImportedTiddlers report will be created the next time tiddlers are imported.

Note: You can prevent the ImportedTiddlers report from being generated for any given import activity by clearing the "create a report" checkbox before beginning the import processing.

<<<
!!!!!Installation
<<<
copy/paste the following tiddlers into your document:
''ImportTiddlersPlugin'' 
''ImportTiddlersPluginPatch2.1.x'' (only for installation in TW2.1.x or earlier)
(both tagged with <<tag systemConfig>>)
>Important Notes:
>* As of 6/27/2007, "patch" functions that provide backward-compatibility with TW2.1.x and earlier have been split into a separate [[ImportTiddlersPluginPatch2.1.x]] tiddler to reduce installation overhead for //this// plugin.  You only need to install this additional plugin tiddler when using ImportTiddlersPlugin in documents using TW2.1.x or earlier.
>* As of 3/21/2007, the interactive {{{<<importTiddlers>>}}} and non-interactive {{{<<loadTiddlers>>}}} macro definitions and related code have been split into separate [[ImportTiddlersPlugin]] and [[LoadTiddlersPlugin]] to permit selective installation of either the interactive and/or non-interactive macro functions
''Quick Installation Tip #1:''
If you are using an unmodified version of TiddlyWiki (core release version <<version>>), you can get a new, empty TiddlyWiki with the Import Tiddlers plugin pre-installed (''[[download from here|TW+ImportExport.html]]''), and then simply import all your content from your old document into this new, empty document.
<<<
!!!!!Revision History
<<<
''2007.06.27 [3.5.5]'' added missing 'fields' params to saveTiddler() calls.  Fixes problem where importing tiddlers would lose the custom fields.  Also, moved functions for backward-compatibility with TW2.1.x to separate [[ImportTiddlersPluginPatch2.1.x]] tiddler, reducing the size of //this// plugin tiddler by a significant amount.
''2007.06.25 [3.5.4]'' added calls to store.suspendNotifications() and store.resumeNotifications().  Eliminates redisplay processing overhead DURING import activities
|please see [[ImportTiddlersPluginHistory]] for additional revision details|
''2005.07.20 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
// // ''MACRO DEFINITION''
//{{{
// Version
version.extensions.importTiddlers = {major: 3, minor: 5, revision: 5, date: new Date(2007,6,27)};

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

// default cookie/option values
if (!config.options.chkImportReport) config.options.chkImportReport=true;

merge(config.macros.importTiddlers,{
	label: "import tiddlers",
	prompt: "Copy tiddlers from another document",
	openMsg: "Opening %0",
	openErrMsg: "Could not open %0 - error=%1",
	readMsg: "Read %0 bytes from %1",
	foundMsg: "Found %0 tiddlers in %1",
	countMsg: "%0 tiddlers selected for import",
	importedMsg: "Imported %0 of %1 tiddlers from %2",
	loadText: "please load a document...",
	closeText: "close",	// text for close button when remote file is loaded
	doneText: "done",	// text for close button when remote file is not loaded
	src: "",		// path/filename or URL of document to import (retrieved from SiteUrl tiddler)
	proxy: "",		// URL for remote proxy script (retrieved from SiteProxy tiddler)
	useProxy: false,	// use specific proxy script in front of remote URL
	inbound: null,		// hash-indexed array of tiddlers from other document
	newTags: "",		// text of tags added to imported tiddlers
	addTags: true,		// add new tags to imported tiddlers
	listsize: 8,		// # of lines to show in imported tiddler list
	importTags: true,	// include tags from remote source document when importing a tiddler
	keepTags: true,		// retain existing tags when replacing a tiddler
	index: 0,		// current processing index in import list
	sort: ""		// sort order for imported tiddler listbox
});

if (config.macros.importTiddlers.coreHandler==undefined)
	config.macros.importTiddlers.coreHandler=config.macros.importTiddlers.handler; // save built-in handler

config.macros.importTiddlers.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	if (!params[0] || params[0].toLowerCase()=='core') { // default to built in
		if (config.macros.importTiddlers.coreHandler)
			config.macros.importTiddlers.coreHandler.apply(this,arguments);
		else 
			createTiddlyButton(place,this.label,this.prompt,onClickImportMenu);
	}
	else if (params[0]=='link') { // show link to floating panel
		var label=params[1]?params[1]:this.label;
		var prompt=params[2]?params[2]:this.prompt;
		createTiddlyButton(place,label,prompt,onClickImportMenu);
	}
	else if (params[0]=='inline') {// show panel as INLINE tiddler content
		createImportPanel(place);
		document.getElementById("importPanel").style.position="static";
		document.getElementById("importPanel").style.display="block";
	}
	else if (config.macros.loadTiddlers)
		config.macros.loadTiddlers.handler(place,macroName,params); // any other params: loadtiddlers
}
//}}}

// // ''INTERFACE DEFINITION''
// // Handle link click to create/show/hide control panel
//{{{
function onClickImportMenu(e)
{
	if (!e) var e = window.event;
	var parent=resolveTarget(e).parentNode;
	var panel = document.getElementById("importPanel");
	if (panel==undefined || panel.parentNode!=parent)
		panel=createImportPanel(parent);
	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);
}
//}}}

// // Create control panel: HTML, CSS
//{{{
function createImportPanel(place) {
	var panel=document.getElementById("importPanel");
	if (panel) { panel.parentNode.removeChild(panel); }
	setStylesheet(config.macros.importTiddlers.css,"importTiddlers");
	panel=createTiddlyElement(place,"span","importPanel",null,null)
	panel.innerHTML=config.macros.importTiddlers.html;
	refreshImportList();
	var siteURL=store.getTiddlerText("SiteUrl"); if (!siteURL) siteURL="";
	document.getElementById("importSourceURL").value=siteURL;
	config.macros.importTiddlers.src=siteURL;
	var siteProxy=store.getTiddlerText("SiteProxy"); if (!siteProxy) siteProxy="SiteProxy";
	document.getElementById("importSiteProxy").value=siteProxy;
	config.macros.importTiddlers.proxy=siteProxy;
	return panel;
}
//}}}

// // CSS
//{{{
config.macros.importTiddlers.css = '\
#importPanel {\
	display: none; position:absolute; z-index:11; width:35em; right:105%; top:3em;\
	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;\
}\
#importPanel a, #importPanel td a { color:#009; display:inline; margin:0px; padding:1px; }\
#importPanel table { width:100%; border:0px; padding:0px; margin:0px; font-size:8pt; line-height:110%; background:transparent; }\
#importPanel tr { border:0px;padding:0px;margin:0px; background:transparent; }\
#importPanel td { color:#000; border:0px;padding:0px;margin:0px; background:transparent; }\
#importPanel select { width:98%;margin:0px;font-size:8pt;line-height:110%;}\
#importPanel input  { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%}\
#importPanel .box { border:1px solid black; padding:3px; margin-bottom:5px; background:#f8f8f8; -moz-border-radius:5px;}\
#importPanel .topline { border-top:2px solid black; padding-top:3px; margin-bottom:5px; }\
#importPanel .rad { width:auto; }\
#importPanel .chk { width:auto; margin:1px;border:0; }\
#importPanel .btn { width:auto; }\
#importPanel .btn1 { width:98%; }\
#importPanel .btn2 { width:48%; }\
#importPanel .btn3 { width:32%; }\
#importPanel .btn4 { width:24%; }\
#importPanel .btn5 { width:19%; }\
#importPanel .importButton { padding: 0em; margin: 0px; font-size:8pt; }\
#importPanel .importListButton { padding:0em 0.25em 0em 0.25em; color: #000000; display:inline }\
#importCollisionPanel { display:none; margin:0.5em 0em 0em 0em; }\
';
//}}}

// // HTML 
//{{{
config.macros.importTiddlers.html = '\
<!-- source and report -->\
<table><tr><td align=left>\
	import from\
	<input type="radio" class="rad" name="importFrom" id="importFromFile" value="file" CHECKED\
		onClick="document.getElementById(\'importLocalPanel\').style.display=this.checked?\'block\':\'none\';\
			document.getElementById(\'importHTTPPanel\').style.display=!this.checked?\'block\':\'none\'"> local file\
	<input type="radio" class="rad" name="importFrom" id="importFromWeb"  value="http"\
		onClick="document.getElementById(\'importLocalPanel\').style.display=!this.checked?\'block\':\'none\';\
			document.getElementById(\'importHTTPPanel\').style.display=this.checked?\'block\':\'none\'"> web server\
</td><td align=right>\
	<input type=checkbox class="chk" id="chkImportReport" checked\
		onClick="config.options[\'chkImportReport\']=this.checked;"> create a report\
</td></tr></table>\
<!-- import from local file  -->\
<div id="importLocalPanel" style="display:block;margin-bottom:5px;margin-top:5px;padding-top:3px;border-top:1px solid #999">\
local document path/filename:<br>\
<input type="file" id="fileImportSource" size=57 style="width:100%"\
	onKeyUp="config.macros.importTiddlers.src=this.value"\
	onChange="config.macros.importTiddlers.src=this.value;">\
</div><!--panel-->\
\
<!-- import from http server -->\
<div id="importHTTPPanel" style="display:none;margin-bottom:5px;margin-top:5px;padding-top:3px;border-top:1px solid #999">\
<table><tr><td align=left>\
	remote document URL:<br>\
</td><td align=right>\
	<input type="checkbox" class="chk" id="importUseProxy"\
		onClick="config.macros.importTiddlers.useProxy=this.checked;\
			document.getElementById(\'importSiteProxy\').style.display=this.checked?\'block\':\'none\'"> use a proxy script\
</td></tr></table>\
<input type="text" id="importSiteProxy" style="display:none;margin-bottom:1px" onfocus="this.select()" value="SiteProxy"\
	onKeyUp="config.macros.importTiddlers.proxy=this.value"\
	onChange="config.macros.importTiddlers.proxy=this.value;">\
<input type="text" id="importSourceURL" onfocus="this.select()" value="SiteUrl"\
	onKeyUp="config.macros.importTiddlers.src=this.value"\
	onChange="config.macros.importTiddlers.src=this.value;">\
</div><!--panel-->\
\
<table><tr><td align=left>\
	select:\
	<a href="JavaScript:;" id="importSelectAll"\
		onclick="onClickImportButton(this)" title="select all tiddlers">\
		&nbsp;all&nbsp;</a>\
	<a href="JavaScript:;" id="importSelectNew"\
		onclick="onClickImportButton(this)" title="select tiddlers not already in destination document">\
		&nbsp;added&nbsp;</a> \
	<a href="JavaScript:;" id="importSelectChanges"\
		onclick="onClickImportButton(this)" title="select tiddlers that have been updated in source document">\
		&nbsp;changes&nbsp;</a> \
	<a href="JavaScript:;" id="importSelectDifferences"\
		onclick="onClickImportButton(this)" title="select tiddlers that have been added or are different from existing tiddlers">\
		&nbsp;differences&nbsp;</a> \
	<a href="JavaScript:;" id="importToggleFilter"\
		onclick="onClickImportButton(this)" title="show/hide selection filter">\
		&nbsp;filter&nbsp;</a> \
</td><td align=right>\
	<a href="JavaScript:;" id="importListSmaller"\
		onclick="onClickImportButton(this)" title="reduce list size">\
		&nbsp;&#150;&nbsp;</a>\
	<a href="JavaScript:;" id="importListLarger"\
		onclick="onClickImportButton(this)" title="increase list size">\
		&nbsp;+&nbsp;</a>\
	<a href="JavaScript:;" id="importListMaximize"\
		onclick="onClickImportButton(this)" title="maximize/restore list size">\
		&nbsp;=&nbsp;</a>\
</td></tr></table>\
<select id="importList" size=8 multiple\
	onchange="setTimeout(\'refreshImportList(\'+this.selectedIndex+\')\',1)">\
	<!-- NOTE: delay refresh so list is updated AFTER onchange event is handled -->\
</select>\
<input type=checkbox class="chk" id="chkAddTags" checked\
	onClick="config.macros.importTiddlers.addTags=this.checked;">add new tags &nbsp;\
<input type=checkbox class="chk" id="chkImportTags" checked\
	onClick="config.macros.importTiddlers.importTags=this.checked;">import source tags &nbsp;\
<input type=checkbox class="chk" id="chkKeepTags" checked\
	onClick="config.macros.importTiddlers.keepTags=this.checked;">keep existing tags<br>\
<input type=text id="txtNewTags" size=15 onKeyUp="config.macros.importTiddlers.newTags=this.value" autocomplete=off>\
<div align=center>\
	<input type=button id="importLoad" class="importButton" style="width:32%" value="load"\
		title="load listbox with tiddlers from source document"\
		onclick="onClickImportButton(this)">\
	<input type=button id="importStart"	 class="importButton" style="width:32%" value="import"\
		title="add selected source tiddlers to the current document"\
		onclick="onClickImportButton(this)">\
	<input type=button id="importClose"	 class="importButton" style="width:32%" value="close"\
		title="clear listbox or hide control panel"\
		onclick="onClickImportButton(this)">\
</div>\
<div id="importCollisionPanel">\
	tiddler already exists:\
	<input type=text id="importNewTitle" size=15 autocomplete=off">\
	<div align=center>\
	<input type=button id="importSkip"	class="importButton" style="width:23%" value="skip"\
		title="do not import this tiddler"\
		onclick="onClickImportButton(this)">\
	<input type=button id="importRename"  class="importButton" style="width:23%" value="rename"\
		title="rename the incoming tiddler"\
		onclick="onClickImportButton(this)">\
	<input type=button id="importMerge"   class="importButton" style="width:23%" value="merge"\
		title="append the incoming tiddler to the existing tiddler"\
		onclick="onClickImportButton(this)">\
	<input type=button id="importReplace" class="importButton" style="width:23%" value="replace"\
		title="discard the existing tiddler"\
		onclick="onClickImportButton(this)">\
	</div>\
</div>\
';
//}}}

// // Control interactions
//{{{
function onClickImportButton(which)
{
	// DEBUG alert(which.id);
	var theList		  = document.getElementById('importList');
	if (!theList) return;
	var thePanel	= document.getElementById('importPanel');
	var theCollisionPanel   = document.getElementById('importCollisionPanel');
	var theNewTitle   = document.getElementById('importNewTitle');
	var count=0;
	switch (which.id)
		{
		case 'fileImportSource':
		case 'importLoad':		// load import source into hidden frame
			importReport();		// if an import was in progress, generate a report
			config.macros.importTiddlers.inbound=null;	// clear the imported tiddler buffer
			refreshImportList();	// reset/resize the listbox
			if (config.macros.importTiddlers.src=="") break;
			// Load document, read it's DOM and fill the list
			config.macros.importTiddlers.loadRemoteFile(config.macros.importTiddlers.src,
				function(success,params,txt,src,xhr) {
					if (!success) { displayMessage(config.macros.importTiddlers.openErrMsg.format([src,xhr.status])); return; }
					var tiddlers = config.macros.importTiddlers.readTiddlersFromHTML(txt);
					var count=tiddlers?tiddlers.length:0;
					var querypos=src.lastIndexOf("?"); if (querypos!=-1) src=src.substr(0,querypos);
					displayMessage(config.macros.importTiddlers.foundMsg.format([count,src]));
					config.macros.importTiddlers.inbound=tiddlers;
					window.refreshImportList(0);
				});
			break;
		case 'importSelectAll':		// select all tiddler list items (i.e., not headings)
			importReport();		// if an import was in progress, generate a report
			for (var t=0,count=0; t < theList.options.length; t++) {
				if (theList.options[t].value=="") continue;
				theList.options[t].selected=true;
				count++;
			}
			clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));
			break;
		case 'importSelectNew':		// select tiddlers not in current document
			importReport();		// if an import was in progress, generate a report
			for (var t=0,count=0; t < theList.options.length; t++) {
				theList.options[t].selected=false;
				if (theList.options[t].value=="") continue;
				theList.options[t].selected=!store.tiddlerExists(theList.options[t].value);
				count+=theList.options[t].selected?1:0;
			}
			clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));
			break;
		case 'importSelectChanges':		// select tiddlers that are updated from existing tiddlers
			importReport();		// if an import was in progress, generate a report
			for (var t=0,count=0; t < theList.options.length; t++) {
				theList.options[t].selected=false;
				if (theList.options[t].value==""||!store.tiddlerExists(theList.options[t].value)) continue;
				for (var i=0; i<config.macros.importTiddlers.inbound.length; i++) // find matching inbound tiddler
					{ var inbound=config.macros.importTiddlers.inbound[i]; if (inbound.title==theList.options[t].value) break; }
				theList.options[t].selected=(inbound.modified-store.getTiddler(theList.options[t].value).modified>0); // updated tiddler
				count+=theList.options[t].selected?1:0;
			}
			clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));
			break;
		case 'importSelectDifferences':		// select tiddlers that are new or different from existing tiddlers
			importReport();		// if an import was in progress, generate a report
			for (var t=0,count=0; t < theList.options.length; t++) {
				theList.options[t].selected=false;
				if (theList.options[t].value=="") continue;
				if (!store.tiddlerExists(theList.options[t].value)) { theList.options[t].selected=true; count++; continue; }
				for (var i=0; i<config.macros.importTiddlers.inbound.length; i++) // find matching inbound tiddler
					{ var inbound=config.macros.importTiddlers.inbound[i]; if (inbound.title==theList.options[t].value) break; }
				theList.options[t].selected=(inbound.modified-store.getTiddler(theList.options[t].value).modified!=0); // changed tiddler
				count+=theList.options[t].selected?1:0;
			}
			clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));
			break;
		case 'importToggleFilter': // show/hide filter
		case 'importFilter': // apply filter
			alert("coming soon!");
			break;
		case 'importStart':		// initiate the import processing
			importReport();		// if an import was in progress, generate a report
			config.macros.importTiddlers.index=0;
			config.macros.importTiddlers.index=importTiddlers(0);
			importStopped();
			break;
		case 'importClose':		// unload imported tiddlers or hide the import control panel
			// if imported tiddlers not loaded, close the import control panel
			if (!config.macros.importTiddlers.inbound) { thePanel.style.display='none'; break; }
			importReport();		// if an import was in progress, generate a report
			config.macros.importTiddlers.inbound=null;	// clear the imported tiddler buffer
			refreshImportList();	// reset/resize the listbox
			break;
		case 'importSkip':	// don't import the tiddler
			var theItem	= theList.options[config.macros.importTiddlers.index];
			for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)
			if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;
			var theImported = config.macros.importTiddlers.inbound[j];
			theImported.status='skipped after asking';			// mark item as skipped
			theCollisionPanel.style.display='none';
			config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index+1);	// resume with NEXT item
			importStopped();
			break;
		case 'importRename':		// change name of imported tiddler
			var theItem		= theList.options[config.macros.importTiddlers.index];
			for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)
			if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;
			var theImported		= config.macros.importTiddlers.inbound[j];
			theImported.status	= 'renamed from '+theImported.title;	// mark item as renamed
			theImported.set(theNewTitle.value,null,null,null,null);		// change the tiddler title
			theItem.value		= theNewTitle.value;			// change the listbox item text
			theItem.text		= theNewTitle.value;			// change the listbox item text
			theCollisionPanel.style.display='none';
			config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index);	// resume with THIS item
			importStopped();
			break;
		case 'importMerge':	// join existing and imported tiddler content
			var theItem	= theList.options[config.macros.importTiddlers.index];
			for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)
			if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;
			var theImported	= config.macros.importTiddlers.inbound[j];
			var theExisting	= store.getTiddler(theItem.value);
			var theText	= theExisting.text+'\n----\n^^merged from: ';
			theText		+='[['+config.macros.importTiddlers.src+'#'+theItem.value+'|'+config.macros.importTiddlers.src+'#'+theItem.value+']]^^\n';
			theText		+='^^'+theImported.modified.toLocaleString()+' by '+theImported.modifier+'^^\n'+theImported.text;
			var theDate	= new Date();
			var theTags	= theExisting.getTags()+' '+theImported.getTags();
			theImported.set(null,theText,null,theDate,theTags);
			theImported.status   = 'merged with '+theExisting.title;	// mark item as merged
			theImported.status  += ' - '+theExisting.modified.formatString("MM/DD/YYYY 0hh:0mm:0ss");
			theImported.status  += ' by '+theExisting.modifier;
			theCollisionPanel.style.display='none';
			config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index);	// resume with this item
			importStopped();
			break;
		case 'importReplace':		// substitute imported tiddler for existing tiddler
			var theItem		  = theList.options[config.macros.importTiddlers.index];
			for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)
			if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;
			var theImported     = config.macros.importTiddlers.inbound[j];
			var theExisting	  = store.getTiddler(theItem.value);
			theImported.status  = 'replaces '+theExisting.title;		// mark item for replace
			theImported.status += ' - '+theExisting.modified.formatString("MM/DD/YYYY 0hh:0mm:0ss");
			theImported.status += ' by '+theExisting.modifier;
			theCollisionPanel.style.display='none';
			config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index);	// resume with THIS item
			importStopped();
			break;
		case 'importListSmaller':		// decrease current listbox size, minimum=5
			if (theList.options.length==1) break;
			theList.size-=(theList.size>5)?1:0;
			config.macros.importTiddlers.listsize=theList.size;
			break;
		case 'importListLarger':		// increase current listbox size, maximum=number of items in list
			if (theList.options.length==1) break;
			theList.size+=(theList.size<theList.options.length)?1:0;
			config.macros.importTiddlers.listsize=theList.size;
			break;
		case 'importListMaximize':	// toggle listbox size between current and maximum
			if (theList.options.length==1) break;
			theList.size=(theList.size==theList.options.length)?config.macros.importTiddlers.listsize:theList.options.length;
			break;
		}
}
//}}}

// // refresh listbox
//{{{
function refreshImportList(selectedIndex)
{
	var theList  = document.getElementById("importList");
	if (!theList) return;
	// if nothing to show, reset list content and size
	if (!config.macros.importTiddlers.inbound) 
	{
		while (theList.length > 0) { theList.options[0] = null; }
		theList.options[0]=new Option(config.macros.importTiddlers.loadText,"",false,false);
		theList.size=config.macros.importTiddlers.listsize;
		document.getElementById('importLoad').disabled=false;
		document.getElementById('fileImportSource').disabled=false;
		document.getElementById('importFromFile').disabled=false;
		document.getElementById('importFromWeb').disabled=false;
		document.getElementById('importClose').value=config.macros.importTiddlers.closeText;
		return;
	}

	// get the sort order
	if (!selectedIndex)   selectedIndex=0;
	if (selectedIndex==0) config.macros.importTiddlers.sort='title';		// heading
	if (selectedIndex==1) config.macros.importTiddlers.sort='title';
	if (selectedIndex==2) config.macros.importTiddlers.sort='modified';
	if (selectedIndex==3) config.macros.importTiddlers.sort='tags';
	if (selectedIndex>3) {
		// display selected tiddler count
		for (var t=0,count=0; t < theList.options.length; t++) {
			if (!theList.options[t].selected) continue;
			if (theList.options[t].value!="")
				count+=1;
			else { // if heading is selected, deselect it, and then select and count all in section
				theList.options[t].selected=false;
				for ( t++; t<theList.options.length && theList.options[t].value!=""; t++) {
					theList.options[t].selected=true;
					count++;
				}
			}
		}
		clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));
		return; // no refresh needed
	}

	// there are inbound tiddlers loaded... disable inapplicable controls...
	document.getElementById('importLoad').disabled=true;
	document.getElementById('fileImportSource').disabled=true;
	document.getElementById('importFromFile').disabled=true;
	document.getElementById('importFromWeb').disabled=true;
	document.getElementById('importClose').value=config.macros.importTiddlers.doneText;

	// get the alphasorted list of tiddlers (optionally, filter out unchanged tiddlers)
	var tiddlers=config.macros.importTiddlers.inbound;
	tiddlers.sort(function (a,b) {if(a['title'] == b['title']) return(0); else return (a['title'] < b['title']) ? -1 : +1; });
	// clear current list contents
	while (theList.length > 0) { theList.options[0] = null; }
	// add heading and control items to list
	var i=0;
	var indent=String.fromCharCode(160)+String.fromCharCode(160);
	theList.options[i++]=new Option(tiddlers.length+' tiddler'+((tiddlers.length!=1)?'s are':' is')+' in the document',"",false,false);
	theList.options[i++]=new Option(((config.macros.importTiddlers.sort=="title"   )?">":indent)+' [by title]',"",false,false);
	theList.options[i++]=new Option(((config.macros.importTiddlers.sort=="modified")?">":indent)+' [by date]',"",false,false);
	theList.options[i++]=new Option(((config.macros.importTiddlers.sort=="tags")?">":indent)+' [by tags]',"",false,false);
	// output the tiddler list
	switch(config.macros.importTiddlers.sort)
		{
		case "title":
			for(var t = 0; t < tiddlers.length; t++)
				theList.options[i++] = new Option(tiddlers[t].title,tiddlers[t].title,false,false);
			break;
		case "modified":
			// sort descending for newest date first
			tiddlers.sort(function (a,b) {if(a['modified'] == b['modified']) return(0); else return (a['modified'] > b['modified']) ? -1 : +1; });
			var lastSection = "";
			for(var t = 0; t < tiddlers.length; t++) {
				var tiddler = tiddlers[t];
				var theSection = tiddler.modified.toLocaleDateString();
				if (theSection != lastSection) {
					theList.options[i++] = new Option(theSection,"",false,false);
					lastSection = theSection;
				}
				theList.options[i++] = new Option(indent+indent+tiddler.title,tiddler.title,false,false);
			}
			break;
		case "tags":
			var theTitles = {}; // all tiddler titles, hash indexed by tag value
			var theTags = new Array();
			for(var t=0; t<tiddlers.length; t++) {
				var title=tiddlers[t].title;
				var tags=tiddlers[t].tags;
				if (!tags || !tags.length) {
					if (theTitles["untagged"]==undefined) { theTags.push("untagged"); theTitles["untagged"]=new Array(); }
					theTitles["untagged"].push(title);
				}
				else for(var s=0; s<tags.length; s++) {
					if (theTitles[tags[s]]==undefined) { theTags.push(tags[s]); theTitles[tags[s]]=new Array(); }
					theTitles[tags[s]].push(title);
				}
			}
			theTags.sort();
			for(var tagindex=0; tagindex<theTags.length; tagindex++) {
				var theTag=theTags[tagindex];
				theList.options[i++]=new Option(theTag,"",false,false);
				for(var t=0; t<theTitles[theTag].length; t++)
					theList.options[i++]=new Option(indent+indent+theTitles[theTag][t],theTitles[theTag][t],false,false);
			}
			break;
		}
	theList.selectedIndex=selectedIndex;		  // select current control item
	if (theList.size<config.macros.importTiddlers.listsize) theList.size=config.macros.importTiddlers.listsize;
	if (theList.size>theList.options.length) theList.size=theList.options.length;
}
//}}}

// // re-entrant processing for handling import with interactive collision prompting
//{{{
function importTiddlers(startIndex)
{
	if (!config.macros.importTiddlers.inbound) return -1;

	var theList = document.getElementById('importList');
	if (!theList) return;
	var t;
	// if starting new import, reset import status flags
	if (startIndex==0)
		for (var t=0;t<config.macros.importTiddlers.inbound.length;t++)
			config.macros.importTiddlers.inbound[t].status="";
	for (var i=startIndex; i<theList.options.length; i++)
		{
		// if list item is not selected or is a heading (i.e., has no value), skip it
		if ((!theList.options[i].selected) || ((t=theList.options[i].value)==""))
			continue;
		for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)
			if (config.macros.importTiddlers.inbound[j].title==t) break;
		var inbound = config.macros.importTiddlers.inbound[j];
		var theExisting = store.getTiddler(inbound.title);
		// avoid redundant import for tiddlers that are listed multiple times (when 'by tags')
		if (inbound.status=="added")
			continue;
		// don't import the "ImportedTiddlers" history from the other document...
		if (inbound.title=='ImportedTiddlers')
			continue;
		// if tiddler exists and import not marked for replace or merge, stop importing
		if (theExisting && (inbound.status.substr(0,7)!="replace") && (inbound.status.substr(0,5)!="merge"))
			return i;
		// assemble tags (remote + existing + added)
		var newTags = "";
		if (config.macros.importTiddlers.importTags)
			newTags+=inbound.getTags()	// import remote tags
		if (config.macros.importTiddlers.keepTags && theExisting)
			newTags+=" "+theExisting.getTags(); // keep existing tags
		if (config.macros.importTiddlers.addTags && config.macros.importTiddlers.newTags.trim().length)
			newTags+=" "+config.macros.importTiddlers.newTags; // add new tags
		inbound.set(null,null,null,null,newTags.trim());
		// set the status to 'added' (if not already set by the 'ask the user' UI)
		inbound.status=(inbound.status=="")?'added':inbound.status;
		// do the import!
		store.suspendNotifications();
		store.saveTiddler(inbound.title, inbound.title, inbound.text, inbound.modifier, inbound.modified, inbound.tags, inbound.fields, true, inbound.created);
                store.fetchTiddler(inbound.title).created = inbound.created; // force creation date to imported value (needed for TW2.1.x and earlier)
		store.resumeNotifications();
		}
	return(-1);	// signals that we really finished the entire list
}
//}}}

//{{{
function importStopped()
{
	var theList     = document.getElementById('importList');
	var theNewTitle = document.getElementById('importNewTitle');
	if (!theList) return;
	if (config.macros.importTiddlers.index==-1)
		importReport();		// import finished... generate the report
	else
		{
		// import collision... show the collision panel and set the title edit field
		document.getElementById('importCollisionPanel').style.display='block';
		theNewTitle.value=theList.options[config.macros.importTiddlers.index].value;
		}
}
//}}}

// // ''REPORT GENERATOR''
//{{{
function importReport(quiet)
{
	if (!config.macros.importTiddlers.inbound) return;
	// DEBUG alert('importReport: start');

	// if import was not completed, the collision panel will still be open... close it now.
	var panel=document.getElementById('importCollisionPanel'); if (panel) panel.style.display='none';

	// get the alphasorted list of tiddlers
	var tiddlers = config.macros.importTiddlers.inbound;
	// gather the statistics
	var count=0;
	for (var t=0; t<tiddlers.length; t++)
		if (tiddlers[t].status && tiddlers[t].status.trim().length && tiddlers[t].status.substr(0,7)!="skipped") count++;

	// generate a report
	if (count && config.options.chkImportReport) {
		// get/create the report tiddler
		var theReport = store.getTiddler('ImportedTiddlers');
		if (!theReport) { theReport= new Tiddler(); theReport.title = 'ImportedTiddlers'; theReport.text  = ""; }
		// format the report content
		var now = new Date();
		var newText = "On "+now.toLocaleString()+", "+config.options.txtUserName
		newText +=" imported "+count+" tiddler"+(count==1?"":"s")+" from\n[["+config.macros.importTiddlers.src+"|"+config.macros.importTiddlers.src+"]]:\n";
		if (config.macros.importTiddlers.addTags && config.macros.importTiddlers.newTags.trim().length)
			newText += "imported tiddlers were tagged with: \""+config.macros.importTiddlers.newTags+"\"\n";
		newText += "<<<\n";
		for (var t=0; t<tiddlers.length; t++) if (tiddlers[t].status) newText += "#[["+tiddlers[t].title+"]] - "+tiddlers[t].status+"\n";
		newText += "<<<\n";
		// update the ImportedTiddlers content and show the tiddler
		theReport.text	 = newText+((theReport.text!="")?'\n----\n':"")+theReport.text;
		theReport.modifier = config.options.txtUserName;
		theReport.modified = new Date();
                store.saveTiddler(theReport.title, theReport.title, theReport.text, theReport.modifier, theReport.modified, theReport.tags, theReport.fields);
		if (!quiet) { story.displayTiddler(null,theReport.title,1,null,null,false); story.refreshTiddler(theReport.title,1,true); }
	}

	// reset status flags
	for (var t=0; t<config.macros.importTiddlers.inbound.length; t++) config.macros.importTiddlers.inbound[t].status="";

	// mark document as dirty and let display update as needed
	if (count) { store.setDirty(true); store.notifyAll(); }

	// always show final message when tiddlers were actually loaded
	if (count) displayMessage(config.macros.importTiddlers.importedMsg.format([count,tiddlers.length,config.macros.importTiddlers.src]));
}
//}}}

// // File and XMLHttpRequest I/O
//{{{
config.macros.importTiddlers.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;
}

config.macros.importTiddlers.loadRemoteFile = function(src,callback,quiet) {
	if (src==undefined || !src.length) return null; // filename is required
	if (!quiet) clearMessage();
	if (!quiet) displayMessage(this.openMsg.format([src]));
	if (src.substr(0,5)!="http:" && src.substr(0,5)!="file:") { // if src is relative (i.e., not a URL)
		if (!this.fileExists(src)) { // if file cannot be found, might be relative path.. try fixup
			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);
			src=pathPrefix+src;
			if (pathPrefix.substr(0,5)!="http:") src=getLocalPath(src);
		}
	}
	if (src.substr(0,5)!="http:" && src.substr(0,5)!="file:") { // if not a URL, read from local filesystem
		var txt=loadFile(src);
		if ((txt==null)||(txt==false)) // file didn't load
			{ if (!quiet) displayMessage(config.macros.importTiddlers.openErrMsg.format([src,"(filesystem error)"])); }
		else {
			if (!quiet) displayMessage(config.macros.importTiddlers.readMsg.format([txt.length,src]));
			if (callback) callback(true,quiet,convertUTF8ToUnicode(txt),src,null);
		}
	}
	else {
		var xhr=loadRemoteFile(src,callback,quiet);
		if (!quiet && !xhr) displayMessage(config.macros.importTiddlers.openErrMsg.format([src,"(XMLHTTPRequest error)"]));
	}
}

config.macros.importTiddlers.readTiddlersFromHTML=function(html)
{
	var remoteStore=new TiddlyWiki();
	remoteStore.importTiddlyWiki(html);
	return remoteStore.getTiddlers("title");	
}
//}}}
/***
|Name|ImportTiddlersPluginPatch|
|Source|http://www.TiddlyTools.com/#ImportTiddlersPluginPatch|
|Version|3.5.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|ImportTiddlersPlugin|
|Overrides|config.macros.importTiddlers.handler|
|Description|backward-compatible function patches for use with ImportTiddlersPlugin and TW2.1.x or earlier|

!!!!!Usage
<<<
The current version ImportTiddlersPlugin is compatible with the TW2.2.x core functions.  This "patch" plugin provides additional functions needed to enable the current version of ImportTiddlersPlugin to operate correctly under TW2.1.x or earlier.

{{medium{You do not need to install this plugin if you are using TW2.2.0 or above}}}
(though it won't hurt anything if you do... it will just take up more space).
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''ImportTiddlersPlugin'' //(main plugin body)//
''ImportTiddlersPluginPatch2.1.x'' //(patches for TW2.1.x or earlier)//
(both tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.06.27 [3.5.5]'' compatibility functions split from ImportTiddlersPlugin
|please see [[ImportTiddlersPlugin]] for additional revision details|
''2005.07.20 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
// these functions are only defined when installed in TW2.1.x and earlier... 
if (version.major+version.minor/10 <= 2.1) {

// Version
version.extensions.importTiddlersPatch21x = {major: 3, minor: 5, revision: 5, date: new Date(2007,6,27)};

// fixups for TW2.0.x and earlier
if (window.merge==undefined) window.merge=function(dst,src,preserveExisting)
	{ for (p in src) if (!preserveExisting||dst[p]===undefined) dst[p]=src[p]; return dst; }
if (config.macros.importTiddlers==undefined) config.macros.importTiddlers={ };

config.macros.importTiddlers.loadRemoteFile = function(src,callback,quiet) {
	if (src==undefined || !src.length) return null; // filename is required
	if (!quiet) clearMessage();
	if (!quiet) displayMessage(this.openMsg.format([src]));
	if (src.substr(0,5)!="http:" && src.substr(0,5)!="file:") { // if src is relative (i.e., not a URL)
		if (!this.fileExists(src)) { // if file cannot be found, might be relative path.. try fixup
			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);
			src=pathPrefix+src;
			if (pathPrefix.substr(0,5)!="http:") src=getLocalPath(src);
		}
	}
	if (src.substr(0,4)!="http" && src.substr(0,4)!="file") { // if not a URL, read from local filesystem
		var txt=loadFile(src);
		if ((txt==null)||(txt==false)) // file didn't load
			{ if (!quiet) displayMessage(config.macros.importTiddlers.openErrMsg.format([src,"(unknown)"])); }
		else {
			if (!quiet) displayMessage(config.macros.importTiddlers.readMsg.format([txt.length,src]));
			if (callback) callback(true,quiet,convertUTF8ToUnicode(txt),src,null);
		}
	}
	else {
		var x; // get an request object
		try {x = new XMLHttpRequest()} // moz
		catch(e) {
			try {x = new ActiveXObject("Msxml2.XMLHTTP")} // IE 6
			catch (e) {
				try {x = new ActiveXObject("Microsoft.XMLHTTP")} // IE 5
				catch (e) { return }
			}
		}
		// setup callback function to handle server response(s)
		x.onreadystatechange = function() {
			if (x.readyState == 4) {
				if (x.status==0 || x.status == 200) {
					if (!quiet) displayMessage(config.macros.importTiddlers.readMsg.format([x.responseText.length,src]));
					if (callback) callback(true,quiet,x.responseText,src,x);
				}
				else {
					if (!quiet) displayMessage(config.macros.importTiddlers.openErrMsg.format([src,x.status]));
				}
			}
		}
		// get privileges to read another document's DOM via http:// or file:// (moz-only)
		if (typeof(netscape)!="undefined") {
			try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
			catch (e) { if (!quiet) displayMessage(e.description?e.description:e.toString()); }
		}
		// send the HTTP request
		try {
			var url=src+(src.indexOf('?')<0?'?':'&')+'nocache='+Math.random();
			x.open("GET",src,true);
			if (x.overrideMimeType) x.overrideMimeType('text/html');
			x.send(null);
		}
		catch (e) {
			if (!quiet) {
				displayMessage(config.macros.importTiddlers.openErrMsg.format([src,"(unknown)"]));
				displayMessage(e.description?e.description:e.toString());
			}
		}
	}
}

config.macros.importTiddlers.readTiddlersFromHTML=function(html) {
	// for TW2.1 and earlier
	// extract store area from html 
	var start=html.indexOf('<div id="storeArea">');
	var end=html.indexOf("<!--POST-BODY-START--"+">",start);
	if (end==-1) var end=html.indexOf("</body"+">",start); // backward-compatibility for older documents
	var sa="<html><body>"+html.substring(start,end)+"</body></html>";

	// load html into iframe document
	var f=document.getElementById("loaderFrame"); if (f) document.body.removeChild(f);
	f=document.createElement("iframe"); f.id="loaderFrame";
	f.style.width="0px"; f.style.height="0px"; f.style.border="0px";
	document.body.appendChild(f);
	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(sa); d.close();

	// read tiddler DIVs from storeArea DOM element	
	var sa = d.getElementById("storeArea");
	if (!sa) return null;
	sa.normalize();
	var nodes = sa.childNodes;
	if (!nodes || !nodes.length) return null;
	var tiddlers = [];
	for(var t = 0; t < nodes.length; t++) {
		var title = null;
		if(nodes[t].getAttribute)
			title = nodes[t].getAttribute("title"); // TW 2.2+
		if(!title && nodes[t].getAttribute)
			title = nodes[t].getAttribute("tiddler"); // TW 2.1.x
		if(!title && nodes[t].id && (nodes[t].id.substr(0,5) == "store"))
			title = nodes[t].id.substr(5); // TW 1.2.x
		if(title && title != "")
			tiddlers.push((new Tiddler()).loadFromDiv(nodes[t],title));
	}
	return tiddlers;
}

// // COPIED FROM TW2.2beta5
// // enables reading tiddler definitions using TW2.2 storeArea format, even when plugin is running under TW2.1.x
// // storeArea format changes include:
// // <pre> nodes
// // attribute(tiddler) renamed to attribute(title)
// // attribute(modified) is omitted if created==modified
TW21Loader.prototype.internalizeTiddler = function(store,tiddler,title,node)
{
	var e = node.firstChild;
	var text = null;
	if(node.getAttribute("tiddler")) {
		text = getNodeText(e).unescapeLineBreaks();
	} else {
		while(e.nodeName!="PRE" && e.nodeName!="pre") {
			e = e.nextSibling;
		}
		text = e.innerHTML.replace(/\r/mg,"").htmlDecode();
	}
	var modifier = node.getAttribute("modifier");
	var c = node.getAttribute("created");
	var m = node.getAttribute("modified");
	var created = c ? Date.convertFromYYYYMMDDHHMM(c) : version.date;
	var modified = m ? Date.convertFromYYYYMMDDHHMM(m) : created;
	var tags = node.getAttribute("tags");
	var fields = {};
	var attrs = node.attributes;
	for(var i = attrs.length-1; i >= 0; i--) {
		var name = attrs[i].name;
		if (attrs[i].specified && !TiddlyWiki.isStandardField(name)) {
			fields[name] = attrs[i].value.unescapeLineBreaks();
		}
	}
	tiddler.assign(title,text,modifier,modified,tags,created,fields);
	return tiddler;
};

} // END OF TW2.1.x backward-compatibility functions
//}}}
On Wednesday, October 10, 2007 1:32:35 AM, GabrielBurca imported 21 tiddlers from
[[D:\NetBeansProjects\VirtMus\Docs\index.html|D:\NetBeansProjects\VirtMus\Docs\index.html]]:
<<<
#[[ChangeLog]] - added
#[[DefaultTiddlers]] - added
#[[DeveloperInfo]] - added
#[[FootSwitch]] - added
#[[GabrielBurca]] - added
#[[LiveWindowKeyboardShortcuts]] - added
#[[MainMenu]] - added
#[[MenuOptions]] - added
#[[MusicPages]] - added
#[[PlayLists]] - added
#[[RepositoryStructure]] - added
#[[ScreenShots]] - added
#[[SiteSubtitle]] - replaces SiteSubtitle - 6/28/2007 01:54:00 by ELSDesignStudios
#[[SiteTitle]] - added
#[[SongLists]] - added
#[[TiddlyWiki]] - added
#[[ToDo]] - added
#[[VirtMus]] - added
#[[VirtMusGettingStarted]] - added
#[[VirtMusInstall]] - added
#[[VirtMusOptions]] - added
<<<
Download the JAI library from: https://jai.dev.java.net/binary-builds.html

If you're an end-user, download: [[jai-1_1_3-lib-windows-i586-jre.exe|http://download.java.net/media/jai/builds/release/1_1_3/jai-1_1_3-lib-windows-i586-jre.exe]] (or the equivalent JRE file for your platform).

If you're a developer, download: [[jai-1_1_3-lib-windows-i586-jdk.exe|http://download.java.net/media/jai/builds/release/1_1_3/jai-1_1_3-lib-windows-i586-jdk.exe]] (or the equivalent JRE file for your platform) and also see the instructions found at: 
http://download.java.net/media/jai/builds/release/1_1_3/INSTALL.html
The "Live Window" is the full screen that appears after pressing F5. This is the view that is used during a performance.
The following keyboard shortcuts can be used when viewing the live window (the full-screen display that comes up when you press F5):

* Page down or the space bar
** Advances a full page
* Page up
** Goes back a full page
* The digit ''1''
** Goes to the first page of the song/playlist
* Any other key OR
* Left mouse button
** Scrolls the page forward by the amount configured in the options
* Right mouse button
** Scrolls the page backwards by the amount configured in the options
/***
|Name|LoadTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#LoadTiddlersPlugin|
|Version|3.4.8|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|macro for automated updates or one-click installations of tiddlers from remote sources|

!!!!!Usage
<<<
Syntax:
{{{<<loadTiddlers label:text prompt:text filter source quiet confirm force noreport tag tag tag...>>}}}

Example:
{{{<<loadTiddlers "label:load tiddlers from %0" example.html confirm temporary>>}}}
<<loadTiddlers "label:load tiddlers from %0" example.html confirm temporary>>

Where:
''"""label:text"""'' and ''"""prompt:text"""''
>defines link text and tooltip (prompt) that can be clicked to trigger the load tiddler processing.  If a label is NOT provided, then no link is created and the loadTiddlers function is performed whenever the containing tiddler is rendered.
''filter'' (optional) determines which tiddlers will be automatically selected for importing.  Use one of the following keywords:
>''"all"'' retrieves ALL tiddlers from the import source document, even if they have not been changed.
>''"new"'' retrieves only tiddlers that are found in the import source document, but do not yet exist in the destination document
>''"changes"'' retrieves only tiddlers that exist in both documents for which the import source tiddler is newer than the existing tiddler
>''"updates"'' retrieves both ''new'' and ''changed'' tiddlers (this is the default action when none is specified)
>''""""tiddler:TiddlerName""""'' retrieves only the specific tiddler named in the parameter.
>''""""tag:text""""'' retrieves only the tiddlers tagged with the indicated text.
>> Note: ''if an existing tiddler is tagged with 'noReload', then it will not be overwritten'', even if the inbound tiddler has been selected by the filtering process.  This allows you to make local changes to imported tiddlers while ensuring that those changes won't be lost due to automatic tiddler updates retrieved from the import source document.
''source'' (required) is the location of the imported document.  It can be either a local document path/filename in whatever format your system requires, or a remote web location (starting with "http://" or "https://")
>use the keyword ''ask'' to prompt for a source location whenever the macro is invoked
''"quiet"'' (optional)
>supresses all status message during the import processing (e.g., "opening local file...", "found NN tiddlers..." etc).  Note that if ANY tiddlers are actualy imported, a final information message will still be displayed (along with the ImportedTiddlers report), even when 'quiet' is specified.  This ensures that changes to your document cannot occur without any visible indication at all.
''"confirm"'' (optional)
>adds interactive confirmation.  A browser message box (OK/Cancel) is displayed for each tiddler that will be imported, so that you can manually bypass any tiddlers that you do not want to import.
''"force"'' (optional)
>import all matching tiddlers, even if unchanged
''"noreport"'' (optional)
>suppress generation of [[ImportedTiddlers]] report
''"tag tag tag..."'' (optional)
>any remaining parameters are used as tag values to be added to each imported tiddler (i.e., "tag-on-import")
<<<
!!!!!Installation
<<<
copy/paste the following tiddlers into your document:
''LoadTiddlersPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.06.27 [3.4.8]'' added missing 'fields' params to saveTiddler() call. Fixes problem where importing tiddlers would lose the custom fields.
''2007.06.25 [3.4.7]'' add calls to store.suspendNotifications() and store.resumeNotifications() to eliminate redisplay overhead DURING import activities.
''2007.05.27 [3.4.6]'' in handler(),  loadRemoteFile() and doImport(), added 'noreport' flag to suppress generation of ImportedTiddlers
''2007.05.27 [3.4.5]'' in handler(),  initialize 'newTags' to [] (empty array) instead of null... fixes fatal error when loading tiddler without autotagging.
''2007.04.22 [3.4.4]'' in readTiddlersFromHTML(), for TW2.2 and above, use importTiddlyWiki() (new core functionality) to get tiddlers from remote file content.  Also, copied updated TW21Loader.prototype.internalizeTiddler() definition from TW2.2b5 so plugin can read tiddlers from TW2.2+ even when running under TW2.1.x
''2007.04.05 [3.4.3]'' in doImport(), changed this.readTiddlersFromHTML(html) to config.macros.loadTiddlers.readTiddlersFromHTML(html).  Fixes error caused when ImportTiddlersPlugin has NOT been installed along side this plugin.
''2007.03.26 [3.4.2]'' renamed import() to doImport() to fix IE load-time error ("identifier expected").  This may also cause a problem with FF1.5.0.x.... Apparently, "import" is a reserved word in some browsers...
''2007.03.22 [3.4.1]'' code cleanup: moved all functions inside object def'n, re-wrote report function
''2007.03.21 [3.4.0]'' split ImportTiddlersPlugin and LoadTiddlersPlugin functionality into separate plugins
|please see [[ImportTiddlersPluginHistory]] for additional revision details|
''2005.07.20 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
// // ''MACRO DEFINITION''
//{{{
// Version
version.extensions.loadTiddlers = {major: 3, minor: 4, revision: 8, date: new Date(2007,6,27)};
//{{{
config.macros.loadTiddlers = {
	label: "",
	prompt: "add/update tiddlers from '%0'",
	lockedTag: "noReload",	// if existing tiddler has this tag value, don't overwrite it, even if inbound tiddler is newer
	askMsg: "Please enter a local path/filename or a remote URL",
	openMsg: "Opening %0",
	openErrMsg: "Could not open %0 - error=%1",
	readMsg: "Read %0 bytes from %1",
	foundMsg: "Found %0 tiddlers in %1",
	nochangeMsg: "'%0' is up-to-date... skipped.",
	lockedMsg: "'%0' is tagged '%1'... skipped.",
	skippedMsg: "skipped (cancelled by user)",
	loadedMsg: "Loaded %0 of %1 tiddlers from %2",
	reportTitle: "ImportedTiddlers",
	handler: function(place,macroName,params) {
		var label=(params[0] && params[0].substr(0,6)=='label:')?params.shift().substr(6):this.label;
		var prompt=(params[0] && params[0].substr(0,7)=='prompt:')?params.shift().substr(7):this.prompt;
		var filter="updates";
		if (params[0] && (params[0]=='all' || params[0]=='new' || params[0]=='changes' || params[0]=='updates'
			|| params[0].substr(0,8)=='tiddler:' || params[0].substr(0,4)=='tag:'))
			filter=params.shift();
		var src=params.shift(); if (!src || !src.length) return; // filename is required
		var quiet=(params[0]=="quiet"); if (quiet) params.shift();
		var ask=(params[0]=="confirm"); if (ask) params.shift();
		var force=(params[0]=="force"); if (force) params.shift();
		var noreport=(params[0]=="noreport"); if (noreport) params.shift();
		this.newTags=[]; if (params[0]) this.newTags=params; // any remaining params are used as "autotags"
		if (label.trim().length) {
			// link triggers load tiddlers from another file/URL and then applies filtering rules to add/replace tiddlers in the store
			createTiddlyButton(place,label.format([src]),prompt.format([src]), function() {
				if (src=="ask") src=prompt(this.askMsg);
				config.macros.loadTiddlers.loadFile(src,config.macros.loadTiddlers.doImport,{quiet:quiet,ask:ask,filter:filter,force:force,noreport:noreport});
			})
		}
		else {
			// load tiddlers from another file/URL and then apply filtering rules to add/replace tiddlers in the store
			if (src=="ask") src=prompt(this.askMsg);
			config.macros.loadTiddlers.loadFile(src,config.macros.loadTiddlers.doImport,{quiet:quiet,ask:ask,filter:filter,force:force,noreport:noreport});
		}
	},
	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;
	},
	loadFile: function(src,callback,params) {
		var quiet=params.quiet;
		if (src==undefined || !src.length) return null; // filename is required
		if (!quiet) clearMessage();
		if (!quiet) displayMessage(this.openMsg.format([src]));
		if (src.substr(0,5)!="http:" && src.substr(0,5)!="file:") { // if src is relative (i.e., not a URL)
			if (!this.fileExists(src)) { // if file cannot be found, might be relative path.. try fixup
				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);
				src=pathPrefix+src;
				if (pathPrefix.substr(0,5)!="http:") src=getLocalPath(src);
			}
		}
		if (src.substr(0,4)!="http" && src.substr(0,4)!="file") { // if not a URL, read from local filesystem
			var txt=loadFile(src);
			if ((txt==null)||(txt==false)) // file didn't load
				{ if (!quiet) displayMessage(this.openErrMsg.format([src,"(unknown)"])); }
			else {
				if (!quiet) displayMessage(this.readMsg.format([txt.length,src]));
				if (callback) callback(true,params,convertUTF8ToUnicode(txt),src,null);
			}
		}
		else 
			loadRemoteFile(src,callback,params);
	},
	readTiddlersFromHTML: function(html) {
		// for TW2.2+
		if (TiddlyWiki.prototype.importTiddlyWiki!=undefined) {
			var remoteStore=new TiddlyWiki();
			remoteStore.importTiddlyWiki(html);
			return remoteStore.getTiddlers("title");	
		}
	},
	doImport: function(status,params,html,src,xhr) {
		var quiet=params.quiet;
		var ask=params.ask;
		var filter=params.filter;
		var force=params.force;
		var noreport=params.noreport;
		var tiddlers = config.macros.loadTiddlers.readTiddlersFromHTML(html);
		var count=tiddlers?tiddlers.length:0;
		if (!quiet) displayMessage(config.macros.loadTiddlers.foundMsg.format([count,src]));
		store.suspendNotifications();
		var count=0;
		if (tiddlers) for (var t=0;t<tiddlers.length;t++) {
			var inbound = tiddlers[t];
			var theExisting = store.getTiddler(inbound.title);
			if (inbound.title==config.macros.loadTiddlers.reportTitle)
				continue; // skip "ImportedTiddlers" history from the other document...
			if (theExisting && theExisting.tags.contains(config.macros.loadTiddlers.lockedTag)) {
				if (!quiet) displayMessage(config.macros.loadTiddlers.lockedMsg.format([theExisting.title,config.macros.loadTiddlers.lockedTag]));
				continue; // skip existing tiddler if tagged with 'noReload'
			}
			// apply the all/new/changes/updates filter (if any)
			if (filter && filter!="all") {
				if ((filter=="new") && theExisting) // skip existing tiddlers
					continue;
				if ((filter=="changes") && !theExisting) // skip new tiddlers
					continue;
				if ((filter.substr(0,4)=="tag:") && inbound.tags.find(filter.substr(4))==null) // must match specific tag value
					continue;
				if ((filter.substr(0,8)=="tiddler:") && inbound.title!=filter.substr(8)) // must match specific tiddler name
					continue;
				if (!force && store.tiddlerExists(inbound.title) && ((theExisting.modified.getTime()-inbound.modified.getTime())>=0))
					{ if (!quiet) displayMessage(config.macros.loadTiddlers.nochangeMsg.format([inbound.title])); continue; }
			}
			// get confirmation if required
			if (ask && !confirm((theExisting?"Update":"Add")+" tiddler '"+inbound.title+"'\nfrom "+src))
				{ tiddlers[t].status=config.macros.loadTiddlers.skippedMsg; continue; }
			// DO IT!
			var tags=Array.concat(inbound.tags,config.macros.loadTiddlers.newTags);
	                store.saveTiddler(inbound.title, inbound.title, inbound.text, inbound.modifier, inbound.modified, tags, inbound.fields, true, inbound.created);
	                store.fetchTiddler(inbound.title).created = inbound.created; // force creation date to imported value - needed for TW2.1.3 or earlier
			tiddlers[t].status=theExisting?"updated":"added"
			count++;
		}
		store.resumeNotifications();
		if (count) {
			// refresh display
			store.setDirty(true); store.notifyAll();
			// generate a report
			if (!noreport) config.macros.loadTiddlers.report(src,tiddlers,count,quiet);
		}
		// always show final message when tiddlers were actually loaded
		if (!quiet||count) displayMessage(config.macros.loadTiddlers.loadedMsg.format([count,tiddlers.length,src]));
	},
	report: function(src,tiddlers,count,quiet) {
		// format the new report content
		var newText = "On "+(new Date()).toLocaleString()+", ";
		newText += config.options.txtUserName+" loaded "+count+" tiddlers ";
		newText += "from\n[["+src+"|"+src+"]]:\n";
		newText += "<<<\n";
		for (var t=0; t<tiddlers.length; t++)
			if (tiddlers[t].status)
				newText += "#[["+tiddlers[t].title+"]] - "+tiddlers[t].status+"\n";
		newText += "<<<\n";
		// get current report (if any)
		var title=config.macros.loadTiddlers.reportTitle;
		var currText="";
		var theReport = store.getTiddler(title);
		if (theReport) currText=((theReport.text!="")?'\n----\n':"")+theReport.text;
		// update the ImportedTiddlers content and show the tiddler
		store.saveTiddler(title, title, newText+currText, config.options.txtUserName, new Date(), theReport?theReport.tags:null, theReport?theReport.fields:null);
		if (!quiet) { story.displayTiddler(null,title,1,null,null,false); story.refreshTiddler(title,1,true); }
	}
}
//}}}
/***
|Name|LoadTiddlersPluginPatch|
|Source|http://www.TiddlyTools.com/#LoadTiddlersPluginPatch|
|Version|3.4.8|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|LoadTiddlersPlugin|
|Overrides||
|Description|backward-compatible function patches for use with LoadTiddlersPlugin and TW2.1.x or earlier|

!!!!!Usage
<<<
The current version LoadTiddlersPlugin is compatible with the TW2.2.x core functions.
This "patch" plugin provides additional functions needed to enable the current version of LoadTiddlersPlugin to operate correctly under TW2.1.x or earlier.

{{medium{You do not need to install this plugin if you are using TW2.2.0 or above}}}
(though it won't hurt anything if you do... it will just take up more space).
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''LoadTiddlersPlugin'' //(main plugin body)//
''LoadTiddlersPluginPatch2.1.x'' //(patches for TW2.1.x or earlier)//
(both tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.06.27 [3.4.8]'' compatibility functions split from LoadTiddlersPlugin
|please see [[LoadTiddlersPlugin]] for additional revision details|
''2005.07.20 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
// these functions are only defined when installed in TW2.1.x and earlier... 
if (version.major+version.minor/10 <= 2.1) {

// Version
version.extensions.LoadTiddlersPatch21x = {major: 3, minor: 4, revision: 8, date: new Date(2007,6,27)};

config.macros.loadTiddlers.loadFile = function(src,callback,params) {
	var quiet=params.quiet;
	if (src==undefined || !src.length) return null; // filename is required
	if (!quiet) clearMessage();
	if (!quiet) displayMessage(this.openMsg.format([src]));
	if (src.substr(0,5)!="http:" && src.substr(0,5)!="file:") { // if src is relative (i.e., not a URL)
		if (!this.fileExists(src)) { // if file cannot be found, might be relative path.. try fixup
			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);
			src=pathPrefix+src;
			if (pathPrefix.substr(0,5)!="http:") src=getLocalPath(src);
		}
	}
	if (src.substr(0,4)!="http" && src.substr(0,4)!="file") { // if not a URL, read from local filesystem
		var txt=loadFile(src);
		if ((txt==null)||(txt==false)) // file didn't load
			{ if (!quiet) displayMessage(this.openErrMsg.format([src,"(unknown)"])); }
		else {
			if (!quiet) displayMessage(this.readMsg.format([txt.length,src]));
			if (callback) callback(true,params,convertUTF8ToUnicode(txt),src,null);
		}
	}
	else {
		var x; // get an request object
		try {x = new XMLHttpRequest()} // moz
		catch(e) {
			try {x = new ActiveXObject("Msxml2.XMLHTTP")} // IE 6
			catch (e) {
				try {x = new ActiveXObject("Microsoft.XMLHTTP")} // IE 5
				catch (e) { return }
			}
		}
		// setup callback function to handle server response(s)
		x.onreadystatechange = function() {
			if (x.readyState == 4) {
				if (x.status==0 || x.status == 200) {
					if (!quiet) displayMessage(config.macros.loadTiddlers.readMsg.format([x.responseText.length,src]));
					if (callback) callback(true,params,x.responseText,src,x);
				}
				else {
					if (!quiet) displayMessage(config.macros.loadTiddlers.openErrMsg.format([src,x.status]));
				}
			}
		}
		// get privileges to read another document's DOM via http:// or file:// (moz-only)
		if (typeof(netscape)!="undefined") {
			try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
			catch (e) { if (!quiet) displayMessage(e.description?e.description:e.toString()); }
		}
		// send the HTTP request
		try {
			var url=src+(src.indexOf('?')<0?'?':'&')+'nocache='+Math.random();
			x.open("GET",src,true);
			if (x.overrideMimeType) x.overrideMimeType('text/html');
			x.send(null);
		}
		catch (e) {
			if (!quiet) {
				displayMessage(this.openErrMsg.format([src,"(unknown)"]));
				displayMessage(e.description?e.description:e.toString());
			}
		}
	}
}

config.macros.loadTiddlers.readTiddlersFromHTML=function(html) {
	// for TW2.1 and earlier
	// extract store area from html 
	var start=html.indexOf('<div id="storeArea">');
	var end=html.indexOf("<!--POST-BODY-START--"+">",start);
	if (end==-1) var end=html.indexOf("</body"+">",start); // backward-compatibility for older documents
	var sa="<html><body>"+html.substring(start,end)+"</body></html>";

	// load html into iframe document
	var f=document.getElementById("loaderFrame"); if (f) document.body.removeChild(f);
	f=document.createElement("iframe"); f.id="loaderFrame";
	f.style.width="0px"; f.style.height="0px"; f.style.border="0px";
	document.body.appendChild(f);
	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(sa); d.close();

	// read tiddler DIVs from storeArea DOM element	
	var sa = d.getElementById("storeArea");
	if (!sa) return null;
	sa.normalize();
	var nodes = sa.childNodes;
	if (!nodes || !nodes.length) return null;
	var tiddlers = [];
	for(var t = 0; t < nodes.length; t++) {
		var title = null;
		if(nodes[t].getAttribute)
			title = nodes[t].getAttribute("tiddler");
		if(!title && nodes[t].id && (nodes[t].id.substr(0,5) == "store"))
			title = nodes[t].id.substr(5);
		if(title && title != "")
			tiddlers.push((new Tiddler()).loadFromDiv(nodes[t],title));
	}
	return tiddlers;
}

// // COPIED FROM TW2.2beta5
// // enables reading tiddler definitions using TW2.2 storeArea format, even when plugin is running under TW2.1.x
// // storeArea format changes include:
// // <pre> nodes
// // attribute(tiddler) renamed to attribute(title)
// // attribute(modified) is omitted if created==modified
TW21Loader.prototype.internalizeTiddler = function(store,tiddler,title,node)
{
	var e = node.firstChild;
	var text = null;
	if(node.getAttribute("tiddler")) {
		text = getNodeText(e).unescapeLineBreaks();
	} else {
		while(e.nodeName!="PRE" && e.nodeName!="pre") {
			e = e.nextSibling;
		}
		text = e.innerHTML.replace(/\r/mg,"").htmlDecode();
	}
	var modifier = node.getAttribute("modifier");
	var c = node.getAttribute("created");
	var m = node.getAttribute("modified");
	var created = c ? Date.convertFromYYYYMMDDHHMM(c) : version.date;
	var modified = m ? Date.convertFromYYYYMMDDHHMM(m) : created;
	var tags = node.getAttribute("tags");
	var fields = {};
	var attrs = node.attributes;
	for(var i = attrs.length-1; i >= 0; i--) {
		var name = attrs[i].name;
		if (attrs[i].specified && !TiddlyWiki.isStandardField(name)) {
			fields[name] = attrs[i].value.unescapeLineBreaks();
		}
	}
	tiddler.assign(title,text,modifier,modified,tags,created,fields);
	return tiddler;
};

} // END OF TW2.1.x backward-compatibility functions
//}}}
VirtMus
[[Getting Started|VirtMusGettingStarted]]
ScreenShots
[[Download|VirtMusInstall]]
[[Change Log|ChangeLog]]
----
[[Menu Options|MenuOptions]]
[[VirtMus Options|VirtMusOptions]]
----
[[Play Lists|PlayLists]]
[[Song Lists|SongLists]]
[[Music Pages|MusicPages]]
----
[[Live Window|LiveWindowKeyboardShortcuts]]
[[Annotations|MusicPageAnnotations]]
----
[[Developer Info|DeveloperInfo]]
[[FAQ|FrequentlyAskedQuestions]]

[img[Sourceforge.net|http://sflogo.sourceforge.net/sflogo.php?group_id=186670&amp;type=1][http://sourceforge.net]]

[img[Support This Project|http://images.sourceforge.net/images/project-support.jpg][http://sourceforge.net/donate/index.php?group_id=186670]]

[img[Softpedia|img/softpedia_free_award_f.gif][http://www.softpedia.com/progClean/VirtMus-Clean-95379.html]]

<html>
<script type="text/javascript" src="http://www.ohloh.net/p/16985/widgets/project_cocomo.js"></script>
</html>
Some of the menu options (and toolbar buttons) are context sensitive and are only activated if an appropriate item is selected in the [[PlayList|PlayLists]] window. For example, the "Clone Music Page" menu option is only available when a page is selected and remains disabled otherwise, "Save Song" is available if a song, or page is selected, but is not available if a play list is selected.

* ''File'' menu
** ''Save All'': Saves all the songs or playlists that have been modified
* ''~PlayList'' menu
** ''New ~PlayList'': Creates a new playlist
** ''Open ~PlayList'': Opens an existing playlist
** ''Save ~PlayList'': Saves a playlist that has been modified (by adding/removing a song, or reordering the songs)
* ''Song'' menu
** ''New Song'': Creates a new song
** ''Open Song'': Adds an existing song to the currently selected playlist, or to the Default playlist if no playlist is currently selected
** ''Remove Song'': Removes a song from a playlist, but does not erase it from the disk.
** ''Save Song'': Saves the currently selected song
** ''Save Song As'': Creates a clone of the currently selected song
* ''~MusicPage'' menu
** ''Add Pages'': Adds one or more pages to the currently selected song
** ''Clone Music Page'': Creates a clone of the currently selected page and adds it right after the currently selected page. Use the Thumbs Window to re-order the pages by dragging and dropping them in the desired order.
** Remove Pages: Removes the currently selected pages from the song, but does not erase them from the disk.
** ''Edit Annotations'': Launches an external SVG editor to edit the [[MusicPage|MusicPages]] annotations. See MusicPageAnnotations for more details on this functionality.
* ''Tools'' menu
** ''Rename Item'': Changes the name of the Playlist, Song, or Music Page. Only changes the name shown in the ~PlayList Window tab. Does not rename the files on the disk.
** ''Options'': Brings up an options dialog box used to configure the application. See VirtMusOptions for more details.
* ''View'' menu
** ''Go Live'': displays the live window used for practice sessions or concerts.
* ''Window'' menu
** ''Open ~PlayList Window'': Opens the window/tab that shows the available playlists, songs, and song pages. Select a song to view thumbnails of its pages. Select a page to see it in the Annotations tab in full-size.
** ''Open Thumbs Window'': This window allows the user to see thumbnails of the pages making up the song and, most importantly, allows the user to re-order the pages by dragging them around.
** ''Open Annot Window'': This window allows the user to view the music page at full size. The window can be scrolled around by dragging the rectangle in the upper right corner thumbnail to the region of interest.
** ''Properties'': This windows shows the properties of the currently selected Song or Playlist. Some of them are read-only, and others can be modified by the user. This is a good place to see the full path to the file on disk, or to modify the tags attached to the songs or playlists.
The Annotations tab allows you to add various freehand annotations to a music page. It has the following features:

* A drawing tool chooser
* A color swatch that can be used to select the pen color
* A slider to select the pen size
* A slider to select the opacity (so you can add transparent annotations as shown in the screen shot below)
* A button that clears ''all'' the annotations on the page (use the SVG editor to remove/modify specific annotations)

For anything more that the most basic annotations, you will want to download and use the free [[Inkscape|http://www.inkscape.org]] SVG editor from http://www.inkscape.org which can be easily integrated with VirtMus.

After you've downloaded and installed [[Inkscape|http://www.inkscape.org]], open the Tools->Options dialog box and enter the location of the inkscape.exe program in the ''SVG Editor'' field. If you installed [[Inkscape|http://www.inkscape.org]] using the default settings, the path should be something like: {{{C:\Program Files\Inkscape\inkscape.exe}}}

To use [[Inkscape|http://www.inkscape.org]] to edit a page, first select the music page you wish to edit/annotate in the ''~PlayList Window'' tab (it's not enough to have the page shown in the annotations window, it needs to be selected in the ~PlayList window tab), then click on the last button shown on the toolbar in the screenshot below (or use the ''~MusicPage->Edit Annotations'' menu item). [[Inkscape|http://www.inkscape.org]] will launch and automatically load the selected music page and any annotations that have been entered so far. Edit things as desired. When done, save the changes and exit [[Inkscape|http://www.inkscape.org]]. VirtMus should now pick up the annotations you've done in Inkscape. Make sure you save the song since the annotations for each page are saved as part of the song.

Note that once you've launched the SVG editor, VirtMus will block until you exit the SVG editor.

[img[img/Annotations.png]]
Music pages can be ''JPGs'', ''PNGs'', ''GIFs'' or any other graphic file format that Java and JAI supports by default. It is also possible to read PDF files directly, or ConvertFromPdf to graphic file formats that are usable by VirtMus.

The resolution of the images should be approximately the same as the resolution of the display. If it is much higher, the application will consume too much memory trying to work with them. If it is much lower they will not look sharp when stretched to fill the whole display.

Color depth can also make a huge difference. For example, VirtMus will handle 8-bit grayscale jpegs much faster than a 32-bit png file and for sheet music which is primarily black and white the difference between the two formats is probably not noticeable. The [[annotations|MusicPageAnnotations]] can still be drawn in color even if the source music file is grayscale.

[[ImageMagic|http://www.imagemagick.org/]] is a useful tool to convert graphics files between every imaginable format. Download the latest binary release for your platform from http://www.imagemagick.org/script/binary-releases.php

To convert your music page images to 8-bit grayscale jpegs, you can use the {{{convert}}} program which is part of [[ImageMagic|http://www.imagemagick.org/]] with the following command line options:
{{{
cd \some\directory\containing\music\files
convert -colorspace Gray -depth 8 SomeMusicFile.??? SomeMusicFile-converted.jpg
}}}
/***
|Name|NewDocumentPlugin|
|Source|http://www.TiddlyTools.com/#NewDocumentPlugin|
|Version|1.7.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Quickly create new TiddlyWiki documents from your existing document, with just one click|

Use the {{{<<newDocument>>}}} macro to place a "new document" link into your sidebar/mainmenu/any tiddler (wherever you like).  Select this command to automatically create a "new.html" document containing a specific set of tagged tiddlers.  Optional parameters let you specify an alternate path/filename for the new file, or different tags to match.  You can also indicate "ask" for either parameter, which will  trigger a prompt for input when the command is selected.

!!!!!Usage
<<<
{{{<<newDocument label:text prompt:text filename tag tag tag...>>}}}
{{{<<newDocument label:text prompt:text filename all>>}}}
{{{<<newDocument label:text prompt:text filename snap ID>>}}}
{{{<<newDocument label:text prompt:text filename snap here>>}}}
{{{<<newDocument label:text prompt:text nofile print ID>>}}}
{{{<<newDocument label:text prompt:text nofile print here>>}}}
 where:
* ''label:text'' defines //optional// alternative link text (replaces default "new document" display)
* ''prompt:text'' defines //optional// alternative tooltip text for 'mouseover' prompting (replaces default hard-coded tooltip text)
* ''filename'' is any local path-and-filename.  If no parameters are provided, the default is to create the file "new.html" in the current directory.  If a filename is provided without a path (i.e., there is no "/" in the input), then the current directory is also assumed.  Otherwise, this parameter is expected to contain the complete path and filename needed to write the file to your local hard disk.  If ''ask'' is used in place of the filename parameter then, when the command link is selected, a message box will be automatically displayed so you can select/enter the path and filename.
* ''tag tag tag...'' is a list of one or more space-separated tags (use quotes or {{{[[]]}}} around tags that contain spaces).  The new document will include all tiddlers that match at least one of the tags in the list.  The default is to include tiddlers tagged with <<tag includeNew>>.    The special value ''all'' may be used to match every tiddler (even those without tags).   If ''ask'' is used in place of the tags then, when the command link is selected, a message box will be automatically displayed so you can enter the desired tags at that time.
* When you use the keyword ''snap'' in place of the tags, you can generate a file containing the //rendered//  CSS-and-HTML that is currently being displayed in browser.  By default, the snapshop uses the 'contentWrapper' DOM element ID to automatically include all the TiddlyWiki elements, such as the sidebars and header, in addition to the center 'story' column containing the tiddler content.
* When you use the keyword ''print'' in place of the tags, a snapshot is generated, but the contents are not written to a file.  Instead, they are displayed in a separate browser tab/window, and the print dialog for that tab/window is automatically invoked.
* You can limit the snapshot to capture only a portion of the rendered TiddlyWiki elements by specifiying an optional alternate DOM element ID, such as "displayArea" (the entire center 'story' column) or even just a single tiddler (e.g., "tidderMyTiddlerTitle", assuming that "MyTiddlerTitle" is currently displayed).  Only the portions of the document that are contained //within// the specified DOM element will be transcribed to the resulting snapshot file.  If ''ask'' is used in place of a DOM element ID, you will be prompted to enter the ID (default is "contentWrapper") when the snapshot is being taken.  This allows you to easily enter the ID of any currently displayed tiddler to make quick snapshots of specific tiddlers.  If ''here'' is used in place of a DOM element ID, the current tiddler id is used.

Note: as of version 1.4.0 of this plugin, support for selecting tiddlers by using tag *expressions* has been replaced with simpler, more efficient "containsAny()" logic.  To create new ~TiddlyWiki documents that contain only those tiddlers selected with advanced AND/OR/NOT Boolean expressions, you can use the filtering features provided by the ExportTiddlersPlugin (see www.TiddlyTools.com/#ExportTiddlersPlugin).
<<<
!!!!!Examples:
<<<
{{{<<newDocument>>}}}
equivalent to {{{<<newDocument new.htm includeNew systemTiddlers>>}}}
creates default "new.html" containing tiddlers tagged with either<<tag includeNew>>or<<tag systemTiddlers>>
try it: <<newDocument>>

{{{<<newDocument empty.html systemTiddlers>>}}}
creates "empty.html" containing only tiddlers tagged with<<tag systemTiddlers>>
//(reproduces old-style (pre 2.0.2) empty file)//
try it: <<newDocument empty.html systemTiddlers>>

{{{<<newDocument "label:create Import/Export starter" ask importexport>>}}}
save importexport tiddlers to a new file, prompts for path/file
try it: <<newDocument "label:create Import/Export starter" ask importexport>>

{{{<<newDocument ask ask>>}}}
prompts for path/file, prompts for tags to match
try it: <<newDocument ask ask>>

{{{<<newDocument ask all>>}}}
save all current TiddlyWiki contents to a new file, prompts for path/file
try it: <<newDocument ask all>>

{{{<<newDocument ask snap>>}}}
generates snapshot of currently displayed document, prompts for path/file
try it: <<newDocument ask snap>>

{{{<<newDocument ask snap here>>}}}
generates snapshot of this tiddler ONLY, prompts for path/file
try it: <<newDocument ask snap here>>

{{{<<newDocument ask print here>>}}}
prints a snapshot of this tiddler ONLY
try it: <<newDocument nofile print here>>

<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your document:
''NewDocumentPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.03.30 [1.7.0]'' added support for "print" param as alternative for "snap".  When "print" is used, the filename is ignored and ouput is directed to another browser tab/window, where the print dialog is then automatically triggered.
''2007.03.30 [1.6.1]'' added support for "here" keyword for current tiddler elementID and "prompt:text" param for specifying tooltip text
''2007.02.12 [1.6.0]'' in onClickNewDocument(), reset HTML source 'markup'
''2006.10.23 [1.5.1]'' in onClickNewDocument(), get saved parameter value for snapID instead of using default "contentWrapper" (oops!)
''2006.10.18 [1.5.0]'' new optional param for 'snap'... specify alternative DOM element ID (default is still "contentWrapper").  Based on a suggestion from Xavier Verges.
''2006.08.03 [1.4.3]'' in promptForFilename(), for IE (WinXP only), added handling for UserAccounts.CommonDialog
''2006.07.29 [1.4.2]'' in onClickNewDocument(), okmsg display is now linked to newly created file
''2006.07.24 [1.4.1]'' in promptForFilename(), check for nsIFilePicker.returnCancel to allow nsIFilePicker.returnOK **OR** nsIFilePicker.returnReplace to be processed.
''2006.05.23 [1.4.0]'' due to very poor performance, support for tag *expressions* has been removed, in favor of a simpler "containsAny()" scan for tags.
''2006.04.09 [1.3.6]'' in onClickNewDocument, added call to convertUnicodeToUTF8() to better handle international characters.
''2006.03.15 [1.3.5]'' added nsIFilePicker() handler for selecting filename in moz-based browsers.  IE and other non-moz browsers still use simple prompt() dialog
''2006.03.15 [1.3.0]'' added "label:text" param for custom link text.  added special "all" filter parameter for "save as..." handling (writes all tiddlers to output file)
''2006.03.09 [1.2.0]'' added special "snap" filter parameter to generate and write "snapshot" files containing static HTML+CSS for currently rendered document.
''2006.02.24 [1.1.2]'' Fix incompatiblity with TW 2.0.5 by removing custom definition of getLocalPath() (which is now part of TW core)
''2006.02.03 [1.1.1]'' concatentate 'extra' params so that tag expressions don't have to be quoted.   moved all text to 'formatted' string definitions for easier translation.
''2006.02.03 [1.1.0]'' added support for tag EXPRESSIONS.  plus improved documentation and code cleanup
''2006.02.03 [1.0.0]'' Created.
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.newDocument = {major: 1, minor: 7, revision: 0, date: new Date(2007,3,30)};

config.macros.newDocument = {
	newlabel: "new document",
	newprompt: "Create a new TiddlyWiki 'starter' document",
	newdefault: "new.html",
	allparam: "all",
	saveaslabel: "save as...",
	saveasprompt: "Save current TiddlyWiki to a different file",
	printparam: "print",
	snapparam: "snap",
	snaplabel: "create a snapshot",
	snapprompt: "Create a 'snapshot' of the current TiddlyWiki display",
	snapdefault: "snapshot.html",
	snapID: "contentWrapper",
	snapIDprompt: "Please enter a DOM element ID for the desired content",
	snapIDerrmsg: "Unrecognized document element ID: '%0'",
	askparam: "ask",
	hereparam: "here",
	labelparam: "label:",
	promptparam: "prompt:",
	fileprompt: "Please enter a filename",
	filter: "includeNew",
	filterprompt: "Match one or more tags:\n(space-separated, use [[...]] around tags containing spaces)",
	filtererrmsg: "Error in tag filter '%0'",
	snapmsg: "Document snapshot written to %1",
	okmsg: "%0 tiddlers written to %1",
	failmsg: "An error occurred while creating %0"
};

config.macros.newDocument.handler = function(place,macroName,params) {

	var path=getLocalPath(document.location.href);
	var slashpos=path.lastIndexOf("/"); if (slashpos==-1) slashpos=path.lastIndexOf("\\"); 
	if (slashpos!=-1) path = path.substr(0,slashpos+1); // remove filename from path, leave the trailing slash

	if (params[0] && params[0].substr(0,config.macros.newDocument.labelparam.length)==config.macros.newDocument.labelparam)
		var label=params.shift().substr(config.macros.newDocument.labelparam.length)
	if (params[0] && params[0].substr(0,config.macros.newDocument.promptparam.length)==config.macros.newDocument.promptparam)
		var prompt=params.shift().substr(config.macros.newDocument.promptparam.length)
	var filename=params.shift(); if (!filename) filename=config.macros.newDocument.newdefault;
	if (params[0]==config.macros.newDocument.snapparam || params[0]==config.macros.newDocument.printparam) {
		var printmode=(params[0]==config.macros.newDocument.printparam);
		params.shift();
		if (!label) var label=config.macros.newDocument.snaplabel;
		if (!prompt) var prompt=config.macros.newDocument.snapprompt;
		var defaultfile=config.macros.newDocument.snapdefault;
		var snapID=config.macros.newDocument.snapID;// default to "contentWrapper"
		if (params[0]) var snapID=params.shift(); // alternate DOM element for snapshot
	}
	if (params[0]==config.macros.newDocument.allparam) {
		if (!label) var label=config.macros.newDocument.saveaslabel;
		if (!prompt) var prompt=config.macros.newDocument.saveasprompt;
		var defaultfile=getLocalPath(document.location.href);
		var slashpos=defaultfile.lastIndexOf("/"); if (slashpos==-1) slashpos=defaultfile.lastIndexOf("\\");
		if (slashpos!=-1) defaultfile=defaultfile.substr(slashpos+1); // get filename only
	}
	if (!prompt) var prompt=config.macros.newDocument.newprompt;
	if (!label) var label=config.macros.newDocument.newlabel;
	if (!defaultfile) var defaultfile=config.macros.newDocument.newdefault;

	var btn=createTiddlyButton(place,label,prompt,onClickNewDocument);
	btn.path=path;
	btn.file=filename;
	btn.defaultfile=defaultfile;
	btn.snapID=snapID; // NULL unless snapshot is being taken
	btn.printmode=printmode;
	btn.filter=params.length?params:[config.macros.newDocument.filter]; 
}

// IE needs explicit global scoping for functions called by browser events
window.onClickNewDocument=function(e)
{
	if (!e) var e = window.event; var btn=resolveTarget(e);

	// assemble document content, write file, report result
	var okmsg=config.macros.newDocument.okmsg;
	var failmsg=config.macros.newDocument.failmsg;
	var count=0;
	var out="";
	if (btn.snapID) { // HTML+CSS snapshot
		var snapID=btn.snapID;
		if (btn.snapID==config.macros.newDocument.askparam)
			snapID=prompt(config.macros.newDocument.snapIDprompt,config.macros.newDocument.snapID);
		if (btn.snapID==config.macros.newDocument.hereparam)
			{ var here=story.findContainingTiddler(btn); if (here) snapID=here.id; }
		if (!document.getElementById(snapID)) { // if specified element does not exist
			if (snapID) // ID=null if prompt was cancelled by user
				displayMessage(config.macros.newDocument.snapIDerrmsg.format([snapID]));
			e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); return(false);
		}
		var styles=document.getElementsByTagName("style");
		out+="<html>\n<head>\n<style>\n";
		for(var i=0; i < styles.length; i++)
			out +="/* stylesheet from tiddler:"+styles[i].getAttribute("id")+" */\n"+styles[i].innerHTML+"\n\n";
		out+="</style>\n</head>\n<body>\n\n"+document.getElementById(snapID).innerHTML+"\n\n</body>\n</html>";
		okmsg=config.macros.newDocument.snapmsg;
	} else { // TW starter document
		// get the TiddlyWiki core code source
		var sourcefile=getLocalPath(document.location.href);
		var source=loadFile(sourcefile);
		if(source==null) { alert(config.messages.cantSaveError); return null; }
		// reset existing HTML source markup
		source=updateMarkupBlock(source,"PRE-HEAD");
		source=updateMarkupBlock(source,"POST-HEAD");
		source=updateMarkupBlock(source,"PRE-BODY");
		source=updateMarkupBlock(source,"POST-BODY");
		// find store area
		var posOpeningDiv=source.indexOf(startSaveArea);
		var posClosingDiv=source.lastIndexOf(endSaveArea);
		if((posOpeningDiv==-1)||(posClosingDiv==-1)) { alert(config.messages.invalidFileError.format([sourcefile])); return; }
		// get the matching tiddler divs
		var match=btn.filter;
		if (match[0]==config.macros.newDocument.askparam) { // ask user for tags
			var newfilt=prompt(config.macros.newDocument.filterprompt,config.macros.newDocument.filter);
			if (!newfilt) return;  // cancelled by user
			match=newfilt.readMacroParams();
		}
		var storeAreaDivs=[];
		var tiddlers=store.getTiddlers('title');
		for (var i=0; i<tiddlers.length; i++)
			if (match[0]==config.macros.newDocument.allparam || (tiddlers[i].tags && tiddlers[i].tags.containsAny(match)) )
				storeAreaDivs.push(tiddlers[i].saveToDiv());
		out+=source.substr(0,posOpeningDiv+startSaveArea.length);
		out+=convertUnicodeToUTF8(storeAreaDivs.join("\n"))+"\n\t\t";
		out+=source.substr(posClosingDiv);
		count=storeAreaDivs.length;
	}
	if (btn.printmode) {
		var win=window.open("","_blank","");
		win.document.open();
		win.document.writeln(out);
		win.document.close();
		win.focus(); // bring to front
		win.print(); // trigger print dialog
	} else {
		// get output path/filename
		var filename=btn.file;
		if (filename==config.macros.newDocument.askparam)
			filename=promptForFilename(config.macros.newDocument.fileprompt,btn.path,btn.defaultfile);
		if (!filename) return; // cancelled by user
		// if specified file does not include a path, assemble fully qualified path and filename
		var slashpos=filename.lastIndexOf("/"); if (slashpos==-1) slashpos=filename.lastIndexOf("\\");
		if (slashpos==-1) filename=btn.path+filename;
		var ok=saveFile(filename,out);
		var msg=ok?okmsg.format([count,filename]):failmsg.format([filename]);
		var link=ok?"file:///"+filename.replace(regexpBackSlash,'/'):""; // change local path to link text
		clearMessage(); displayMessage(msg,link);
	}
	e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); return(false);
}
//}}}

//{{{
function promptForFilename(msg,path,file)
{
	if(window.Components) { // moz
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
			var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
			var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
			picker.init(window, msg, nsIFilePicker.modeSave);
			var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
			thispath.initWithPath(path);
			picker.displayDirectory=thispath;
			picker.defaultExtension='html';
			picker.defaultString=file;
			picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
			if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
		}
		catch(e) { alert('error during local file access: '+e.toString()) }
	}
	else { // IE
		try { // XP only
			var s = new ActiveXObject('UserAccounts.CommonDialog');
			s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
			s.FilterIndex=3; // default to HTML files;
			s.InitialDir=path;
			s.FileName=file;
			if (s.showOpen()) var result=s.FileName;
		}
		catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
	}
	return result;
}
//}}}
Playlists can be used group songs into various arbitrary categories, or to define the song order for a concert. A song can belong to any number of playlists so you could organize your songs as follows:

* Christmas songs
** Silent Night
** Joy to the World
** Handel's Messiah - Overture
** Handel's Messiah - For Unto Us A Child Is Born
** Handel's Messiah - Hallelujah!
* Classical music
** Mendelssohn's Elijah - Air - If with all your hearts
** Mendelssohn's Elijah - Trio - Lift thine eyes
** Handel's Messiah - Overture
** Handel's Messiah - For Unto Us A Child Is Born
** Handel's Messiah - Hallelujah!
* 2006 Christmas concert
** Joy to the World
** Handel's Messiah - Hallelujah!
** Silent Night

See MenuOptions for more information on manipulating PlayLists.

See ReOrdering for more information on how songs can be re-ordered within a playlist, and how songs can be moved and copied between PlayLists.

PlayLists have the extension {{{.playlist.xml}}} on disk and they store the full path to the song files making up the playlist.
/***
|''Name:''|Publish Macro|
|''Version:''|0.4 (25 May 2007)|
|''Source''|http://jackparke.googlepages.com/jtw.html#PublishMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23PublishMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
Publish tiddlers tagged with these tags <<option txtPublishTags>> (comma seperated) as HTML pages to the subfolder 'publish' (you must create this). Use the [[PublishTemplateHead]] and [[PublishTemplateBody]] templates to style your pages and the [[PublishIndexTemplate]] to define an index page.
!Usage
{{{<<doPublish>>}}} <<doPublish>>
!Revision History
* Original by [[Jack]] 24 May 2006
* Updated 2 Jan 2007
* Refactored 4 Jan 2007
* Small improvements

!Code
***/
//{{{
version.extensions.doPublish = {major: 0, minor: 3,
revision: 0, date: new Date("Jan4, 2007")};
config.macros.doPublish = {label: "publish", prompt: "Publish Tiddlers as HTML files"};
if (config.options.txtPublishTags==undefined) config.options.txtPublishTags="Publish";
config.shadowTiddlers.PublishTemplateHead = '<title>%0 - %1</title>\n<link rel="stylesheet" type="text/css" href="style.css"/>\n<meta name="keywords" content="%3"/>'
config.shadowTiddlers.PublishTemplateBody = '<div class=\'viewer\' id=\'contentWrapper\'><small><a href=\"./publish/index.html\">Home</a> > %1</small><h1>%0</h1>\n<h2>%1</h2>\n%2\n<hr>Tags: %3\n<hr>%4, %5&nbsp;(created %6)\n</div>\n'
config.shadowTiddlers.PublishIndexTemplate = '<div class=\'viewer\' id=\'contentWrapper\'><small><a href="./publish/index.html">Home</a> > %1</small><h1>%0</h1><h2>%1</h2>\n<ul>%2\n</ul>\n<small>Published: %6</small>\n</div>\n';
config.macros.doPublish.handler = function(place)
{
 if(!readOnly)
 createTiddlyButton(place,this.label,this.prompt,function () {doPublish(); return false;},null,null,this.accessKey);
}
function doPublish() {
 var savedTiddlers = [];
 var tiddlers = store.getTiddlers("title");
 var place = document.getElementById(story.container)
 var HTMLTemplateHead = store.getTiddlerText("PublishTemplateHead");
 // We cannot render this template because <title> and other tags fail

 var HTMLTemplateBody = store.getTiddlerText("PublishTemplateBody");
 HTMLTemplateBody = renderTemplate(HTMLTemplateBody)

 HTMLTemplateBody = wiki2Web(HTMLTemplateBody);

 var PublishTags = config.options.txtPublishTags || "publish"; PublishTags = PublishTags.split(",")
 var PublishFolder = getWikiPath('publish'); if (!PublishFolder) return;
 var indexFile = "";
 
 var indexFileTemplate = store.getTiddlerText("PublishIndexTemplate");
 // This does not allow <<myMacro>> but wants <div macro="myMacro">
 indexFileTemplate = renderTemplate(indexFileTemplate)
 // This option allows WIKI-syntax but is limited in it's HTML capabilities
 //indexFileTemplate = wikifyStatic(indexFileTemplate)

 for (var t = 0; t < tiddlers.length; t++) {
 var tiddler = tiddlers[t];
 if (tiddler.tags.containsAny(PublishTags)) {
 var tiddlerHTML = wikifyStatic(store.getValue(tiddler, 'text'));
 var HTML = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + HTMLTemplateBody + '\n</body>\n</html>';
 HTML = HTML.format([
 wikifyPlain("SiteTitle").htmlEncode(),
 tiddler.title.htmlEncode(),
 wiki2Web(tiddlerHTML),
 tiddler.tags.join(", "),
 tiddler.modifier,
 tiddler.modified.toLocaleString(),
 tiddler.created.toLocaleString()
 ]);
 //saveFile(PublishFolder + tiddler.created.formatString("YYYY0MM0DD") + ".html", HTML);
 saveFile(PublishFolder + tiddler.title.filenameEncode() + ".html", HTML);
 indexFile += "<li><a href=\"" + tiddler.title.filenameEncode() + ".html" + "\" class=\"tiddlyLink tiddlyLinkExisting\">" + tiddler.title + "</a></li>\n";
 story.closeTiddler(tiddler.title);
 }
 }
 indexFileTemplate = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + indexFileTemplate + '\n</body>\n</html>';
 indexFileTemplate = indexFileTemplate.format([wikifyPlain("SiteTitle").htmlEncode(), wikifyPlain("SiteSubtitle").htmlEncode(), "%2", "", "", "", (new Date()).toLocaleString()])

 indexFile = indexFileTemplate.replace("%2", indexFile)
 indexFile = wiki2Web(indexFile);
 saveFile(PublishFolder + "index.html", indexFile)
 saveFile(PublishFolder + "style.css", store.getTiddlerText("StyleSheet") + store.getTiddlerText("StyleSheetLayout") + store.getTiddlerText("StyleSheetColors"))
 var indexWin = window.open("file://" + PublishFolder.replace(/\\/g, "/") + "index.html", null); indexWin.focus();
}

function renderTemplate(html) {
 var result = document.createElement("div");
 result.innerHTML = html;
 applyHtmlMacros(result,null);
 var temp = result.innerHTML;
 //result.parentNode.removeChild(result);
 return temp;
}

// Convert wikified text to html
function wiki2Web(wikiHTML) {
 var regexpLinks = new RegExp("<a .*?tiddlylink=.*?</a>","img");
 var result = wikiHTML.match(regexpLinks);
 if (result) {
 for(i = 0; i < result.length; i++) {
 var className = result[i].match(/ class="(.*?)"/i)?result[i].match(/ class="(.*?)"/i)[1]:"";
 var tiddlerName = result[i].match(/ tiddlylink="(.*?)"/i)[1];
 var url = tiddlerName.htmlDecode().filenameEncode() + ".html";
 //var url = tiddler.created.formatString("YYYY0MM0DD") + ".html";
 if (!className.match(/tiddlyLinkNonExisting/i))
 wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" href=\"" + url + "\">" + tiddlerName + "</a>");
 else
 wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" title=\"Page does not exist\" href=\"#\">" + tiddlerName + "</a>");
 }
 wikiHTML = wikiHTML.replace(/ href="http:\/\//gi, " target=\"_blank\" href=\"http://");
 }
 return wikiHTML
}
function getWikiPath(folderName) {
 var originalPath = document.location.toString();
 if(originalPath.substr(0,5) != 'file:') {
 alert(config.messages.notFileUrlError);
 if(store.tiddlerExists(config.messages.saveInstructions))
 story.displayTiddler(null,config.messages.saveInstructions);
 return;
 }
 var localPath = getLocalPath(originalPath);
 var backSlash = localPath.lastIndexOf('\\') == -1 ? '/' : '\\';
 var dirPathPos = localPath.lastIndexOf('\\')!=-1?localPath.lastIndexOf('\\'):localPath.lastIndexOf('/');
 var subPath = localPath.substr(0,dirPathPos) + backSlash + (folderName ? folderName + backSlash : '');
 return subPath;
}

// Replace without regex
String.prototype.myReplace = function(sea, rep) {
 var t1 = this.indexOf(sea);
 var t2 = parseInt(this.indexOf(sea)) + parseInt(sea.length);
 var t3 = this.length;
 return this.substring(0, t1) + rep + this.substring(t2, t3)
}
// Convert illegal characters to underscores
String.prototype.filenameEncode = function()
{
 return(this.toLowerCase().replace(/[^a-z0-9_-]/g ,"_"));
}
//}}}
<title>%0 - %1</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<meta name="keywords" content="%3"/>

<!-- Google Analytics Start -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-1254631-1";
urchinTracker();
</script>
<!-- Google Analytics End -->

* To copy a song from one ~PlayList to another, hold down the Control key as you drag the song from one ~PlayList to another.
* To move a song from one ~PlayList to another, just drag the song to the new ~PlayList.
* To reorder songs within a ~PlayList use one of these three methods:
** Drag the song to the new location in the ~PlayList
** Right-click on the ~PlayList and select "Change Order..." from the context menu
** Right-click on the song and select "Move Up" or "Move Down" from the context menu
This information is retained for historical purposes only. Development is now done in Git and this information no longer applies.

The SVN repository was structured in a standard way with ''trunk'', ''branches'' and ''tags''.

The ''users'' repository area is of interest only to developers that prefer to maintain a private svn repository for VirtMus and sync with the official repository at specific intervals. For example, once ready to release ''revB'' of the private changes, ''user2'' would make a copy of his or her local repository to the ''/users/user2/revB'' directory. From there a merge of the ''revA'' to ''revB'' delta can be made into the trunk.

* trunk: The current revision
* tags: Tags for released versions
* branches: Feature development branches
* users
** user1
*** current
*** rev1
*** rev2
** user2
*** current
*** revA
*** revB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<!-- Google Analytics Start -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-1254631-1";
urchinTracker();
</script>
<!-- Google Analytics End -->

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SITE_TITLE: TIDDLER_TITLE</title>
<meta name="description" content="SITE_SUBTITLE">
<meta name="keywords" content="TIDDLER_KEYWORDS">
<script language="JavaScript" type="text/javascript">
location.href = 'TIDDLER_URL';
</script>
<base href="TIDDLER_URL">
</head>

<body>
<noscript>
<a href="TIDDLER_URL">TIDDLER_TITLE</a>
</noscript>
TIDDLER_CONTENT
</body>
</html>
/***
|''Name:''|SEOTiddlyWikiPlugin|
|''Version:''|last update: 2007-02-14|
|''Source''|http://www.superphysique.net#%5B%5BSEO%20TiddlyWiki%20Plugin%5D%5D ([[del.icio.us|http://del.icio.us/post?url=http://www.superphysique.net#%5B%5BSEO%20TiddlyWiki%20Plugin%5D%5D]])|
|''Author:''|Fabrice Proudhon|
|''Type:''|Plugin|

!Purpose

I wrote this Search Engine Optimization plugin to improve ~TiddlyWiki website's ranking on Google, Yahoo, etc. Basically, it does two things:
1) For each tiddler and each tag of this one, it creates a html file with the tiddler's content and named according to the tiddler's title. The html file is written in a way that it can be easily crawled by a search engine (short and with html format, not ~TiddlyWiki's format), but if it is opened (which will be the case if it appears in the results of a search engine), it redirects to the ~TiddlyWiki with the corresponding tiddler opened.
2) It creates the sitemap.xml and urllist.txt files for Google and Yahoo which included generated html files.

!How to install

1) Create two tiddlers like these one (same name and content):
[[SEOTiddlyWikiPlugin]] [[SEOTiddlyWikiConfig]]
NB: double-clic on each tiddler to get edit mode and copy-paste their content.
2) Fill in shadow tiddlers SiteUrl, SiteTitle and SiteSubtitle.
3) Edit this tiddler and see the code behind the following link to understand how to launch the process, once the plugin installed, add to a tiddler:

{{{<html><a href="javascript:generateSEOFiles();">Generate SEO files</a></html>}}}

which will generate a link as such: <html><a href="javascript:generateSEOFiles();">Generate SEO files</a></html>.
4) See http://www.google.com/webmasters/sitemaps/ to register your  sitemap.xml file.

Tips
1) Feel free to modify html template [[SEOTiddlyWikiConfig]].
2) Use tag //excludeSearch// to disallow the export of a tiddler.

Limitation
If you remove a tiddler after an export, you have to manually remove the corresponding html file.

!Report a bug

<<email fabrice.proudhon at yahoo dot com>>

!Copyright

<html><!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by/2.5/"><img alt="Creative Commons License" style="border-width: 0" src="http://i.creativecommons.org/l/by/2.5/88x31.png"/></a><br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5  License</a>.<!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
	<Work rdf:about="">
		<license rdf:resource="http://creativecommons.org/licenses/by/2.5/" />
	</Work>
	<License rdf:about="http://creativecommons.org/licenses/by/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/></License></rdf:RDF> --></html>

!Code
***/

//{{{
function generateSEOFiles()
{
	// last update: 2007-02-14 by Fabrice Proudhon
	// http://www.superphysique.net#%5B%5BSEO%20TiddlyWiki%20Plugin%5D%5D
	var originalPath = document.location.toString();
	if(originalPath.substr(0,5) != "file:") 
	{
		alert(config.messages.notFileUrlError);
		if(store.tiddlerExists(config.messages.saveInstructions))
			story.displayTiddler(null,config.messages.saveInstructions);
		return;
	}
	var y = [];
	var g = [];
	var localPath = getLocalPath(originalPath);
	var c = store.getTiddlerText("SEOTiddlyWikiConfig");
	var su = store.getTiddlerText("SiteUrl");
	var st = wikifyPlain("SiteTitle");
	var sbt = wikifyPlain("SiteSubtitle");
	var htmlPath = localPath.substr(0,localPath.lastIndexOf("\\"));
	var tiddlers = store.getTiddlers("modified","excludeSearch");
	g.push('<url><loc>' + su.htmlEncode() + '</loc></url>');
	y.push(su.htmlEncode());
	for (var t=0; t<tiddlers.length; t++) {
		var content = c;
		var filename = tiddlers[t].title.htmlEncode();
		filename = filename.toLowerCase();
		filename = filename.replace(/ |\/|@/gi, '-');
		filename = filename.replace(/(-)\1+/gi, '$1');
        	content = content.replace(/SITE_TITLE/gi, st.htmlEncode());
        	content = content.replace(/SITE_SUBTITLE/gi, sbt.htmlEncode());
        	content = content.replace(/TIDDLER_TITLE/gi, tiddlers[t].title.htmlEncode());
		content = content.replace(/TIDDLER_URL/gi, su.htmlEncode() + '#' + String.encodeTiddlyLink(tiddlers[t].title));
        	content = content.replace(/TIDDLER_KEYWORDS/gi, tiddlers[t].tags.join(',').htmlEncode());
        	content = content.replace(/TIDDLER_CONTENT/gi, wikifyStatic(tiddlers[t].text,null,tiddlers[t]).htmlEncode());
        	content = content.replace(/&lt;/gi, '<');
        	content = content.replace(/&gt;/gi, '>');
        	content = content.replace(/&quot;/gi, '"');
		var d = tiddlers[t].modified.getFullYear() + '-';
		if (tiddlers[t].modified.getMonth() + 1 < 10) d = d + '0';
		d = d + (tiddlers[t].modified.getMonth() + 1) + '-';
		if (tiddlers[t].modified.getDate() < 10) d = d + '0';
		d = d + tiddlers[t].modified.getDate();
		for (var ta=0; ta<tiddlers[t].tags.length; ta++) {
			var tag = tiddlers[t].tags[ta].toLowerCase();
			g.push('<url><loc>' + su.htmlEncode() + escape(tag) + '/' + escape(filename) + '.htm' + '</loc><lastmod>' + d + '</lastmod></url>');
			y.push(su.htmlEncode() + escape(tag) + '/' + escape(filename) + '.htm');
			saveFile(htmlPath + '\\' + tag + '\\' + filename + '.htm', convertUnicodeToUTF8(content));
		}
	}
	saveFile(htmlPath + '\\urllist.txt', convertUnicodeToUTF8(y.join('\n')));
	saveFile(htmlPath + '\\sitemap.xml', '<?xml version="1.0" encoding="utf-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84">\n' + convertUnicodeToUTF8(g.join('\n')) + '</urlset>');
	displayMessage('SEO files created', '');
}
//}}}
/***
|Name|SaveFromWebPlugin|
|Source|http://www.TiddlyTools.com/#SaveFromWebPlugin|
|Version|1.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|extend 'save changes' to get remote document contents and save to local filesystem |
|Status| ALPHA EXPERIMENTAL - USE AT YOUR OWN RISK |

Normally, when you are viewing a TiddlyWiki document over the web (i.e., not via {{{file://}}}) and you select the "save changes" (or "save to disk") command, an error message is displayed: //__"You need to save this TiddlyWiki to a file before you can save changes."__//  This plugin extends the use of {{{<<saveChanges>>}}} so that when you are viewing and/or editing a remote TiddlyWiki document, instead of receiving this somewhat confusing and unhelpful message, you can still click the "save changes" (or "save to disk") command to ''store a copy of the remote document directly onto your local filesystem'', //including any unsaved tiddler changes/additions you have made while working on-line.//
!!!!!Usage
<<<
The plugin retrieves the TiddlyWiki source file directly from the remote server (using XMLHttpRequest) and then merges it with the tiddler content in the currently loaded document.  You are then prompted for a destination path/file, and a new TiddlyWiki document file is written to the indicated location on your local file system.

''__Security in FireFox (and other browsers)__''
''FireFox needs security permissions to be set to allow a remote URL to save a new file to your local filesystem.''  Certain JavaScript features, such as reading/writing to the local filesystem, require expanded "cross-domain" privileges, normally restricted for use with ''signed'' scripts, which you can set FireFox to allow or disallow, based on the digital signature of the originator (or ''principal'') of each signed script.

However, ''unsigned'' scripts, such as TiddlyWiki, do not contain a digital signature and are not normally allowed access to filesystem functions.  Fortunately, an //''unsigned''// script can still be granted expanded filesystem privileges through use of a ''codebase principal'', which relies upon the originating URL of the script (it's "codebase") to identify the "trusted source", rather than verifying a digital signature of a certificate.
>''In FireFox (and most other browsers) use of codebase principals is disabled by default'';
>To use codebase principals, go to "about:config" in your browser, and set:
>{{{signed.applets.codebase_principal_support}}} to {{{true}}}
>//note: you can also set this value by editing FireFox's {{{prefs.js}}} and adding://
>{{{user_pref("signed.applets.codebase_principal_support", true);}}}
After you have enabled codebase principals, you will begin receiving security notices whenever TiddlyWiki requests permission to invoke various privileged functions.  You can press the "allow" button to permit the processing to continue, or press "deny" to prevent the privileged functions from being used by that remote site.

When you invoke {{{<<saveChanges>>}}}, there may be several of these notices in a row (perhaps as many as 10 or so) before the file saving process is done.  These messages are normal, and you should ALLOW each of them, so that the file saving procedure can continue to completion.  Once you are confident that the remote site is trustworthy, you can mark the "remember this decision" checkbox to eliminate additional notices for that remote site, so that the process can proceed without further interruptions.  This setting will only be applied to the specific web domain in question, so you will still receive security notices when using privileged functions from any other web sites.

//Note: If codebase principals are enabled, security notices are also reported when accessing TiddlyWiki documents locally (i.e., via {{{file://}}}).  This is a result of TiddlyWiki's normal file I/O processing and should always be considered safe to allow, inasmuch as you control the contents of your own local filesystem, and thus, should be able to consider the {{{file://}}} codebase location as a trusted source.//
<<<
!!!!!Configuration
<<<
| Default filename: &nbsp;|<<option txtSaveFromWebDefaultFilename>> |
| Default download directory: &nbsp;|<<option txtSaveFromWebDefaultPath>>|
|borderless|k
{{fine{(//default directory is for Internet Explorer only... FireFox always uses most recently accessed directory location//)}}}
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
SaveFromWebPlugin
<<<
!!!!!Revision History
<<<
''2007.06.27 [1.0.1]'' in saveFromWeb(), pass content from server through convertUnicodeToUTF8() before writing to file.
''2007.06.26 [1.0.0]'' initial release
<<<
!!!!!Credits
<<<
This feature was developed by Eric L Shulman / ELS Design Studios
<<<
!!!!!Code
***/
//{{{
version.extensions.SaveFromWeb= {major: 1, minor: 0, revision: 1, date: new Date(2007,6,27)};
//}}}

//{{{
if (config.options.txtSaveFromWebDefaultFilename==undefined)
	config.options.txtSaveFromWebDefaultFilename="default.html";
if (config.options.txtSaveFromWebDefaultPath==undefined)
	config.options.txtSaveFromWebDefaultPath="C:\\";
//}}}

//{{{
window.saveFromWeb_saveChanges = window.saveChanges;
window.saveChanges = function(onlyIfDirty,tiddlers)
{
	if(onlyIfDirty && !store.isDirty()) return;
	var originalPath = document.location.toString();

	// if on file:, just use standard core save handling
	if(originalPath.substr(0,5) == "file:") { window.saveFromWeb_saveChanges.apply(this,arguments); return; }

	// if not on file:, use extended XMLHTTPRequest to construct file and save locally...

	// get destination path+filename
	var localPath=promptForFilename(
		"Save downloaded file as:",
		config.options.txtSaveFromWebDefaultPath,
		config.options.txtSaveFromWebDefaultFilename,
		"html");
	if (!localPath || !localPath.length) return;

	displayMessage("Downloading document from server...");
	var xhr=loadRemoteFile(originalPath,window.saveFromWeb,localPath);
	if (!xhr) { // couldn't load remote, report core error message
		displayMessage("download unsuccessful.");
		alert(config.messages.notFileUrlError);
		if(store.tiddlerExists(config.messages.saveInstructions))
			story.displayTiddler(null,config.messages.saveInstructions);
	}
	return;
}
//}}}

//{{{
window.saveFromWeb = function(success,localPath,txt,url,xhr)
{
	if(!success) {
		displayMessage("download unsuccessful.");
		alert(config.messages.cantSaveError);
		if(store.tiddlerExists(config.messages.saveInstructions))
			story.displayTiddler(null,config.messages.saveInstructions);
		return;
	}
	displayMessage("Saving to local filesystem...");
	// Locate the storeArea div's and save the local file(s)
	var original = convertUnicodeToUTF8(txt);
	var posDiv = locateStoreArea(original);
	if(!posDiv) {
		alert(config.messages.invalidFileError.format([localPath]));
		return;
	}
	saveBackup(localPath,original);
	saveRss(localPath);
	saveEmpty(localPath,original,posDiv);
	saveMain(localPath,original,posDiv);
}
//}}}

//{{{
window.promptForFilename=function(msg,path,file,defext)
{
	if(window.Components) { // moz
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
			var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
			var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
			picker.init(window, msg, nsIFilePicker.modeSave);
			picker.displayDirectory=null;
			picker.defaultExtension=defext;
			picker.defaultString=file;
			picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
			if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
		}
		catch(e) { var result=prompt(msg,path+file); } // fallback to simple prompt dialog
	}
	else { // IE
		try { // XP only
			var s = new ActiveXObject('UserAccounts.CommonDialog');
			s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
			s.FilterIndex=1; // default to ALL files;
			s.InitialDir=path;
			s.FileName=file;
			if (s.showOpen()) var result=s.FileName;
		}
		catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
	}
	return result;
}
//}}}
This is how the application looks when in normal use. You can see the PlayLists and SongLists on the left, and the thumbnails of the MusicPages for the currently loaded song on the right. In the middle is an example of a music page with some annotations.

The various window components can be re-arranged by dragging them around by their title tab.

[img[img/Annotations.png]]

These are the various VirtMusOptions available:
[img[img/Options.png]]

Toolbars can be fully customized:
[img[img/Toolbars.png]]
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY">><<importTiddlers link>><<exportTiddlers>><<saveChanges>><<upload>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
the modern music stand
[img[img/VirtMusLogo.gif]] VirtMus
http://virtmus.com/
A song is nothing more than a list of MusicPages. The pages can appear in any order, and can appear multiple times. If there's a repeat on page 4 going back to page 2, it is recommended to add pages "2, 3, 4" twice in a row so you can page-down every time you get to the end of a page and not worry about going back to find the repeat on page 2 while performing. You would then end up with the following page sequence: 1, 2, 3, 4, 2, 3, 4, 5, 6.

See ReOrdering for more information on how songs can be re-ordered within a playlist, and how songs can be moved and copied between PlayLists.

Song files have the extension {{{.song.xml}}} on disk and they store the full path to the MusicPages making up the song.

PDF files can be converted directly to song files by following the instructions to ConvertFromPdf. Starting with version 2.50, PDF files can be read directly by opening them just like a regular graphic file. A dialog box will prompt for the range of pages to use out of the PDF.
/***
|Name|TemporaryTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#TemporaryTiddlersPlugin|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|SaverBase.prototype.externalize()|
|Description|blocks tiddlers tagged with "temporary" from being saved into the TW file|

!!!!!Usage
<<<
When the TW document is saved (either to local disk or remote URL), any tiddlers tagged with "temporary" will be skipped over, so that they are not written to the file.  To keep a temporary tiddler, simply edit it and remove the tag before saving the file.  This feature can be combined with various plugins that can automatically create new tiddlers, such as [[SearchOptionsPlugin]] ([[SearchResults]]) and [[ImportTiddlersPlugin]] ([[ImportedTiddlers]]) so that these transient results are not retained when you save you document.

You can also use this tag with the {{{<<loadTiddlers>>}}} macro and the //auto-tagging// features provided by [[ImportTiddlersPlugin]], so that each time you open your document, you can automatically retrieve an up-to-date set of common tiddlers that are stored in another document (either local or via remote URL), without those tiddlers being retained when you save your document.
<<<
!!!!!Configuration
<<<
When saving the document:
<<option chkTemporaryQuiet>> Suppress reporting of temporary tiddlers that have not been saved
<<option chkTemporaryKeep>> Keep temporary tiddlers (i.e., ignore the 'temporary' tag)
Enter a tag value to use when marking tiddlers as temporary: <<option txtTemporaryTag>>
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
TemporaryTiddlersPlugin
<<<
!!!!!Revision History
<<<
''2007.01.01 [1.0.0]'' initial release
<<<
!!!!!Credits
<<<
This feature was developed by Eric Shulman.
<<<
!!!!!Code
***/
//{{{
version.extensions.TemporaryTiddlersPlugin= {major: 1, minor: 0, revision: 0, date: new Date(2007,2,8)};

// configuration defaults
if (config.options.chkTemporaryKeep ==undefined) config.options.chkTemporaryKeep =false;
if (config.options.chkTemporaryQuiet==undefined) config.options.chkTemporaryQuiet=false;
if (config.options.txtTemporaryTag==undefined) config.options.txtTemporaryTag="temporary";
// add 'keep' option  to default (shadow) AdvancedOptions
config.shadowTiddlers.AdvancedOptions += "\n<<option chkTemporaryKeep>> Keep temporary tiddlers (ignore<<tag "+config.options.txtTemporaryTag+">>tag)";
// lingo
config.messages.TemporaryWarning = "The temporary tiddler: '%0' will not be saved";
// core override
SaverBase.prototype.externalize = function(store) 
{
	// notify user that some tiddlers won't be saved
	if (!config.options.chkTemporaryKeep && !config.options.chkTemporaryQuiet) {
		var tids=store.getTaggedTiddlers(config.options.txtTemporaryTag);
		for (i=0;i<tids.length;i++) displayMessage(config.messages.TemporaryWarning.format([tids[i].title]));
	}
	var results = [];
	var tag=config.options.chkTemporaryKeep?null:config.options.txtTemporaryTag;
	var tiddlers = store.getTiddlers("title",tag); // ELS: exclude tagged tiddlers
	for (var t = 0; t < tiddlers.length; t++)
		results.push(this.externalizeTiddler(store, tiddlers[t]));
	return results.join("\n");
}
//}}}
[[TiddlyWiki|http://tiddlywiki.com]] is a wiki application written in ~JavaScript, fully contained in a single html file, and executed on the reader's browser.

This TiddlyWiki contains a few plug-ins to allow content to be published to flat HTML files (for improved search engine indexing). See the DocMaintenance contents for the macros added.
! Features

* When a new song or page is added, the item tree in the playlist window does not automatically expand to show it.
/***
<<tiddler UploadPluginDoc>>
!Code
***/
//{{{
version.extensions.UploadPlugin = {
 major: 3, minor: 3, revision: 1, 
 date: new Date(2006,3,30),
 type: 'macro',
 source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
 docs: 'http://tiddlywiki.bidix.info/#UploadPluginDoc'
};
//}}}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// only this two configs need to be translated
config.macros.upload.messages = {
 aboutToUpload: "About to upload TiddlyWiki to %0",
 errorDownloading: "Error downloading",
 errorUploadingContent: "Error uploading content",
 fileNotFound: "file to upload not found",
 fileNotUploaded: "File %0 NOT uploaded",
 mainFileUploaded: "Main TiddlyWiki file uploaded to %0",
 urlParamMissing: "url param missing",
 rssFileNotUploaded: "RssFile %0 NOT uploaded",
 rssFileUploaded: "Rss File uploaded to %0"
};

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

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

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

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

config.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, 
 username, password) {
 var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it
 var endSaveArea = '</d' + 'iv>';
 // Locate the storeArea div's
 var posOpeningDiv = original.indexOf(startSaveArea);
 var posClosingDiv = original.lastIndexOf(endSaveArea);
 if((posOpeningDiv == -1) || (posClosingDiv == -1))
 {
 alert(config.messages.invalidFileError.format([document.location.toString()]));
 return;
 }
 var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + 
 allTiddlersAsHtml() + "\n\t\t" +
 original.substr(posClosingDiv);
 var newSiteTitle;
 if(version.major < 2){
 newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();
 } else {
 newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();
 }
 revised = revised.replace(new RegExp("<title>[^<]*</title>", "im"),"<title>"+ newSiteTitle +"</title>");
 var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, 
 username, password, function (responseText) {
 if (responseText.substring(0,1) != '0') {
 alert(responseText);
 displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));
 }
 else {
 if (uploadDir !== '') {
 toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);
 } else {
 toFilename = config.macros.upload.basename(toFilename);
 }
 displayMessage(config.macros.upload.messages.mainFileUploaded.format(
 [config.macros.upload.dirname(storeUrl)+"/"+toFilename]), config.macros.upload.dirname(storeUrl)+"/"+toFilename);
 var log = new config.macros.upload.UploadLog();
 log.endUpload();
 store.setDirty(true); store.setDirty(false); // ELS - toggle to ensure notification event after upload
 }
 // for debugging store.php uncomment last line
 //DEBUG alert(responseText);
 }
 );
};

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


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

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

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

//{{{
config.lib.options.init('txtUploadStoreUrl','store.php');
config.lib.options.init('txtUploadFilename','');
config.lib.options.init('txtUploadDir','');
config.lib.options.init('txtUploadBackupDir','');
config.lib.options.init('txtUploadUserName',config.options.txtUserName);
config.lib.options.init('pasUploadPassword','');
config.shadowTiddlers.UploadPluginDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadPluginDoc ]]\n"; 


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

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

//{{{
config.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;
config.macros.saveChanges.label = config.macros.upload.label.saveToDisk;
//}}}
////===
/***
|''Name:''|UploadPlugin|
|''Type:''|Plugin|
|''Version:''|3.3.1 (30/03/2006)|
|''Source:''|[[TiddlyWiki.BidiX.info/#UploadPlugin|http://tiddlywiki.BidiX.info/#UploadPlugin]]|
|''Documentation:''|[[TiddlyWiki.BidiX.info/#UploadPluginDoc|http://tiddlywiki.BidiX.info/#UploadPluginDoc]]|
|''Author:''|BidiX[at]BidiX.info |
|''Required:''| TW 2.0.6 or better, PHP 4.4 (perhaps less  but not working on 4.1.2) |

!Description
UploadPlugin, with [[store.php]], provides @@upload@@ and @@save to web@@ functions. See HowToUpload ([[HowToUpload|http://TiddlyWiki.bidix.info/#HowToUpload]]).
UploadPlugin uses Username and Password from UploadOptions stored in cookies to authenticate itself to [[store.php]].
French translation available as a separate tiddler UploadPluginMsgFR

!!UploadPlugin
*If the TiddlyWiki is viewed from @@local disk@@ :
**{{{<<saveChanges>>}}} 
***display as ''save to disk''
***work as usual
**{{{<<upload>>}}}
***display as ''upload''
***after saving to disk, upload in the storeUrl directory.
*If the TiddlyWiki is viewed from @@website@@ and is @@readOnly@@ (in core TiddlyWiki since 2.0.6) :
**{{{<<saveChanges>>}}} 
***print nothing
***has been disabled
**{{{<<upload>>}}}
***display as '''save to web''
***save in the uploadDir directory.
*If GenerateAnRssFeed in AdvancedOptions is set :
**generate the content of the RSSFeed 
**upload the RssFile in uploadDir directory
**Caution : use the SiteUrl tiddler to specify the right url of the TiddlyWiki in the generated RssFile
*DisplayMessage
*Log upload action in UploadLog
hint : if UploadLog is the first tiddler in the Timeline Tab, no tiddler has been updated since last upload.

!![[store.php]]
*UserVariables to set :
//{{{
$AUTHENTICATE_USER = true; // true | false
$USERS = array(
 'UserName1'=>'Password1', 
 'UserName2'=>'Password2', 
 'UserName3'=>'Password3'); // set usernames and strong passwords
$DEBUG = false; // true | false
//}}}
*method GET
**display an information page
*method POST
**if $~AUTHENTICATE_USER is ''true''
***presence and value of user and password are checked with $USER and $PASSWORD 
**if toFilename already exists and backDir parameter specified
***rename toFilename to backupDir/toFilename.AAAAMMDD.HHSS.html
**copy temporaryUploadedFile to toFilename
** return status

!Usage : 
{{{
<<upload>>
 uses UploadOptions saved in cookies :
 txtUploadUserName: username
 pasUploadPassword : password
 txtUploadStoreUrl : store script
 txtUploadDir : relative path for upload directory
 txtUploadFilename : upload filename
 txtUploadBackupDir : relative path for backup directory

<<upload [storeUrl [toFilename [backupDir [uploadDir [username]]]]]>>
 optional positional parameters can be passed to overwrite UploadOptions in this order. 
}}}

Install the {{{<<upload ... >>}}} macro in SideBarOptions just below {{{<<saveChanges>>}}} macro.


!User manual
See HowToUpload

!Installation :
*Install the UploadPlugin as usual
*Upload the [[store.php]] file on your php aware webserver in your TiddlyWiki directory
*Protect your server against malicious upload. Two approaches :
**set $~AUTHENTICATE_USER to true in the [[store.php]] script
***configure $USER and $PASSWORD in the [[store.php]] script on your webserver
***set UploadOptions in conformity with [[store.php]]
**Use server protection :
***for Apache web server ([[for detail see Apache documentation|http://httpd.apache.org/docs/1.3/howto/htaccess.html]]) : 
****configure and upload the [[.htaccess]] [[.passwd]]
***for other web servers see the appropriate documentation
*Configure an upload button, for example in the SideBarOptions
!Suppported Browser
*Firefox : tested Ok
*Internet Explorer : tested Ok
*Safari : reported ok on OS X
*Others : Not tested, please report status.

!Revision history
*V 3.3.1 (30/03/2006)
**bug in backup folder when uploading rssfile fixed
*V 3.3.0 (12/03/2006)
**Code refactoring
**suppress saveChanges hijacking
*V3.2.2 (25/02/2006)
**Use PasswordTweak 1.0.1
**uploaddir is a relative path
**backupdir is a relative path
+++[previous revisions]
*V3.2.1 (13/02/2006)
**name and password added to open.request (Thanks to TedPavlic)
*V3.2.0 (14/02/2006)
**Use PassworDTweak (http://tiddlyWiki.bidix.info/#PasswordTweak) for password
*V3.1.0 (12/02/2006)
**UploadOptions in Cookies
**Username and password from UploadOptions pass to store.php script for authentification check
*V3.0.3 (03/02/2006)
**Firefox 1.5.0.1 crashes due to global var fixed
*V3.0.2 (25-Jan-2006)
**HTTPS compatible
*V3.0.1 (18-Jan-2006)
**UTF8toUnicode conversion problem in Firefox
*V3.0.0 (15-Jan-2006)
**Asynchronous upload
**Synchronous upload before unload of the page
**All strings extracted in macro config
**Compatibility checked with TW 2.0.2 & TW 1.2.39 for both FF 1.5 and IE 6
*V2.0.2 (8-Jan-2006)
**conversion of SiteTitle and SiteSubtitle in web page Title
*V2.0.1 (8-Jan-2006)
**Compatibilty with TiddlyWiki 2.0.1
*V2.0.0 (3-Jan-2006)
**Save to web
**Compatibilty with TiddlyWiki 1.2.39 and TiddlyWiki 2.0.0 Beta 6
*v1.1.0 (27-Dec-2005)
**Upload RSS File
*v1.0.3 (26-Dec-2005)
**UploadLog tiddler
*v1.0.2 (24-Dec-2005)
**Optional parameter toFilename
**Optional parameter backupDir
*v1.0.1 (23-Dec-2005)
**reformatting code
* v1.0.0 (17-Dec-2005)
** first public working version
===

// null logger : no more UploadLog and no upload logging
// BidiX - 2006/11/8
//{{{
config.macros.upload.UploadLog = function() {return this;};
config.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir,  backupDir) {};
config.macros.upload.UploadLog.prototype.endUpload = function() {};
//}}}
Latest version is v3.20. See the ChangeLog for details.

! Summary:
VirtMus (virtual music) is a free application that allows the user to display sheet music and turn pages without removing the hands (or feet) from the instrument the music is performed on. This feature is very useful during concerts and practice sessions as it allows the musician to focus on performing the music without interruption. The software also allows the users to store and organize their entire sheet music collection on a laptop, making it fully portable and available at a click of a button. See the ScreenShots if you want to see how it looks, or have a look at the DesignPrinciples to see some of the distinguishing features.

! Details:
Music stands are usually able to accomodate at most a single book or 2-3 pages of loose leaf music at once. When performing a longer piece of music, the musician must often move one of the hands away from the instrument to turn the pages. This interupts the performance and breaks the flow of music especially when the page turn occurs during a musically demanding passage.

This software allows the user to create "[[songs|SongLists]]" out of sheet music images obtained from a scanner, digital camera, or pdf, and "PlayLists" out of the "[[songs|SongLists]]". During a performance, the user can simply press a mouse button to move to the next / previous page or press various keyboard keys to advance the music.

[[USB foot switches|FootSwitch]] are available which emulate mouse button presses thus freeing the hands to play the instrument. Even without a FootSwitch, using a laptop display avoids the problem of books that don't stay open, or loose leaf pages that fly off the music stand when the wind (or HVAC unit) blows.

See the ToDo list for a number of non-critical issues and features under development.

If you're looking for similar software but with a commercial or shareware license, see http://www.estandmusic.com/ .

This software was written and is being maintained by [[Gabriel Burca|GabrielBurca]]. Developers who wish to contribute should contact the author at gburca dash virtmus at ebixio dot com or by using the ~SourceForge system at http://sourceforge.net/users/gburca/

VirtMus is Copyright (C) 2006-2011 Gabriel Burca and released under the [[GPL|http://www.gnu.org/copyleft/gpl.html]] license.
* Download and install the application following the VirtMusInstall instructions.
* Decide on how to organize your music. VirtMus makes use of two kinds of files: PlayLists and SongLists. A sensible suggestion would be to create a folder for the playlists, and in that folder create a new sub-folder for each song. The individual song sub-folders would contain the SongName.song.xml file along with the image files making up that song. The layout would look something like this:
** ~FolderForPlayLists
*** playlistA.playlist.xml
*** playlistB.playlist.xml
*** ~FolderForSong1
**** song1.song.xml
**** song1-version2.song.xml
**** song1_page1.png
**** song1_page2.png
**** ...
*** ~FolderForSong2
**** song1.song.xml
**** song1_page1.png
**** song1_page2.png
* A song file (''.song.xml'' extension) stores the location of the music page images. A playlist file (''.playlist.xml'' extension) stores the location of the ''.song.xml'' files. You can move things around on disk to a limited extent after you create the songs and playlists, but VirtMus can not keep track of how you shuffle things around. If you don't keep songs and music pages together, or playlists and songs together, you might need to re-create the songs or playlists. See the ChangeLog for version 0.52.
* When you start the application (see VirtMusInstall for how to run especially if you're on Linux) you will see two default PlayLists that are always present: ''Default Play List'' and ''All Songs''. If you open a song without first selecting a play-list, the song will be added to the "Default Play List". The "All Songs" play-list contains all the songs VirtMus was able to find on disk. 
[img[img/EmptyAppSmall.png]]
* Create a [[song|SongLists]] by using the ''Song''->''New Song'' menu option or by clicking on the corresponding toolbar button. Navigate to the directory you want to save the song in and provide a name for the song file. Open the ''Default Play List'' and you will find your newly created song there.
* Select the new song, and use the ''~MusicPage''->''Add Pages'' menu option (or corresponding toolbar button) to select the images for this song. You can add multiple images at once from the dialog box provided by holding down Ctrl (to select random files) or Shift (to select a range of files). If you select a PDF file, you will be prompted for the page range you wish to import from the PDF.
* Save the song using the ''Song''->''Save Song'' menu option.
* Start your practice session by using the ''View''->''Go Live'' menu option or toolbar button.
* Use the left/right mouse buttons or Page Down/Up to advance through the pages, or use a FootSwitch. See the LiveWindowKeyboardShortcuts section for a list of available keyboard shortcuts.
* Also, see ''Tools''->''Options'' and the VirtMusOptions section for various settings that can be used to customize the display orientation, scroll amount and scroll direction.
! Install the Requirements:
The only "hard" requirement is the Java Runtime Environment (JRE) 6 SE which you might already have. If not, it can be obtained from:
* Windows/Linux/Solaris: http://java.sun.com/javase/downloads/index.jsp
* Mac: http://developer.apple.com/java/
!! Optional requirements:
All of the optional requirements are available for Unix/Linux, Windows and OSX.
* It is recommended that you also install the JavaAdvancedImaging libraries for improved performance.
* [[Inkscape|http://www.inkscape.org/]] is used for advanced annotations. Download it from http://www.inkscape.org/download/
* [[ImageMagic|http://www.imagemagick.org/]] is a useful tool to convert graphics files between every imaginable format. Most notably, it allows you to ConvertFromPdf to image formats that can be used by VirtMus if for some reason you don't want to use the PDF file directly. Download the latest binary release for your platform from http://www.imagemagick.org/script/binary-releases.php

! Download the application
* Download the latest release from http://sourceforge.net/projects/virtmus/files/VirtMus/
* Subscribe with SourceForge.net to be notified of new releases by monitoring the [[Open Discussion|http://sourceforge.net/projects/virtmus/forums]] forum.

! Install
* To install on Windows, you can download and execute the "{{{VirtMus-v.vv.exe}}}" installer (where v.vv is the version number).
* To "install" the zip distribution on Windows/Linux/Solaris, simply unzip the downloaded file in a convenient place.
* To "install" on Mac... you're on your own, but you'll want to start with the zip distribution.
* If you're interested in the version designed to be launched with the http://portableapps.com launcher, download the "{{{VirtMusPortable_v.vv.paf.exe}}}" file from the [[VirtMus For PortableApps|http://sourceforge.net/projects/virtmus/files/VirtMus%20For%20PortableApps/]] folder and install it by following the instructions at http://portableapps.com.

! Run
* On Windows: if you used the "zip" distribution, go to the directory you unzipped the file and execute the {{{virtmus.exe}}} file from the {{{bin}}} subdirectory. If you used the "exe" distribution, you should already have shortcuts to VirtMus in your Start menu.

* On UNIX: go to the directory you unzipped the file and execute the {{{virtmus}}} script from the {{{bin}}} subdirectory. Use the {{{--jdkhome}}} command line option to specify where your Java 6 JRE is located, or modify the {{{virtmus.conf}}} file from the {{{etc}}} subdirectory to uncomment the {{{jdkhome}}} line and make it point to your Java 6 JRE.
** Ex: {{{./bin/virtmus --jdkhome /usr/local/jdk1.6.0}}}

* On Mac: ... you're on your own. I don't have a Mac so I can't test, but theoretically it should work. I welcome contributions to this document from Mac users.
[img[img/Options.png]]

* ''~PlayList Directory'': All playlists found in this directory (and its subdirectories, recursively) will be shown in the ~PlayList Window tab when the application start up.
* ''Songs Directory'': All songs found in this directory (and its subdirectories, recursively) will be added to the ''All Songs'' playlist on application start up.
* ''Display orientation'': When using a laptop (or tablet PC) to display the music, the display can be opened flat and the laptop placed on the music stand in any desired orientation. This setting determines which direction is up. For example, if you plan to place the laptop on the music stand as shown in the second image below (with the keyboard on the right and the display on the left), select the second orientation button (Clockwise 90). The 4 laptop orientations below correspond to the 4 display orientation buttons.

[img[img/Orientation.png]]

* ''Page scroll''
** ''Scroll percentage'': When set to ''0'', only one page is shown at a time regardless of the page and/or display size. When set to any other value, as many pages as fit on the screen will be shown. The illustrations below show how the display changes every time you click the mouse under different settings.

*** Display orientation = Normal
*** Scroll percentage = ''30''
*** Scroll direction = Horizontal
[img[img/NormalOrient30HScroll.png]]
*** Display orientation = Normal
*** Scroll percentage = ''100''
*** Scroll direction = Horizontal
[img[img/NormalOrient100HScroll.png]]
*** Display orientation = ''Clockwise 90''
*** Scroll percentage = 100
*** Scroll direction = ''Vertical''
[img[img/Rot90Orient100VScroll.png]]
*** Display orientation = Clockwise 90
*** Scroll percentage = 30
*** Scroll direction = Vertical
[img[img/Rot90Orient30VScroll.png]]

! Keymap Options
The keymap options allow the user to modify the keyboard shortcuts for all of the actions available. The actions are organized roughly according to the menu, so for example the "Edit Annotations" action is under the ~MusicPage folder.
[img[img/OptionsKeymap.png]]
//{{{
version.extensions.allTagsExcept = {major: 0, minor: 1, revision: 0, date: new Date(2005,8,15)};
config.macros.allTagsExcept = {tooltip: "Show tiddlers tagged with '%0'",noTags: "There are no tags to display"};

config.macros.allTagsExcept.handler = function(place,macroName,params)
{
 var tags = store.getTags();
 var theTagList = createTiddlyElement(place,"ul",null,null,null);
 if(tags.length == 0)
 createTiddlyElement(theTagList,"li",null,"listTitle",this.noTags);
 for (var t=0; t<tags.length; t++) {
 var includeTag = true;
 for (var p=0;p<params.length; p++) if (tags[t][0] == params[p]) includeTag = false;
 if (includeTag){
 var theListItem =createTiddlyElement(theTagList,"li",null,null,null);
 var theTag = createTiddlyButton(theListItem,tags[t][0] + " (" + tags[t][1] + ")",this.tooltip.format([tags[t][0]]),onClickTag);
 theTag.setAttribute("tag",tags[t][0]);
 }
 }
}

//}}}