Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jeremy Ruston, Copyright © 2007-2011 UnaMesa Association
//{{{
(function($){
var macro = config.macros.addClass = {
handler: function(place, macroName, params, wikifier, paramString, tiddler){
var title = story.findContainingTiddler(place).id.substr(7);
var tid = store.fetchTiddler(title);
var classname = params[0] || tid.fields['classname'] || "";
$(story.findContainingTiddler(place)).addClass(classname);
}
};
})(jQuery);
//}}}
text/plain
.txt .text .js .vbs .asp .cgi .pl
----
text/html
.htm .html .hta .htx .mht
----
text/comma-separated-values
.csv
----
text/javascript
.js
----
text/css
.css
----
text/xml
.xml .xsl .xslt
----
image/gif
.gif
----
image/jpeg
.jpg .jpe .jpeg
----
image/png
.png
----
image/bmp
.bmp
----
image/tiff
.tif .tiff
----
audio/basic
.au .snd
----
audio/wav
.wav
----
audio/x-pn-realaudio
.ra .rm .ram
----
audio/x-midi
.mid .midi
----
audio/mp3
.mp3
----
audio/m3u
.m3u
----
video/x-ms-asf
.asf
----
video/avi
.avi
----
video/mpeg
.mpg .mpeg
----
video/quicktime
.qt .mov .qtvr
----
application/pdf
.pdf
----
application/rtf
.rtf
----
application/postscript
.ai .eps .ps
----
application/wordperfect
.wpd
----
application/mswrite
.wri
----
application/msexcel
.xls .xls3 .xls4 .xls5 .xlw
----
application/msword
.doc
----
application/mspowerpoint
.ppt .pps
----
application/x-director
.swa
----
application/x-shockwave-flash
.swf
----
application/x-zip-compressed
.zip
----
application/x-gzip
.gz
----
application/x-rar-compressed
.rar
----
application/octet-stream
.com .exe .dll .ocx
----
application/java-archive
.jar
/***
|Name|AttachFilePlugin|
|Source|http://www.TiddlyTools.com/#AttachFilePlugin|
|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|
|Version|4.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|AttachFilePluginFormatters, AttachFileMIMETypes|
|Description|Store binary files as base64-encoded tiddlers with fallback links for separate local and/or remote file storage|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
!!!!!Documentation
>see [[AttachFilePluginInfo]]
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Revisions
<<<
2009.06.04 [4.0.0] changed attachment storage format to use //sections// instead of embedded substring markers.
|please see [[AttachFilePluginInfo]] for additional revision details|
2005.07.20 [1.0.0] Initial Release
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePlugin= {major: 4, minor: 0, revision: 0, date: new Date(2009,6,4)};
// shadow tiddler
config.shadowTiddlers.AttachFile="<<attach inline>>";
// add 'attach' backstage task (insert before built-in 'importTask')
if (config.tasks) { // for TW2.2b or above
config.tasks.attachTask = {
text: "attach",
tooltip: "Attach a binary file as a tiddler",
content: "<<attach inline>>"
}
config.backstageTasks.splice(config.backstageTasks.indexOf("importTask"),0,"attachTask");
}
config.macros.attach = {
// // lingo
//{{{
label: "attach file",
tooltip: "Attach a file to this document",
linkTooltip: "Attachment: ",
typeList: "AttachFileMIMETypes",
titlePrompt: " enter tiddler title...",
MIMEPrompt: "<option value=''>select MIME type...</option><option value='editlist'>[edit list...]</option>",
localPrompt: " enter local path/filename...",
URLPrompt: " enter remote URL...",
tiddlerErr: "Please enter a tiddler title",
sourceErr: "Please enter a source path/filename",
storageErr: "Please select a storage method: embedded, local or remote",
MIMEErr: "Unrecognized file format. Please select a MIME type",
localErr: "Please enter a local path/filename",
URLErr: "Please enter a remote URL",
fileErr: "Invalid path/file or file not found",
tiddlerFormat: '!usage\n{{{%0}}}\n%0\n!notes\n%1\n!type\n%2\n!file\n%3\n!url\n%4\n!data\n%5\n',
//}}}
// // macro definition
//{{{
handler:
function(place,macroName,params) {
if (params && !params[0])
{ createTiddlyButton(place,this.label,this.tooltip,this.toggleAttachPanel); return; }
var id=params.shift();
this.createAttachPanel(place,id+"_attachPanel",params);
document.getElementById(id+"_attachPanel").style.position="static";
document.getElementById(id+"_attachPanel").style.display="block";
},
//}}}
//{{{
createAttachPanel:
function(place,panel_id,params) {
if (!panel_id || !panel_id.length) var panel_id="_attachPanel";
// remove existing panel (if any)
var panel=document.getElementById(panel_id); if (panel) panel.parentNode.removeChild(panel);
// set styles for this panel
setStylesheet(this.css,"attachPanel");
// create new panel
var title=""; if (params && params[0]) title=params.shift();
var types=this.MIMEPrompt+this.formatListOptions(store.getTiddlerText(this.typeList)); // get MIME types
panel=createTiddlyElement(place,"span",panel_id,"attachPanel",null);
var html=this.html.replace(/%id%/g,panel_id);
html=html.replace(/%title%/g,title);
html=html.replace(/%disabled%/g,title.length?"disabled":"");
html=html.replace(/%IEdisabled%/g,config.browser.isIE?"disabled":"");
html=html.replace(/%types%/g,types);
panel.innerHTML=html;
if (config.browser.isGecko) { // FF3 FIXUP
document.getElementById("attachSource").style.display="none";
document.getElementById("attachFixPanel").style.display="block";
}
return panel;
},
//}}}
//{{{
toggleAttachPanel:
function (e) {
if (!e) var e = window.event;
var parent=resolveTarget(e).parentNode;
var panel = document.getElementById("_attachPanel");
if (panel==undefined || panel.parentNode!=parent)
panel=config.macros.attach.createAttachPanel(parent,"_attachPanel");
var isOpen = panel.style.display=="block";
if(config.options.chkAnimate)
anim.startAnimating(new Slider(panel,!isOpen,e.shiftKey || e.altKey,"none"));
else
panel.style.display = isOpen ? "none" : "block" ;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
},
//}}}
//{{{
formatListOptions:
function(text) {
if (!text || !text.trim().length) return "";
// get MIME list content from text
var parts=text.split("\n----\n");
var out="";
for (var p=0; p<parts.length; p++) {
var lines=parts[p].split("\n");
var label=lines.shift(); // 1st line=display text
var value=lines.shift(); // 2nd line=item value
out +='<option value="%1">%0</option>'.format([label,value]);
}
return out;
},
//}}}
// // interface definition
//{{{
css:
".attachPanel { display: none; position:absolute; z-index:10; width:35em; right:105%; top:0em;\
background-color: #eee; color:#000; font-size: 8pt; line-height:110%;\
border:1px solid black; border-bottom-width: 3px; border-right-width: 3px;\
padding: 0.5em; margin:0em; -moz-border-radius:1em;-webkit-border-radius:1em; text-align:left }\
.attachPanel form { display:inline;border:0;padding:0;margin:0; }\
.attachPanel select { width:99%;margin:0px;font-size:8pt;line-height:110%;}\
.attachPanel input { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%}\
.attachPanel textarea { width:98%;margin:0px;height:2em;font-size:8pt;line-height:110%}\
.attachPanel table { width:100%;border:0;margin:0;padding:0;color:inherit; }\
.attachPanel tbody, .attachPanel tr, .attachPanel td { border:0;margin:0;padding:0;color:#000; }\
.attachPanel .box { border:1px solid black; padding:.3em; margin:.3em 0px; background:#f8f8f8; \
-moz-border-radius:5px;-webkit-border-radius:5px; }\
.attachPanel .chk { width:auto;border:0; }\
.attachPanel .btn { width:auto; }\
.attachPanel .btn2 { width:49%; }\
",
//}}}
//{{{
html:
'<form>\
attach from source file\
<input type="file" id="attachSource" name="source" size="56"\
onChange="config.macros.attach.onChangeSource(this)">\
<div id="attachFixPanel" style="display:none"><!-- FF3 FIXUP -->\
<input type="text" id="attachFixSource" style="width:90%"\
title="Enter a path/file to attach"\
onChange="config.macros.attach.onChangeSource(this);">\
<input type="button" style="width:7%" value="..."\
title="Enter a path/file to attach"\
onClick="config.macros.attach.askForFilename(document.getElementById(\'attachFixSource\'));">\
</div><!--end FF3 FIXUP-->\
<div class="box">\
<table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
embed data <input type=checkbox class=chk name="useData" %IEdisabled% \
onclick="if (!this.form.MIMEType.value.length)\
this.form.MIMEType.selectedIndex=this.checked?1:0; "> \
</td><td style="border:0">\
<select size=1 name="MIMEType" \
onchange="this.title=this.value; if (this.value==\'editlist\')\
{ this.selectedIndex=this.form.useData.checked?1:0; story.displayTiddler(null,config.macros.attach.typeList,2); return; }">\
<option value=""></option>\
%types%\
</select>\
</td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
local link <input type=checkbox class=chk name="useLocal"\
onclick="this.form.local.value=this.form.local.defaultValue=this.checked?config.macros.attach.localPrompt:\'\';"> \
</td><td style="border:0">\
<input type=text name="local" size=15 autocomplete=off value=""\
onchange="this.form.useLocal.checked=this.value.length" \
onkeyup="this.form.useLocal.checked=this.value.length" \
onfocus="if (!this.value.length) this.value=config.macros.attach.localPrompt; this.select()">\
</td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
remote link <input type=checkbox class=chk name="useURL"\
onclick="this.form.URL.value=this.form.URL.defaultValue=this.checked?config.macros.attach.URLPrompt:\'\';\"> \
</td><td style="border:0">\
<input type=text name="URL" size=15 autocomplete=off value=""\
onfocus="if (!this.value.length) this.value=config.macros.attach.URLPrompt; this.select()"\
onchange="this.form.useURL.checked=this.value.length;"\
onkeyup="this.form.useURL.checked=this.value.length;">\
</td></tr></table>\
</div>\
<table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;vertical-align:top;width:1%;white-space:nowrap">\
notes \
</td><td style="border:0" colspan=2>\
<textarea name="notes" style="width:98%;height:3.5em;margin-bottom:2px"></textarea>\
</td><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
attach as \
</td><td style="border:0" colspan=2>\
<input type=text name="tiddlertitle" size=15 autocomplete=off value="%title%"\
onkeyup="if (!this.value.length) { this.value=config.macros.attach.titlePrompt; this.select(); }"\
onfocus="if (!this.value.length) this.value=config.macros.attach.titlePrompt; this.select()" %disabled%>\
</td></tr></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
add tags \
</td><td style="border:0">\
<input type=text name="tags" size=15 autocomplete=off value="" onfocus="this.select()">\
</td><td style="width:40%;text-align:right;border:0">\
<input type=button class=btn2 value="attach"\
onclick="config.macros.attach.onClickAttach(this)"><!--\
--><input type=button class=btn2 value="close"\
onclick="var panel=document.getElementById(\'%id%\'); if (panel) panel.parentNode.removeChild(panel);">\
</td></tr></table>\
</form>',
//}}}
// // control processing
//{{{
onChangeSource:
function(here) {
var form=here.form;
var list=form.MIMEType;
var theFilename = here.value;
var theExtension = theFilename.substr(theFilename.lastIndexOf('.')).toLowerCase();
// if theFilename is in current document folder, remove path prefix and use relative reference
var h=document.location.href; folder=getLocalPath(decodeURIComponent(h.substr(0,h.lastIndexOf("/")+1)));
if (theFilename.substr(0,folder.length)==folder) theFilename='./'+theFilename.substr(folder.length);
else theFilename='file:///'+theFilename; // otherwise, use absolute reference
theFilename=theFilename.replace(/\\/g,"/"); // fixup: change \ to /
form.useLocal.checked = true;
form.local.value = theFilename;
form.useData.checked = !form.useData.disabled;
list.selectedIndex=1;
for (var i=0; i<list.options.length; i++) // find matching MIME type
if (list.options[i].value.indexOf(theExtension)!=-1) { list.selectedIndex = i; break; }
if (!form.tiddlertitle.disabled)
form.tiddlertitle.value=theFilename.substr(theFilename.lastIndexOf('/')+1); // get tiddlername from filename
},
//}}}
//{{{
onClickAttach:
function (here) {
clearMessage();
// get input values
var form=here.form;
var src=form.source; if (config.browser.isGecko) src=document.getElementById("attachFixSource");
src=src.value!=src.defaultValue?src.value:"";
var when=(new Date()).formatString(config.macros.timeline.dateFormat);
var title=form.tiddlertitle.value;
var local = form.local.value!=form.local.defaultValue?form.local.value:"";
var url = form.URL.value!=form.URL.defaultValue?form.URL.value:"";
var notes = form.notes.value;
var tags = "attachment excludeMissing "+form.tags.value;
var useData=form.useData.checked;
var useLocal=form.useLocal.checked;
var useURL=form.useURL.checked;
var mimetype = form.MIMEType.value.length?form.MIMEType.options[form.MIMEType.selectedIndex].text:"";
// validate checkboxes and get filename
if (useData) {
if (src.length) { if (!theLocation) var theLocation=src; }
else { alert(this.sourceErr); src.focus(); return false; }
}
if (useLocal) {
if (local.length) { if (!theLocation) var theLocation = local; }
else { alert(this.localErr); form.local.focus(); return false; }
}
if (useURL) {
if (url.length) { if (!theLocation) var theLocation = url; }
else { alert(this.URLErr); form.URL.focus(); return false; }
}
if (!(useData||useLocal||useURL))
{ form.useData.focus(); alert(this.storageErr); return false; }
if (!theLocation)
{ src.focus(); alert(this.sourceErr); return false; }
if (!title || !title.trim().length || title==this.titlePrompt)
{ form.tiddlertitle.focus(); alert(this.tiddlerErr); return false; }
// if not already selected, determine MIME type based on filename extension (if any)
if (useData && !mimetype.length && theLocation.lastIndexOf('.')!=-1) {
var theExt = theLocation.substr(theLocation.lastIndexOf('.')).toLowerCase();
var theList=form.MIMEType;
for (var i=0; i<theList.options.length; i++)
if (theList.options[i].value.indexOf(theExt)!=-1)
{ var mimetype=theList.options[i].text; theList.selectedIndex=i; break; }
}
// attach the file
return this.createAttachmentTiddler(src, when, notes, tags, title,
useData, useLocal, useURL, local, url, mimetype);
},
getMIMEType:
function(src,def) {
var ext = src.substr(src.lastIndexOf('.')).toLowerCase();
var list=store.getTiddlerText(this.typeList);
if (!list || !list.trim().length) return def;
// get MIME list content from tiddler
var parts=list.split("\n----\n");
for (var p=0; p<parts.length; p++) {
var lines=parts[p].split("\n");
var mime=lines.shift(); // 1st line=MIME type
var match=lines.shift(); // 2nd line=matching extensions
if (match.indexOf(ext)!=-1) return mime;
}
return def;
},
createAttachmentTiddler:
function (src, when, notes, tags, title, useData, useLocal, useURL, local, url, mimetype, noshow) {
if (useData) { // encode the data
if (!mimetype.length) {
alert(this.MIMEErr);
form.MIMEType.selectedIndex=1; form.MIMEType.focus();
return false;
}
var d = this.readFile(src); if (!d) { return false; }
displayMessage('encoding '+src);
var encoded = this.encodeBase64(d);
displayMessage('file size='+d.length+' bytes, encoded size='+encoded.length+' bytes');
}
var usage=(mimetype.substr(0,5)=="image"?'[img[%0]]':'[[%0|%0]]').format([title]);
var theText=this.tiddlerFormat.format([
usage, notes.length?notes:'//none//', mimetype,
useLocal?local.replace(/\\/g,'/'):'', useURL?url:'',
useData?('data:'+mimetype+';base64,'+encoded):'' ]);
store.saveTiddler(title,title,theText,config.options.txtUserName,new Date(),tags);
var panel=document.getElementById("attachPanel"); if (panel) panel.style.display="none";
if (!noshow) { story.displayTiddler(null,title); story.refreshTiddler(title,null,true); }
displayMessage('attached "'+title+'"');
return true;
},
//}}}
// // base64 conversion
//{{{
encodeBase64:
function (d) {
if (!d) return null;
// encode as base64
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var out="";
var chr1,chr2,chr3="";
var enc1,enc2,enc3,enc4="";
for (var count=0,i=0; i<d.length; ) {
chr1=d.charCodeAt(i++);
chr2=d.charCodeAt(i++);
chr3=d.charCodeAt(i++);
enc1=chr1 >> 2;
enc2=((chr1 & 3) << 4) | (chr2 >> 4);
enc3=((chr2 & 15) << 2) | (chr3 >> 6);
enc4=chr3 & 63;
if (isNaN(chr2)) enc3=enc4=64;
else if (isNaN(chr3)) enc4=64;
out+=keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);
chr1=chr2=chr3=enc1=enc2=enc3=enc4="";
}
return out;
},
decodeBase64: function(input) {
var out="";
var chr1,chr2,chr3;
var enc1,enc2,enc3,enc4;
var i = 0;
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input=input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {
enc1=keyStr.indexOf(input.charAt(i++));
enc2=keyStr.indexOf(input.charAt(i++));
enc3=keyStr.indexOf(input.charAt(i++));
enc4=keyStr.indexOf(input.charAt(i++));
chr1=(enc1 << 2) | (enc2 >> 4);
chr2=((enc2 & 15) << 4) | (enc3 >> 2);
chr3=((enc3 & 3) << 6) | enc4;
out=out+String.fromCharCode(chr1);
if (enc3!=64) out=out+String.fromCharCode(chr2);
if (enc4!=64) out=out+String.fromCharCode(chr3);
} while (i<input.length);
return out;
},
//}}}
// // I/O functions
//{{{
readFile: // read local BINARY file data
function(filePath) {
if(!window.Components) { return null; }
try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
catch(e) { alert("access denied: "+filePath); return null; }
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try { file.initWithPath(filePath); } catch(e) { alert("cannot read file - invalid path: "+filePath); return null; }
if (!file.exists()) { alert("cannot read file - not found: "+filePath); return null; }
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
inputStream.init(file, 0x01, 00004, null);
var bInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);
bInputStream.setInputStream(inputStream);
return(bInputStream.readBytes(inputStream.available()));
},
//}}}
//{{{
writeFile:
function(filepath,data) {
// TBD: decode base64 and write BINARY data to specified local path/filename
return(false);
},
//}}}
//{{{
askForFilename: // for FF3 fixup
function(target) {
var msg=config.messages.selectFile;
if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
// get local path for current document
var path=getLocalPath(document.location.href);
var p=path.lastIndexOf("/"); if (p==-1) p=path.lastIndexOf("\\"); // Unix or Windows
if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
var file=""
var result=window.mozAskForFilename(msg,path,file,true); // FF3 FIXUP ONLY
if (target && result.length) // set target field and trigger handling
{ target.value=result; target.onchange(); }
return result;
}
};
//}}}
//{{{
if (window.mozAskForFilename===undefined) { // also defined by CoreTweaks (for ticket #604)
window.mozAskForFilename=function(msg,path,file,mustExist) {
if(!window.Components) return false;
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel)
var result=picker.file.persistentDescriptor;
}
catch(ex) { displayMessage(ex.toString()); }
return result;
}
}
//}}}
/***
|Name|AttachFilePluginFormatters|
|Source|http://www.TiddlyTools.com/#AttachFilePluginFormatters|
|Version|4.0.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1.3|
|Type|plugin|
|Description|run-time library for displaying attachment tiddlers|
Runtime processing for //rendering// attachment tiddlers created by [[AttachFilePlugin]]. Attachment tiddlers are tagged with<<tag attachment>>and contain binary file content (e.g., jpg, gif, pdf, mp3, etc.) that has been stored directly as base64 text-encoded data or can be loaded from external files stored on a local filesystem or remote web server. Note: after creating new attachment tiddlers, you can remove [[AttachFilePlugin]], as long as you retain //this// tiddler (so that images can be rendered later on).
!!!!!Formatters
<<<
This plugin extends the behavior of the following TiddlyWiki core "wikify()" formatters:
* embedded images: {{{[img[tooltip|image]]}}}
* linked embedded images: {{{[img[tooltip|image][link]]}}}
* external/"pretty" links: {{{[[label|link]]}}}
''Please refer to AttachFilePlugin (source: http://www.TiddlyTools.com/#AttachFilePlugin) for additional information.''
<<<
!!!!!Revisions
<<<
2009.10.10 [4.0.1] in fileExists(), check for IE to avoid hanging Chrome during startup
2009.06.04 [4.0.0] changed attachment storage format to use //sections// instead of embedded substring markers.
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.10.29 [3.7.0] more code reduction: removed upload handling from AttachFilePlugin (saves ~7K!)
2007.10.28 [3.6.0] removed duplicate formatter code from AttachFilePlugin (saves ~10K!) and updated documentation accordingly. This plugin ([[AttachFilePluginFormatters]]) is now //''required''// in order to display attached images/binary files within tiddler content.
2006.05.20 [3.4.0] through 2007.03.01 [3.5.3] sync with AttachFilePlugin
2006.05.13 [3.2.0] created from AttachFilePlugin v3.2.0
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePluginFormatters= {major: 4, minor: 0, revision: 1, date: new Date(2009,10,10)};
//}}}
//{{{
if (config.macros.attach==undefined) config.macros.attach= { };
//}}}
//{{{
if (config.macros.attach.isAttachment==undefined) config.macros.attach.isAttachment=function (title) {
var tiddler = store.getTiddler(title);
if (tiddler==undefined || tiddler.tags==undefined) return false;
return (tiddler.tags.indexOf("attachment")!=-1);
}
//}}}
//{{{
// test for local file existence - returns true/false without visible error display
if (config.macros.attach.fileExists==undefined) config.macros.attach.fileExists=function(f) {
if(window.Components) { // MOZ
try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
catch(e) { return false; } // security access denied
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try { file.initWithPath(f); }
catch(e) { return false; } // invalid directory
return file.exists();
}
else if (config.browser.isIE) { // IE
var fso = new ActiveXObject("Scripting.FileSystemObject");
return fso.FileExists(f);
}
else return true; // other browsers: assume file exists
}
//}}}
//{{{
if (config.macros.attach.getAttachment==undefined) config.macros.attach.getAttachment=function(title) {
// extract embedded data, local and remote links (if any)
var text=store.getTiddlerText(title,'');
var embedded=store.getTiddlerText(title+'##data','').trim();
var locallink=store.getTiddlerText(title+'##file','').trim();
var remotelink=store.getTiddlerText(title+'##url','').trim();
// backward-compatibility for older attachments (pre 4.0.0)
var startmarker="---BEGIN_DATA---\n";
var endmarker="\n---END_DATA---";
var pos=0; var endpos=0;
if ((pos=text.indexOf(startmarker))!=-1 && (endpos=text.indexOf(endmarker))!=-1)
embedded="data:"+(text.substring(pos+startmarker.length,endpos)).replace(/\n/g,'');
if ((pos=text.indexOf("/%LOCAL_LINK%/"))!=-1)
locallink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));
if ((pos=text.indexOf("/%REMOTE_LINK%/"))!=-1)
remotelink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));
// if there is a data: URI defined (not supported by IE)
if (embedded.length && !config.browser.isIE) return embedded;
// document is being served remotely... use remote URL (if any) (avoids security alert)
if (remotelink.length && document.location.protocol!="file:")
return remotelink;
// local link only... return link without checking file existence (avoids security alert)
if (locallink.length && !remotelink.length)
return locallink;
// local link, check for file exist... use local link if found
if (locallink.length) {
locallink=locallink.replace(/^\.[\/\\]/,''); // strip leading './' or '.\' (if any)
if (this.fileExists(getLocalPath(locallink))) return locallink;
// maybe local link is relative... add path from current document and try again
var pathPrefix=document.location.href; // get current document path and trim off filename
var slashpos=pathPrefix.lastIndexOf("/"); if (slashpos==-1) slashpos=pathPrefix.lastIndexOf("\\");
if (slashpos!=-1 && slashpos!=pathPrefix.length-1) pathPrefix=pathPrefix.substr(0,slashpos+1);
if (this.fileExists(getLocalPath(pathPrefix+locallink))) return locallink;
}
// no embedded data, no local (or not found), fallback to remote URL (if any)
if (remotelink.length) return remotelink;
// attachment URL doesn't resolve, just return input as is
return title;
}
//}}}
//{{{
if (config.macros.attach.init_formatters==undefined) config.macros.attach.init_formatters=function() {
if (this.initialized) return;
// find the formatter for "image" and replace the handler
for (var i=0; i<config.formatters.length && config.formatters[i].name!="image"; i++);
if (i<config.formatters.length) config.formatters[i].handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link
{
var e = w.output;
if(lookaheadMatch[5])
{
var link = lookaheadMatch[5];
// ELS -------------
var external=config.formatterHelpers.isExternalLink(link);
if (external)
{
if (config.macros.attach.isAttachment(link))
{
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title = config.macros.attach.linkTooltip + link;
}
else
e = createExternalLink(w.output,link);
}
else
e = createTiddlyLink(w.output,link,false,null,w.isStatic);
// ELS -------------
addClass(e,"imageLink");
}
var img = createTiddlyElement(e,"img");
if(lookaheadMatch[1])
img.align = "left";
else if(lookaheadMatch[2])
img.align = "right";
if(lookaheadMatch[3])
img.title = lookaheadMatch[3];
img.src = lookaheadMatch[4];
// ELS -------------
if (config.macros.attach.isAttachment(lookaheadMatch[4]))
img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);
// ELS -------------
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
//}}}
//{{{
// find the formatter for "prettyLink" and replace the handler
for (var i=0; i<config.formatters.length && config.formatters[i].name!="prettyLink"; i++);
if (i<config.formatters.length) {
config.formatters[i].handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var e;
var text = lookaheadMatch[1];
if(lookaheadMatch[3]) {
// Pretty bracketted link
var link = lookaheadMatch[3];
if (config.macros.attach.isAttachment(link)) {
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title=config.macros.attach.linkTooltip+link;
}
else e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))
? createExternalLink(w.output,link)
: createTiddlyLink(w.output,link,false,null,w.isStatic);
} else {
e = createTiddlyLink(w.output,text,false,null,w.isStatic);
}
createTiddlyText(e,text);
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
} // if "prettyLink" formatter found
this.initialized=true;
}
//}}}
//{{{
config.macros.attach.init_formatters(); // load time init
//}}}
//{{{
if (TiddlyWiki.prototype.coreGetRecursiveTiddlerText==undefined) {
TiddlyWiki.prototype.coreGetRecursiveTiddlerText = TiddlyWiki.prototype.getRecursiveTiddlerText;
TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth) {
return config.macros.attach.isAttachment(title)?
config.macros.attach.getAttachment(title):this.coreGetRecursiveTiddlerText.apply(this,arguments);
}
}
//}}}
<<closeAll>>
<<permaview>>
{{span{<<tiddler {{if (readOnly) place.style.display='none';'';}}
>><<saveChanges>>
<<saveLayout>>}}}
<<restoreLayout>>
<script> if (readOnly) return "<<tiddler [[MakeAnew##toggleReadonly]]>>";</script>
/***
|Name|FileDropPlugin|
|Source|http://www.TiddlyTools.com/#FileDropPlugin|
|Version|2.1.4|
|Author|BradleyMeck and Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|drag-and-drop files/directories to create tiddlers|
''requires FireFox or another Mozilla-compatible browser.''
!!!!!Usage
<<<
This plugin automatically creates tiddlers from files that are dropped onto an open TiddlyWiki document. You can drop multiple selected files and/or folders to create many tiddlers at once. New tiddler titles are created using the filename of each dropped file (i.e., omitting the path). If a title is already in use, you are prompted to enter a new title for that file. If you drop a folder, you will be asked if you want to create a simple 'directory list' of files in a single tiddler or create one tiddler for each file in that folder.
By default, it is assumed that all dropped files contain text. However, if [[AttachFilePlugin]], [[AttachFilePluginFormatters]] and [[AttachFileMIMETypes]] are installed, then you can drop ''//binary data files//'' as well as text files. If the MIME type of a dropped file is not "text/plain", then AttachFilePlugin is used to create an 'attachment' tiddler, rather than creating a simple text tiddler.
When creating text tiddlers, you can embed a //link// to the original external file at the top of the new tiddler, in addition to (or instead of) the text content itself. The format for this link (see Configuration, below) uses embedded ''//replacement markers//'' that allow you to generate a variety of wiki-formatted output, where:
*%0 = filename (without path)
*%1 = local """file://...""" URL
*%2 = local path and filename (OS-native format)
*%3 = relative path (if subdirectory of current document directory)
*%4 = file size
*%5 = file date
*%6 = current date
*%7 = current ~TiddlyWiki username
*\n = newline
By default, the link format uses the filename (%0) and local URL (%1), enclosed within a //hidden section// syntax, like this:
{{{
/%
!link
[[%0|%1]]
!end
%/
}}}
This permits the link to be embedded along with the text content, without changing the appearance of that content when the tiddler is viewed. To display the link in your tiddler content, use:
{{{
<<tiddler TiddlerName##link>>
}}}
<<<
!!!!!Configuration
<<<
__FileDropPlugin options:__
<<option chkFileDropContent>>Copy file content into tiddlers if smaller than: <<option txtFileDropDataLimit>> bytes
//(note: excess text content will be truncated, oversized binary files will skipped, 0=no limit)//
<<option chkFileDropLink>>Generate external links to files, using this format:{{editor{<html><nowiki><textarea rows="4" onchange="
config.macros.option.propagateOption('txtFileDropLinkFormat','value',this.value.escapeLineBreaks(),'input');
"></textarea></html><<tiddler {{
var ta=place.lastChild.getElementsByTagName('textarea')[0];
var v=config.options.txtFileDropLinkFormat.unescapeLineBreaks();
ta.value=v;
"";}}>>}}}<<option chkFileDropTrimFilename>>Omit file extensions from tiddler titles
<<option chkFileDropDisplay>>Automatically display newly created tiddlers
Tag newly created tiddlers with: <<option txtFileDropTags>>
__FileDropPlugin+AttachFilePlugin options:__ //(binary file data as encoded 'base64' text)//
<<option chkFileDropAttachLocalLink>> attachment includes reference to local path/filename
>Note: if the plugin does not seem to work, enter ''about:config'' in the Firefox address bar, and make sure that {{{signed.applets.codebase_principal_support}}} is set to ''true''
<<<
!!!!!Examples (custom handler functions)
<<<
Adds a single file with confirmation and prompting for title:
{{{
config.macros.fileDrop.addEventListener('application/x-moz-file',
function(nsiFile) {
var msg='You have dropped the file:\n'
+nsiFile.path+'\n'
+'onto the page, it will be imported as a tiddler. Is that ok?'
if(confirm(msg)) {
var newDate = new Date();
var title = prompt('what would you like to name the tiddler?');
store.saveTiddler(title,title,loadFile(nsiFile.path),config.options.txtUserName,newDate,[]);
}
return true;
});
}}}
Adds a single file without confirmation, using path/filename as tiddler title:
{{{
config.macros.fileDrop.addEventListener('application/x-moz-file',
function(nsiFile) {
var newDate = new Date();
store.saveTiddler(nsiFile.path,nsiFile.path,loadFile(nsiFile.path),config.options.txtUserName,newDate,[]);
story.displayTiddler(null,nsiFile.path)
return true;
});
}}}
<<<
!!!!!Revisions
<<<
2010.03.06 2.1.4 added event listener for 'dragover' (for FireFox 3.6+)
2009.10.10 2.1.3 fixed IE code error
2009.10.08 2.1.2 fixed chkFileDropContent bypass handling for binary attachments
2009.10.07 2.1.0 added chkFileDropContent and chkFileDropLink/txtFileDropLinkFormat
2009.08.19 2.0.0 fixed event listener registration for FireFox 3.5+. Also, merged with FileDropPluginConfig, with code cleanup/reduction
2008.08.11 1.5.1 added chkFileDropAttachLocalLink option to allow suppression of local path/file link
2007.xx.xx *.*.* add suspend/resume of notifications to improve performance when multiple files are handled
2007.01.01 0.9.9 extensions for AttachFilePlugin
2006.11.04 0.1.1 initial release by Bradley Meck
<<<
!!!!!Code
***/
//{{{
version.extensions.FileDropPlugin={major:2, minor:1, revision:4, date: new Date(2010,3,6)};
config.macros.fileDrop = {
customDropHandlers: [],
addEventListener: function(paramflavor,func,inFront) {
var obj={}; obj.flavor=paramflavor; obj.handler=func;
if (!inFront) this.customDropHandlers.push(obj);
else this.customDropHandlers.shift(obj);
},
dragDropHandler: function(evt) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var dragService = Components.classes['@mozilla.org/widget/dragservice;1'].getService(Components.interfaces.nsIDragService);
var dragSession = dragService.getCurrentSession();
var transferObject = Components.classes['@mozilla.org/widget/transferable;1'].createInstance();
transferObject = transferObject.QueryInterface(Components.interfaces.nsITransferable);
transferObject.addDataFlavor('application/x-moz-file');
var numItems = dragSession.numDropItems;
if (numItems>1) {
clearMessage();
displayMessage('Reading '+numItems+' files...');
store.suspendNotifications();
}
for (var i = 0; i < numItems; i++) {
dragSession.getData(transferObject, i);
var dataObj = {};
var dropSizeObj = {};
for(var ind=0; ind<config.macros.fileDrop.customDropHandlers.length; ind++) {
var item = config.macros.fileDrop.customDropHandlers[ind];
if(dragSession.isDataFlavorSupported(item.flavor)) {
transferObject.getTransferData(item.flavor, dataObj, dropSizeObj);
var droppedFile = dataObj.value.QueryInterface(Components.interfaces.nsIFile);
var result = item.handler.call(item,droppedFile);
evt.stopPropagation();
evt.preventDefault();
if (result) break;
}
}
}
if (numItems>1) {
store.resumeNotifications();
store.notifyAll();
displayMessage(numItems+' files have been processed');
}
}
}
//}}}
/***
!!!!!window event handlers
***/
//{{{
if(!window.event) {
window.addEventListener('dragdrop', // FireFox3.1-
config.macros.fileDrop.dragDropHandler, true);
window.addEventListener('drop', // FireFox3.5+
config.macros.fileDrop.dragDropHandler, true);
window.addEventListener('dragover', // FireFox3.6+
function(e){e.stopPropagation();e.preventDefault();}, true);
}
//}}}
/***
!!!!!handler for files, directories and binary attachments (see [[AttachFilePlugin]])
***/
//{{{
var defaults={
chkFileDropDisplay: true,
chkFileDropTrimFilename: false,
chkFileDropContent: true,
chkFileDropLink: true,
txtFileDropLinkFormat: '/%\\n!link\\n[[%0|%1]]\\n!end\\n%/',
txtFileDropDataLimit: '32768',
chkFileDropAttachLocalLink: true,
txtFileDropTags: ''
};
for (var id in defaults) if (config.options[id]===undefined)
config.options[id]=defaults[id];
config.macros.fileDrop.addEventListener('application/x-moz-file',function(nsiFile) {
var co=config.options; // abbrev
var header='Index of %0\n^^(as of %1)^^\n|!filename| !size | !modified |\n';
var item='|[[%0|%1]]| %2|%3|\n';
var footer='Total of %0 bytes in %1 files\n';
var now=new Date();
var files=[nsiFile];
if (nsiFile.isDirectory()) {
var folder=nsiFile.directoryEntries;
var files=[];
while (folder.hasMoreElements()) {
var f=folder.getNext().QueryInterface(Components.interfaces.nsILocalFile);
if (f instanceof Components.interfaces.nsILocalFile && !f.isDirectory()) files.push(f);
}
var msg=nsiFile.path.replace(/\\/g,'/')+'\n\n';
msg+='contains '+files.length+' files... ';
msg+='select OK to attach all files or CANCEL to create a list...';
if (!confirm(msg)) { // create a list in a tiddler
var title=nsiFile.leafName; // tiddler name is last directory name in path
while (title && title.length && store.tiddlerExists(title)) {
if (confirm(config.messages.overwriteWarning.format([title]))) break;
title=prompt('Enter a new tiddler title',nsiFile.path.replace(/\\/g,'/'));
}
if (!title || !title.length) return true; // cancelled
var text=header.format([nsiFile.path.replace(/\\/g,'/'),now.toLocaleString()]);
var total=0;
for (var i=0; i<files.length; i++) { var f=files[i];
var name=f.leafName;
if (co.chkFileDropTrimFilename)
{ var p=name.split('.'); if (p.length>1) p.pop(); name=p.join('.'); }
var path='file:///'+f.path.replace(/\\/g,'/');
var size=f.fileSize; total+=size;
var when=new Date(f.lastModifiedTime).formatString('YYYY.0MM.0DD 0hh:0mm:0ss');
text+=item.format([name,path,size,when]);
}
text+=footer.format([total,files.length]);
var newtags=co.txtFileDropTags?co.txtFileDropTags.readBracketedList():[];
store.saveTiddler(null,title,text,co.txtUserName,now,newtags);
if (co.chkFileDropDisplay) story.displayTiddler(null,title);
return true;
}
}
if (files.length>1) store.suspendNotifications();
for (i=0; i<files.length; i++) {
var file=files[i];
if (file.isDirectory()) continue; // skip over nested directories
var type='text/plain';
var title=file.leafName; // tiddler name is file name
if (co.chkFileDropTrimFilename)
{ var p=title.split('.'); if (p.length>1) p.pop(); title=p.join('.'); }
var name=file.leafName;
var path=file.path;
var url='file:///'+path.replace(/\\/g,'/');
var size=file.fileSize;
var when=new Date(file.lastModifiedTime);
var now=new Date();
var who=config.options.txtUserName;
var h=document.location.href;
var cwd=getLocalPath(decodeURIComponent(h.substr(0,h.lastIndexOf('/')+1)));
var relpath=path.startsWith(cwd)?'./'+path.substr(cwd.length):path;
while (title && title.length && store.tiddlerExists(title)) {
if (confirm(config.messages.overwriteWarning.format([title]))) break;
title=prompt('Enter a new tiddler title',path.replace(/\\/g,'/'));
}
if (!title || !title.length) continue; // cancelled
if (config.macros.attach) {
type=config.macros.attach.getMIMEType(name,'');
if (!type.length)
type=prompt('Unknown file type. Enter a MIME type','text/plain');
if (!type||!type.length) continue; // cancelled
}
var newtags=co.txtFileDropTags?co.txtFileDropTags.readBracketedList():[];
if (type=='text/plain' || !co.chkFileDropContent) {
var txt=''; var fmt=co.txtFileDropLinkFormat.unescapeLineBreaks();
if (co.chkFileDropLink) txt+=fmt.format([name,url,path,relpath,size,when,now,who]);
if (co.chkFileDropContent) {
var out=loadFile(path); var lim=co.txtFileDropDataLimit;
txt+=co.txtFileDropDataLimit?out.substr(0,lim):out;
if (size>lim) txt+='\n----\nfilesize ('+size+')'
+' is larger than FileDrop limit ('+lim+')...\n'
+'additional content has been omitted';
}
store.saveTiddler(null,title,txt,co.txtUserName,now,newtags);
} else {
var embed=co.chkFileDropContent
&& (!co.txtFileDropDataLimit||size<co.txtFileDropDataLimit);
newtags.push('attachment'); newtags.push('excludeMissing');
config.macros.attach.createAttachmentTiddler(path,
now.formatString(config.macros.timeline.dateFormat),
'attached by FileDropPlugin', newtags, title,
embed, co.chkFileDropAttachLocalLink, false,
relpath, '', type,!co.chkFileDropDisplay);
}
if (co.chkFileDropDisplay) story.displayTiddler(null,title);
}
if (files.length>1) { store.resumeNotifications(); store.notifyAll(); }
return true;
})
//}}}
[[GettingStarted]]
[[tiddlydesktopElements]]
[[stickyElements]]
[[the desktop in tiddlyspace]]
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>>
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2009.04.11 [1.9.5] pass current tiddler object into wrapper code so it can be referenced from within 'onclick' scripts
2009.02.26 [1.9.4] in $(), handle leading '#' on ID for compatibility with JQuery syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 5, date: new Date(2009,4,11)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?(?: key=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var src=lookaheadMatch[1];
var label=lookaheadMatch[2];
var tip=lookaheadMatch[3];
var key=lookaheadMatch[4];
var show=lookaheadMatch[5];
var code=lookaheadMatch[6];
if (src) { // external script library
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // inline code
if (show) // display source in tiddler
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create 'onclick' command link
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place,tiddler){"+fixup+"\n};_out(this,this.tiddler);"
link.tiddler=w.tiddler;
link.onclick=function(){
this.bufferedHTML="";
try{ var r=eval(this.code);
if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
if(this.bufferedHTML.length)
s.innerHTML=this.bufferedHTML;
if((typeof(r)==="string")&&r.length) {
wikify(r,s,null,this.tiddler);
return false;
} else return r!==undefined?r:false;
} catch(e){alert(e.description||e.toString());return false;}
};
link.setAttribute("title",tip||"");
var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
link.setAttribute("href",URIcode);
link.style.cursor="pointer";
if (key) link.accessKey=key.substr(0,1); // single character only
}
else { // run script immediately
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var c="function _out(place,tiddler){"+fixup+"\n};_out(w.output,w.tiddler);";
try { var out=eval(c); }
catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
if(limit > 0) text = text.substr(0,limit);
var wikifier = new Wikifier(text,formatter,null,tiddler);
return wikifier.wikifyPlain();
}
//}}}
// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
//{{{
config.macros.inlineSearch = {
handler : function(place,macroName,params,wikifier,paramString,tiddler) {
var formElement = document.createElement("form");
var aleaQueryId = "Q"+Math.random().toString().substr(3,5);
var aleaTargetId = "T"+Math.random().toString().substr(3,5);
formElement.setAttribute("action","javascript:config.macros.inlineSearch.displayResult('"+aleaQueryId+"','"+aleaTargetId+"')");
var queryField = document.createElement("input");
queryField.setAttribute("type","text");
queryField.setAttribute("id",aleaQueryId);
formElement.appendChild(queryField);
place.appendChild(formElement);
var targetElement=createTiddlyElement(null,"div",null,"searchResults");
targetElement.setAttribute("id",aleaTargetId);
place.appendChild(targetElement);
},
displayResult:function(inputId,resultId) {
var queryElement = document.getElementById(inputId);
var targetElement = document.getElementById(resultId);
if (targetElement) {
removeChildren(targetElement);
if (queryElement&&queryElement.value) {
var list=createTiddlyElement(targetElement,"ul");
var titles=store.search(new RegExp(queryElement.value,"mgi"));
for(var cpt=0;cpt<titles.length;cpt++) createTiddlyLink(createTiddlyElement(list,"li",null,"listLink"), titles[cpt].title, titles[cpt].title);
}
}
}
}
//}}}
|Name|KladBlok|
|Author|JonnyLeRoy, Mitchke|
|Description|depending on tiddlyDesktopBundle plugins|
|Source||
|PageTemplate|##PageTemplate|
|ViewTemplate|##ViewTemplate|
|EditTemplate|##EditTemplate|
|StyleSheet|##StyleSheet|
!PageTemplate
<!--{{{-->
<!--<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 style="position:fixed;z-index:1001;bottom:.3em;right:.3em;cursor:pointer;font-size:9pt;">
<a href="javascript:window.scrollTo(0,0)" title="scroll to top of page">▲</a>
</div>
<!--}}}-->
!ViewTemplate
<!--{{{-->
<div class='windowBar'>
<span class='windowToolbar' macro='toolbar jump collapseTiddler -closeTiddler'></span>
<span class='title' macro='view title'></span>
</div>
<div class='collapsible'>
<div class='toolbar' macro='toolbar +editTiddler permalink references closeOthers'></div>
<div class='scrollable'>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
</div>
<div class='subtitle'>
<span macro='view modified date [[DD/MM/YYYY]]'></span>
(created: <span macro='view created date [[DD/MM/YYYY]]'></span>)
</div>
<div class='tagClear'></div>
<div macro='sizer' class='sizer'></div>
</div>
<!--}}}-->
!ViewToolbar
!EditTemplate
<!--{{{-->
<div class='windowBar'>
<span class='windowToolbar' macro='toolbar jump collapseTiddler closeTiddler'></span>
<span class='title' macro='view title'></span>
</div>
<div class='collapsible'>
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='editor' macro='edit title'></div>
<div class="label">Thema</div>
<div class='editor' macro="edit theme"></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>
</div>
<div macro='sizer' class='sizer'></div>
<!--}}}-->
!EditToolbar
!StyleSheet
[[StyleSheet]]
[[KladBlok##tiddlyDesktopStyle]]
!tiddlyDesktopStyle
/*{{{*/
/* by JonnyLeRoy http://www.digitaldimsum.co.uk/tiddlywiki/ */
BODY{background-color:#E6E3DC; background-image: url(data:image/gif;base64,R0lGODlhBAAEAIABAOHo7v///yH5BAEAAAEALAAAAAAEAAQAAAIEjI8JBQA7
); width:100%; height:100%;}
.collapsible{margin:4px}
.scrollable{margin:4px;overflow:auto}
.fit{overflow:visible}
.windowBar{color:[[ColorPalette::Background]];background:[[ColorPalette::PrimaryMid]]; cursor:move;padding:2px 2px 2px 4px}
.windowBar .title{color:[[ColorPalette::TertiaryLight]];font-size:1em;cursor:move}
.selected .windowBar .title{color:[[ColorPalette::Background]]}
.tiddler{position:relative;z-index:700;width:420px;border:solid 1px;border-color: [[ColorPalette::TertiaryMid]];background:#f8f8f8;padding:0px; }
.tiddler .selected{background:[[ColorPalette::Background]]}
.viewer p{margin:0}
.tagged{float:left !important}
.tagged li{display:inline}
.viewer{background:transparent}
.windowToolbar{text-align:right;float:right}
.collapsible .toolbar{text-align:right;margin-top:4px;border:0}
.sizer{text-align:right; background:[[ColorPalette::TertiaryLight]]}
.sizer .toolbar a{border:0}
.sizer .resizer{cursor: nw-resize;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbRJREFUOMudkk9rU0EUxX933ryg5Jsobm03bW3SSvsJrKv2MxUX6kYXCiKouBUX0o1umiYGTWigrVa0oGAguMh7M3NcvJgi1D/pwIW5A/dwfneOSeI8Z/vFqlICf57hWy9X1PvylhBsdoE7O031T7rTfiaBe68bGnztkOeGmaFZBB60lnXwvYPPDTPAhPSfCI+6SzoatvG5gTnMQDJSJty/hp/0FnU82sPXhM/h83GN9cUmmReZ198dPNtf0Kcfe/jccMEwia2bi0jgDMzA/pSD54MlfRztTuxCiEYojLKsqhg7xoU7G+Fp/5qOhrs4B5kX3XaductrmIODwUUac9fBwDgD4XF3WR9GLfLcSEkIY2ujsi3B5sYCiKqw3xEetho6HLbIa8JnCZepQsCIYYJROsrCKAujGNspwv03TfVO2sRkxBJ67+pcvbROCI73nTrzV9aIwTgcXKA5v0qMRpKrEO7uNLX/rUPuwaqUsHmjsl0Wv+4ilKfvMUIMYLdfrah/0q5ynQvvReYTLoNskjgEKVnlLhghQJj8ho/RCNGme5AgyeGiiAaYTReYJgIxGiEYMcJPouzs1zCI2FsAAAAASUVORK5CYII=);position:absolute; bottom: 0; right: 0; height:16px;width:16px;}
.tiddler .windowBar .button{color:[[ColorPalette::PrimaryMid]];background:[[ColorPalette::Background]];margin-right:2px;padding:0em 0.4em;border:solid 1px [[ColorPalette::TertiaryLight]]}
.tiddler .windowBar .button:hover{background:[[ColorPalette::PrimaryPale]];border-color:[[ColorPalette::PrimaryMid]]}
.subtitle{font-size:.9em;text-align:right;float:right;padding-top:1.2em}
.popup {z-index:3000}
.editor textarea, .editor input{
width:99%
}
#backstageButton {
z-index:901;
}
#backstage {
z-index:900;
}
#backstageArea {
z-index:899;
}
#backstageCloak {
z-index:850;
}
/*}}}*/
/***
|Name|ListboxPlugin|
|Source|http://www.TiddlyTools.com/#ListboxPlugin|
|Documentation|http://www.TiddlyTools.com/#ListboxPluginInfo|
|Version|1.4.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|set custom field or tiddler tags by selecting from listbox/droplist|
The {{{<<select>>}}} macro allows you to set tiddler field values by selecting pre-configured values from a listbox/droplist control.
!!!!!Documentation
>see [[ListboxPluginInfo]]
!!!!!Revisions
<<<
2010.03.14 1.4.1 use filterTiddlers() instead of getTaggedTiddlers() - use MatchTagsPlugin for tag expressions
|please see [[ListboxPluginInfo]] for additional revision details|
2007.05.12 0.5.0 started
<<<
!!!!!Code
***/
//{{{
version.extensions.ListboxPlugin= {major: 1, minor: 4, revision: 1, date: new Date(2010,3,14)};
config.macros.select = {
tooltip: "select a value for %0@%1",
blankTooltip: "set %0@%1=[no value]",
valueTooltip: "set %0@%1=%2",
otherLabel: "other",
otherTooltip: "set %0@%1=[enter a value...]",
otherPrompt: "enter a value for '%0'",
editLabel: "edit list...",
editTooltip: "edit '%0' list definition (%1)",
changeMsg: "setting %0@%1=%2",
verbose: false,
hereKeyword: "here",
defaultTarget: "SiteFields",
handler:
function(place,macroName,params,wikifier,paramString,tiddler) {
// default to containing tiddler or "SiteFields" catch-all
var here=story.findContainingTiddler(place);
var targetID=here?here.getAttribute("tiddler"):this.defaultTarget;
// get field name and non-default target (if any)
var field=params.shift();
var pos=field.indexOf("@"); // if non-default target ("field@tiddler" syntax)
if(pos!=-1) { // split field into field and tiddlername.
if (field.substr(pos+1)!=this.hereKeyword) // "here" == use default target
targetID=field.substr(pos+1); // use different target tiddler
field=field.substr(0,pos);
}
if(!field || !field.length) return; // no field name... do nothing
if (field.substr(0,1)=="=") targetID="(system)"; // internal option value
var items=[]; var listsrc='';
var autosave=false; var allowBlank=false; var allowOther=false; var allowEdit=false;
var allowMultiple=false; var wikifyData=false; var rows=0; var width='';
var p=params.shift();
while (p) {
if (p.toLowerCase()=='autosave') // autosave on change
autosave=true;
else if (p.toLowerCase()=='allowblank') // add empty item
var allowBlank=true;
else if (p.toLowerCase()=='allowother') // add "other: ____" item
var allowOther=true;
else if (p.toLowerCase()=='allowedit') // add "edit list..." item
var allowEdit=true;
else if (p.toLowerCase()=='allowmultiple') // multi-select
var allowMultiple=true;
else if (p.startsWith('rows:')) // 0=autosize listbox, 1=droplist, n=listbox
var rows=p.substr(5);
else if (p.startsWith('width:')) // CSS width of list
var width=p.substr(6);
else if (p.startsWith('prompt:')) // prompt text (1st item in list)
var ptext=p.substr(7);
else if (p.substr(0,1)=="+"||p.substr(0,1)=="*") { // read HR-separated tiddler
var listsrc=p.substr(1);
var listtxt=store.getTiddlerText(listsrc,'');
var wikifyData=p.substr(0,1)=="*";
if (listtxt.length && wikifyData) // wikify source to handle macros/scripts
listtxt=this.getWikifiedData(listtxt);
if (listtxt.length)
items=items.concat(listtxt.split(listtxt.indexOf('\n----\n')!=-1?'\n----\n':'\n'));
}
else if (p.startsWith("=")) { // get items from tagged tiddlers
var filter=p.substr(1);
if (!filter.startsWith('[')) filter='[tag['+filter+']]';
var tids=store.filterTiddlers(filter);
for (var t=0; t<tids.length; t++) items.push(tids[t].title);
}
else { // param is item value or 'label=value'
var parts=p.split("=");
var label=parts[0]; var v=parts[1]?parts[1]:parts[0];
items.push(label+"="+v);
}
p=params.shift();
}
if (rows==1) allowMultiple=false; // droplist cannot do multi-select
if (tiddler && !story.isDirty(tiddler.title)) autosave=true; // tiddler is in VIEW mode, force autosave
this.render(createTiddlyElement(place,"span"), null,
targetID, field, ptext, items, listsrc, wikifyData,
rows, width, autosave, allowBlank, allowOther, allowEdit, allowMultiple);
store.addNotification(null,this.refresh); // syncs lists when tiddlers are changed
},
getWikifiedData: // wikify tiddler content, then extract text WITH newlines and HRs included
function(txt) {
var e=createTiddlyElement(document.body,"div"); wikify(txt,e);
var breaks=e.getElementsByTagName("br");
for (var b=0; b<breaks.length; b++) breaks[b].parentNode.insertBefore(document.createTextNode("\n"),breaks[b]);
var lines=e.getElementsByTagName("hr");
for (var l=0; l<lines.length; l++) lines[l].parentNode.insertBefore(document.createTextNode("----\n"),lines[l]);
var items=e.getElementsByTagName("li");
for (var i=0; i<items.length; i++) items[i].parentNode.insertBefore(document.createTextNode("\n"),items[i]);
var txt=getPlainText(e); removeNode(e); return txt;
},
refresh:
function (title) { // re-render dependent lists
var lists=document.getElementsByTagName('select');
for (var i=0; i<lists.length; i++) { var list=lists[i];
if (list.getAttribute('listsrc')!=title) continue; // no sync needed
var listtxt=store.getTiddlerText(list.getAttribute('listsrc')||'','');
if (listtxt.length && list.getAttribute("wikifyData")=="true")
listtxt=this.getWikifiedData(listtxt);
if (listtxt.length)
var items=listtxt.split(listtxt.indexOf('\n----\n')!=-1?'\n----\n':'\n');
config.macros.select.render(list.parentNode, list,
list.getAttribute('tiddler'),
list.getAttribute('edit'),
list.getAttribute('ptext'),
items||[],
list.getAttribute('listsrc'),
list.getAttribute("wikifyData")=="true",
list.getAttribute("rows"),
list.getAttribute("width"),
list.getAttribute("autosave")=="true",
list.getAttribute("allowBlank")=="true",
list.getAttribute("allowOther")=="true",
list.getAttribute("allowEdit")=="true",
list.getAttribute("allowMultiple")=="true");
}
},
render:
function (place, here, targetID, field, ptext, items, listsrc, wikifyData,
rows, width, autosave, allowBlank, allowOther, allowEdit, allowMultiple) {
var values=[]; var opts=[];
// use current selection(s) (if any) (except for "edit list..." item)
if (here) for (var i=0; i<here.options.length; i++) {
var opt=here.options[i];
if (opt.selected && opt.text!=config.macros.select.editLabel) values.push(opt.value);
}
// no listbox or no selections... get value(s) from field (if any)
if (!values.length) {
var v=(field.substr(0,1)=='=')?config.options[field.substr(1)]:store.getValue(targetID,field);
if (v) values=(field=='tags'||allowMultiple)?v.readBracketedList():[v];
}
// add prompt item
if (ptext&&ptext.length)
opts.push('<option value="_ptext" title="">'+ptext+'</option>');
// add 'no value' item
if ((!allowMultiple && !values.length) || allowBlank)
opts.push('<option value="" title="'+this.blankTooltip.format([field,targetID])+'"></option>');
// add enumerated items
var isOther=values.length; // assume no matching value
for (var opt=0; opt<items.length; opt++) {
var lines=items[opt].split("\n"); var parts=lines[0].split("=");
var label=parts[0];
var v=parts[1]?parts[1]:parts[0];
var title=lines[1]?lines[1]:this.valueTooltip.format([field,targetID,v]);
var sel=values.contains(v); if (sel) isOther=false; // found matching value
opts.push('<option value="'+v+'" '+(sel?'selected':'')+' title="'+title+'">'+label+'</option>');
}
// add 'other...'
if (field=='tags') isOther=false;
if (isOther||allowOther) {
var label="other"+(isOther?(": "+values[0]):"...");
var v=isOther?values[0]:'';
var t=this.otherTooltip.format([field,targetID]);
opts.push('<option value="'+v+'" '+(isOther?'selected':'')+' title="'+t+'">'+label+'</option>');
}
// add 'edit list...'
if (listsrc && (!store.getTiddlerText(listsrc) || allowEdit)) {
var title=this.editTooltip.format([field,listsrc]);
opts.push('<option value="'+listsrc+'" title="'+title+'">'+this.editLabel+'</option>');
}
// render listbox
var html='<select '+(values[0]?'value="'+values[0]+'" ':' ')
+' title="'+this.tooltip.format([field,targetID])+'"'
+' rows="'+rows+'"'+' size="'+(rows!=0?rows:opts.length)+'"'+' style="width:'+width+'"'
+' tiddler="'+targetID+'"'+' edit="'+field+'"'+' ptext="'+ptext+'"'
+' listsrc="'+listsrc+'"'+' wikifyData="'+wikifyData+'"'
+' autosave="'+autosave+'"'+' allowBlank="'+allowBlank+'"'+' allowOther="'+allowOther+'"'
+' allowEdit="'+allowEdit+'"'+' allowMultiple="'+allowMultiple+'"'+(allowMultiple?' multiple':'')
+' onclick="return config.macros.select.onClick(this,event)"'
+' onchange="return config.macros.select.onChange(this,event)"'
+' ondblclick="return false">'+opts.join('')+'</select>';
place.innerHTML=html;
},
onClick:
function(here,event) {
var sel=here.selectedIndex;
if (sel!=-1 && here.options[sel].text.startsWith(config.macros.select.otherLabel))
here.onchange.apply(here,arguments);
},
onChange:
function(here,event) {
var cms=config.macros.select; // abbrev
var sel=here.selectedIndex;
if (sel!=-1) {
if (here.options[sel].text==cms.editLabel) {
story.displayTiddler(story.findContainingTiddler(here),here.value,DEFAULT_EDIT_TEMPLATE);
return false;
}
if (here.options[sel].text.startsWith(cms.otherLabel)) {
var newval=prompt(cms.otherPrompt.format([here.getAttribute("edit")]),here.value);
if (!newval) {// user cancelled
var v=store.getValue(here.getAttribute("tiddler"),here.getAttribute("edit"));
{ here.value=v; if (v==undefined) here.selectedIndex=0; return false; }
};
here.options[sel].value=newval;
here.options[sel].text=cms.otherLabel+": "+newval;
here.value=newval;
}
if (here.options[sel].value=='_ptext')
for (var i=0; i<here.options.length; i++)
here.options[i].selected=false;
}
if (here.getAttribute("autosave")=="true") config.macros.select.setFieldValue(here);
return false;
},
setFieldValue: function(here) {
var tid=here.getAttribute("tiddler"); if (!tid || !tid.length) return; // no target, do nothing
var field=here.getAttribute("edit");
if (field.substr(0,1)=='=') { // option cookie instead of tiddler field
config.macros.option.propagateOption(field.substr(1),"value",here.value,"input");
return;
}
// ensure tiddler exists
if (!store.tiddlerExists(tid)) store.saveTiddler(tid,tid,"",config.options.txtUserName,new Date(),[]);
if (field=='tags') {
store.suspendNotifications();
for (var i=0; i<here.options.length; i++) {
var opt=here.options[i];
if (opt.text==config.macros.select.editLabel) continue;
store.setTiddlerTag(tid,opt.selected,opt.value);
}
store.resumeNotifications();
} else {
// get multi-select items
var values=[];
for (var i=0; i<here.options.length; i++) {
var opt=here.options[i];
if (opt.text==config.macros.select.editLabel) continue;
if (opt.selected) values.pushUnique(String.encodeTiddlyLink(opt.value));
}
if (values.length==1) values=[here.value]; // remove unneeded brackets around single value
store.setValue(tid,field,values.length?values.join(' '):null); // if no selections, delete field
}
// 'touch' tiddler and report to user
var t=store.getTiddler(tid);
var who=config.options.chkForceMinorUpdate?t.modifier:config.options.txtUserName;
var when=config.options.chkForceMinorUpdate?t.modified:new Date();
store.saveTiddler(tid,tid,t.body,who,when,t.tags,t.fields);
if (config.macros.select.verbose)
{ clearMessage(); displayMessage(config.macros.select.changeMsg.format([field,tid,here.value])); }
}
}
//}}}
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
major: 1, minor: 1, revision: 0,
date: new Date("mar 17, 2007"),
source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};
if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};
bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){
url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
}
return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
<<newTiddler label:"tiddler">>
<<newJournal label:"journal" "DD MMM YYYY" "journal">>
{{span{<<tiddler {{if (readOnly) place.style.display='none';'';}}
>><<newSticky StickyNote>>}}}
<script> if (readOnly) return "<<tiddler [[MakeAnew##toggleReadonly]]>>";</script>/%
!toggleReadonly
<script label="try it out" title="lets you play around with StickyDesktop even if you are not allowed to save">if(window.version&&window.version.title=='TiddlyWiki')
{readOnly=false;if(window.backstage){if(!backstage.button)backstage.init();backstage.show();}config.options.chkAnimate=false;refreshDisplay();}</script>
<<tiddler RefreshPageDisplay with: refresh "if you click refresh you will get the buttons needed to create a new stickynote, a tiddler or a journal">>
!end
%/
//{{{
/*
* adapted from newslidemacro by psd
* http://tiddlyslidy.com/
*/
config.macros.newSticky = {};
config.macros.newSticky.handler = function(place, macroName, params, wikifier, paramString, tiddler) {
var theme = params[0];
var title = "New Sticky";
var tip = "Create a new " + theme;
var tag = params[1] || "sticky";
return createTiddlyButton(place, theme, tip, function () {
var template = theme + "##EditTemplate";
var tags = [tag];
var customFields = {
'theme': theme
};
var tiddler = store.createTiddler(title);
merge(tiddler.fields, customFields);
merge(tiddler.tags, tags);
story.displayTiddler(null, title, template, false, null, null, false, place);
story.focusTiddler(title,'title');
return false;
},
null,
null,
null);
};
//}}}
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
major: 1, minor: 0, revision: 2,
date: new Date("Apr 19, 2007"),
source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
coreVersion: '2.2.0 (Beta 5)'
};
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");
merge(config.macros.option.types, {
'pas': {
elementType: "input",
valueField: "value",
eventName: "onkeyup",
className: "pasOptionInput",
typeValue: config.macros.option.passwordInputType,
create: function(place,type,opt,className,desc) {
// password field
config.macros.option.genericCreate(place,'pas',opt,className,desc);
// checkbox linked with this password "save this password on this computer"
config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);
// text savePasswordCheckboxLabel
place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
},
onChange: config.macros.option.genericOnChange
}
});
merge(config.optionHandlers['chk'], {
get: function(name) {
// is there an option linked with this chk ?
var opt = name.substr(3);
if (config.options[opt])
saveOptionCookie(opt);
return config.options[name] ? "true" : "false";
}
});
merge(config.optionHandlers, {
'pas': {
get: function(name) {
if (config.options["chk"+name]) {
return encodeCookie(config.options[name].toString());
} else {
return "";
}
},
set: function(name,value) {config.options[name] = decodeCookie(value);}
}
});
// need to reload options to load passwordOptions
loadOptionsCookie();
/*
if (!config.options['pasPassword'])
config.options['pasPassword'] = '';
merge(config.optionsDesc,{
pasPassword: "Test password"
});
*/
//}}}
/***
|Name:|QuickOpenTagPlugin|
|Description:|Changes tag links to make it easier to open tags as tiddlers|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#QuickOpenTagPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
config.quickOpenTag = {
dropdownChar: (document.all ? "\u25bc" : "\u25be"), // the little one doesn't work in IE?
createTagButton: function(place,tag,excludeTiddler) {
// little hack so we can do this: <<tag PrettyTagName|RealTagName>>
var splitTag = tag.split("|");
var pretty = tag;
if (splitTag.length == 2) {
tag = splitTag[1];
pretty = splitTag[0];
}
var sp = createTiddlyElement(place,"span",null,"quickopentag");
createTiddlyText(createTiddlyLink(sp,tag,false),pretty);
var theTag = createTiddlyButton(sp,config.quickOpenTag.dropdownChar,
config.views.wikified.tag.tooltip.format([tag]),onClickTag);
theTag.setAttribute("tag",tag);
if (excludeTiddler)
theTag.setAttribute("tiddler",excludeTiddler);
return(theTag);
},
miniTagHandler: function(place,macroName,params,wikifier,paramString,tiddler) {
var tagged = store.getTaggedTiddlers(tiddler.title);
if (tagged.length > 0) {
var theTag = createTiddlyButton(place,config.quickOpenTag.dropdownChar,
config.views.wikified.tag.tooltip.format([tiddler.title]),onClickTag);
theTag.setAttribute("tag",tiddler.title);
theTag.className = "miniTag";
}
},
allTagsHandler: function(place,macroName,params) {
var tags = store.getTags(params[0]);
var filter = params[1]; // new feature
var ul = createTiddlyElement(place,"ul");
if(tags.length == 0)
createTiddlyElement(ul,"li",null,"listTitle",this.noTags);
for(var t=0; t<tags.length; t++) {
var title = tags[t][0];
if (!filter || (title.match(new RegExp('^'+filter)))) {
var info = getTiddlyLinkInfo(title);
var theListItem =createTiddlyElement(ul,"li");
var theLink = createTiddlyLink(theListItem,tags[t][0],true);
var theCount = " (" + tags[t][1] + ")";
theLink.appendChild(document.createTextNode(theCount));
var theDropDownBtn = createTiddlyButton(theListItem," " +
config.quickOpenTag.dropdownChar,this.tooltip.format([tags[t][0]]),onClickTag);
theDropDownBtn.setAttribute("tag",tags[t][0]);
}
}
},
// todo fix these up a bit
styles: [
"/*{{{*/",
"/* created by QuickOpenTagPlugin */",
".tagglyTagged .quickopentag, .tagged .quickopentag ",
" { margin-right:1.2em; border:1px solid #eee; padding:2px; padding-right:0px; padding-left:1px; }",
".quickopentag .tiddlyLink { padding:2px; padding-left:3px; }",
".quickopentag a.button { padding:1px; padding-left:2px; padding-right:2px;}",
"/* extra specificity to make it work right */",
"#displayArea .viewer .quickopentag a.button, ",
"#displayArea .viewer .quickopentag a.tiddyLink, ",
"#mainMenu .quickopentag a.tiddyLink, ",
"#mainMenu .quickopentag a.tiddyLink ",
" { border:0px solid black; }",
"#displayArea .viewer .quickopentag a.button, ",
"#mainMenu .quickopentag a.button ",
" { margin-left:0px; padding-left:2px; }",
"#displayArea .viewer .quickopentag a.tiddlyLink, ",
"#mainMenu .quickopentag a.tiddlyLink ",
" { margin-right:0px; padding-right:0px; padding-left:0px; margin-left:0px; }",
"a.miniTag {font-size:150%;} ",
"#mainMenu .quickopentag a.button ",
" /* looks better in right justified main menus */",
" { margin-left:0px; padding-left:2px; margin-right:0px; padding-right:0px; }",
"#topMenu .quickopentag { padding:0px; margin:0px; border:0px; }",
"#topMenu .quickopentag .tiddlyLink { padding-right:1px; margin-right:0px; }",
"#topMenu .quickopentag .button { padding-left:1px; margin-left:0px; border:0px; }",
"/*}}}*/",
""].join("\n"),
init: function() {
// we fully replace these builtins. can't hijack them easily
window.createTagButton = this.createTagButton;
config.macros.allTags.handler = this.allTagsHandler;
config.macros.miniTag = { handler: this.miniTagHandler };
config.shadowTiddlers["QuickOpenTagStyles"] = this.styles;
store.addNotification("QuickOpenTagStyles",refreshStyles);
}
}
config.quickOpenTag.init();
//}}}
/%
!info
|Name|RefreshPageDisplay|
|Source|http://www.TiddlyTools.com/#RefreshPageDisplay|
|Version|2.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|transclusion|
|Description|create a link to redraw all page elements without restarting|
Usage
<<<
{{{
<<tiddler RefreshPageDisplay>>
<<tiddler RefreshPageDisplay with: label>>
}}}
<<<
Example
<<<
{{{<<tiddler RefreshPageDisplay with: "click me">>}}}
<<tiddler RefreshPageDisplay##show with: "click me">>
<<<
!end
!show
<html><nowiki><a href="javascript:;" title="Redisplay current page content WITHOUT RESTARTING!"
onmouseover="
this.href='javascript:void(eval(decodeURIComponent(%22(function(){try{('
+encodeURIComponent(encodeURIComponent(this.onclick))
+')()}catch(e){alert(e.description?e.description:e.toString())}})()%22)))';"
onclick="
story.forEachTiddler(function(t,e){story.refreshTiddler(t,null,true)});
refreshDisplay();
return false;"
>$1</a></html>
!end
%/<<tiddler {{var src='RefreshPageDisplay'; src+(tiddler&&tiddler.title==src?'##info':'##show')}}
with: {{'$1'=='$'+'1'?'refresh page display':'$1'}}>>
<<tiddler Search>>
<<tiddler CloseAndSave>>
!make a new
<<tiddler MakeAnew>>
/***
|''Name''|SimpleSearchPlugin|
|''Description''|displays search results as a simple list of matching tiddlers|
|''Authors''|FND|
|''Version''|0.4.1|
|''Status''|stable|
|''Source''|http://devpad.tiddlyspot.com/#SimpleSearchPlugin|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Keywords''|search|
!Code
***/
//{{{
if(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.SimpleSearchPlugin = { installed: true };
if(!config.extensions) { config.extensions = {}; }
config.extensions.SimpleSearchPlugin = {
heading: "Search Results",
containerId: "searchResults",
btnCloseLabel: "close",
btnCloseTooltip: "dismiss search results",
btnCloseId: "search_close",
btnOpenLabel: "open all",
btnOpenTooltip: "open all search results",
btnOpenId: "search_open",
displayResults: function(matches, query) {
story.refreshAllTiddlers(true); // update highlighting within story tiddlers
var el = document.getElementById(this.containerId);
query = '"""' + query + '"""'; // prevent WikiLinks
if(el) {
removeChildren(el);
} else { //# fallback: use displayArea as parent
var container = document.getElementById("displayArea");
el = document.createElement("div");
el.id = this.containerId;
el = container.insertBefore(el, container.firstChild);
}
var msg = "!" + this.heading + "\n";
if(matches.length > 0) {
msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n";
this.results = [];
for(var i = 0 ; i < matches.length; i++) {
this.results.push(matches[i].title);
msg += "* [[" + matches[i].title + "]]\n";
}
} else {
msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?
}
createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.SimpleSearchPlugin.closeResults, "button", this.btnCloseId);
if(matches.length > 0) { // XXX: redundant!?
createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.SimpleSearchPlugin.openAll, "button", this.btnOpenId);
}
wikify(msg, el);
},
closeResults: function() {
var el = document.getElementById(config.extensions.SimpleSearchPlugin.containerId);
removeNode(el);
config.extensions.SimpleSearchPlugin.results = null;
highlightHack = null;
},
openAll: function(ev) {
story.displayTiddlers(null, config.extensions.SimpleSearchPlugin.results);
return false;
}
};
// override Story.search()
Story.prototype.search = function(text, useCaseSensitive, useRegExp) {
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack, null, "excludeSearch");
var q = useRegExp ? "/" : "'";
config.extensions.SimpleSearchPlugin.displayResults(matches, q + text + q);
};
// override TiddlyWiki.search() to sort by relevance
TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {
var candidates = this.reverseLookup("tags", excludeTag, !!match);
var primary = [];
var secondary = [];
var tertiary = [];
for(var t = 0; t < candidates.length; t++) {
if(candidates[t].title.search(searchRegExp) != -1) {
primary.push(candidates[t]);
} else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {
secondary.push(candidates[t]);
} else if(candidates[t].text.search(searchRegExp) != -1) {
tertiary.push(candidates[t]);
}
}
var results = primary.concat(secondary).concat(tertiary);
if(sortField) {
results.sort(function(a, b) {
return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);
});
}
return results;
};
} //# end of "install only once"
//}}}
|''ViewTemplate''|##ViewTemplate|
|''EditTemplate''|##EditTemplate|
|''StyleSheet''|##StyleSheet|
!ViewTemplate
<!--{{{-->
<div class='windowBar'>
<span class='windowToolbar' macro='toolbar collapseTiddler +editTiddler -closeTiddler'></span>
<span class='title' macro='view title'></span>
<span macro='addClass'></span>
</div>
<div class='collapsible'
<div class='scrollable'>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
</div>
<div macro='sizer' class='sizer'></div>
<!--<span macro='tiddler backgroundColors' style='display:none'></span>-->
</div>
<!--}}}-->
!EditTemplate
<!--{{{-->
<div class='windowBar'>
<span class='windowToolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></span>
<span class='title' macro='view title'></span>
</div>
<div class='collapsible'>
<div class='editor' macro='edit title'></div>
<div class="label">Thema</div>
<div class='editor' macro="edit theme"></div>
Kleur: <div class='editor' macro='select classname rows:1 yellow green blue pink'></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>
<div class='tagClear'></div>
<div macro='sizer' class='sizer'></div>
</div>
<!--}}}-->
!StyleSheet
/*{{{*/
.tiddler.green{
background-color:#E1FAA0;
}
.tiddler.blue{
background-color:#BEDCFA;
}
.tiddler.pink{
background-color:#FFA5C8;
}
.tiddler.yellow{
background-color:##FAFAAA;
}
.StickyNote{
background:#FAFAAA url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAAEeCAYAAABcyXrWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB5BJREFUeNrt1LuqXWUYRuHd2FiksUhhI2ghWKRQCCgIgiBYiCgGEUQCigkxgRDxLIrGs17zdhWrmPysbM0uxjeLpxg38PLynJ2fn/9zyf5+jP76j/58jP440e9Lv53o1//RL0sPj/38iH5a+vGCflj6ftN3S99u+ubQ15u+Wvpy0xdLn296sHR/071Nd5c+O3bn0O2lW8c+PfTJpo+Xbm76aNOHSx9sen/pxqH3jr176J1Nb296a+nNpTc2vb702tKrm1459vKx60svbXrx0LWlF070/NJzx57d9MzS0ye6eqKnHtGVEz15QU9c0NllO4MOdKADnRKdy8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzq7hQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdHYFD3SgAx3opPBABzrQgU4KD3SgAx3opPBABzrQgU4KD3SgAx3opPBABzrQgU4KD3SgAx3opPBABzrQgc5u4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnXF4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EBnFB7oQAc60EnhgQ50oAOdFB7oQAc60EnhgQ50oAOdcXigAx3oQCeFBzrQgQ50UnigAx3oQCeFBzrQgQ50UnigAx3oQGd38EAHOtCBTgoPdKADHeik8EAHOtCBTgoPdKADHeik8EAHOtCBTgoPdKADHeik8EAHOtCBTgoPdKADHeik8EAHOtCBzig80IEOdKCTwgMd6EAHOik80IEOdKCTwgMd6EAHOiPwQAc60IFOCg90oAMd6OwCHuhABzpK4YEOdKCjFB7oQAc6SuGBDnSgoxQe6EAHOkrhgQ50oKNReKADHegohQc60IGOUnigAx3oKIUHOtCBjnYDD3SgAx2l8EAHOtBRCg90oAMdpfBABzrQUQoPdKADHaXwQAc60FEKD3SgAx2NwgMd6EBHKTzQgQ50lMIDHehARyk80IEOdDQGD3SgAx2l8EAHOtBRCg90oAMdjcIDHehARyk80IEOdJTCAx3oQEcpPNCBDnQ0Bg90oAMdpfBABzrQUQoPdKADHeXwQAc60NEYPNCBDnSUwgMd6EBHKTzQgQ50NAoPdKADHaXwQAc60FEKD3SgAx2l8EAHOtDRGDzQgQ50lMIDHehARyk80IEOdDQKD3SgAx2l8EAHOtBRCg90oAMdpfBABzrQ0Rg80IEOdJTCAx3oQEcpPNCBDnQ0Cg90oAMdpfBABzrQUQoPdKADHaXwQAc60NEYPNCBDnSUwgMd6EBHKTzQgQ50NAYPdKADHaXwQAc60FEKD3SgAx2NwgMd6EBHKTzQgQ50lMIDHehARyk80IEOdDQCD3SgAx2l8EAHOtBRDg90oAMdjcIDHehIKTzQgY6UwgMd6EgpPNCBjjQCD3SgI6XwQAc6Ug4PdKAjjcEDHehIKTzQgY6UwgMd6Eij8EAHOlIKD3SgI6XwQAc6UgoPdKAjjcEDHehIKTzQgY6UwgMd6Ehj8EAHOlIKD3SgI6XwQAc60ig80IGOlMIDHehIKTzQgY6UwgMd6Ehj8EAHOlIKD3SgI6XwQAc60ig80IGOlMIDHehIKTzQgY6UwgMd6Eg5PNCBjjQCD3SgI6XwQAc6Ug4PdKAjjcEDHehIKTzQgY6UwgMd6Ehj8EAHOlIKD3SgI6XwQAc60ig80IGOlMIDHehIKTzQgY6UwgMd6Eij8EAHOlIKD3SgI6XwQAc6UgoPdKAjjcEDHehIKTzQgY6UwgMd6Eij8EAHOlIKD3SgI6XwQAc6UgoPdKAjjcIDHehIKTzQgY6UwgMd6EgpPNCBjjQGD3SgI6XwQAc6UgoPdKAjjcADHehIKTzQgY40Ag90nEFK4YGOI0ij8EBHUgoPdCSl8EBHUgoPdCSNwQMdSSk80JGUwgMdSTk80JE0Cg90JKXwQEdSCg90JKXwQEfSODzQkZTCAx1JKTzQkZTCAx1JKTzQkTQKD3QkpfBAR1IKD3QkpfBAR9IIPNCRlMIDHUlj8EBHUgoPdCSl8EBH0ig80JGUwgMdSSk80JGUwgMdSePwQEdSCg90JKXwQEdSCg90JKXwQEfSODzQkZTCAx1JKTzQkZTCAx1JKTzQkbQLeKAjKYUHOpJSeKAjKYUHOpJSeKAjKYUHOpLG4YGOpBQe6EhK4YGOpBQe6EhK4YGOpN3AAx1JKTzQkZTCAx1JKTzQkZTCAx1JKTzQkZTCAx1Ju4HHQJJSeIwjKYXHMJJSeIwiKYXHIJJSeIwhKYVHksAjCTySBB5J4JEk8EgCjySBRxJ4JIFHksAjCTySBB5J4JEk8EjaWf8CWg1fVAtLPwwAAAAASUVORK5CYII=") no-repeat;
min-height:150px;
width:180px;
border-color:#5A9119 !important;
-moz-box-shadow:5px 5px 7px rgba(33,33,33,1);
-webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7);
box-shadow: 5px 5px 7px rgba(33,33,33,.7)
}
.StickyNote .windowBar{
background-color:transparent;
height:auto;
color:#8AC50D;
}
.StickyNote .windowBar .title {
color:#5A9119;
font-size:1.5em;
}
.StickyNote .selected{
color:#8AC50D;
}
.StickyNote .windowBar .button {
background-color:transparent;
border: 1px solid #5A9119;
color: #5A9119;
}
.StickyNote .windowBar .button:hover {
background-color:#C3F255;
border:1px solid #5A9119;
}
/*these display:none rules make sure the tiddler is still editable by dubbelclicking on it, and moveable after editing it*/
.StickyNote .windowBar .button.command_collapseTiddler{
display:none;
}
.StickyNote .windowBar .button.command_editTiddler.defaultCommand{
display:none;
}
.StickyNote a {
color:#5A9119;
}
.StickyNote a:hover{
color:#C3F255;
background-color:transparent;
}
.StickyNote .viewer {
padding:1em;
}
.StickyNote .viewer .button {
border:1px solid #5A9119;
}
.StickyNote .viewer .button:hover{
background:transparent;
border:1px solid #5A9119;
}
/*}}}*/
config.options.chkInsertTabs = true;
config.options.txtTheme="KladBlok";
/***
|''Name:''|ThemedTiddlerPlugin |
|''Description:''|Per-Tiddler Mini-Themes |
|''Author:''|PaulDowney (psd (at) osmosoft (dot) com) |
|''Source:''|http://whatfettle.com/2008/07/ThemedTiddlerPlugin/ |
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/ThemedTiddlerPlugin/ |
|''Version:''|0.1|
|''License:''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''~CoreVersion:''|2.4|
!!Documentation
The extended field "theme" is used to reference a tiddler containing a "mini-theme"
A mini-theme is a tiddler containing a [[ViewTemplate]], [[EditTemplate]] and [[StyleSheet]] sections which are applied when the tiddler is displayed.
In addition, a CSS class of the theme name is added to the tiddler which may be useful when writing a mini-theme [[StyleSheet]].
!!Code
***/
//{{{
/*jslint onevar: false nomen: false plusplus: false */
/*global Story, store, setStylesheet, addClass */
if (!version.extensions.ThemedTiddlerPlugin) {
version.extensions.ThemedTiddlerPlugin = {installed: true};
Story.prototype.__chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler;
Story.prototype.chooseTemplateForTiddler = function (title, n)
{
// translate number into template name
var template = ["ViewTemplate", "EditTemplate"][n ? n - 1 : 0];
var tiddler = store.getTiddler(title);
if (tiddler) {
var theme = tiddler.fields.theme;
if (theme) {
// assert stylesheet
var style = store.getTiddlerText(theme + '##StyleSheet');
if (style) {
setStylesheet(style, theme);
}
// return theme template
var slice = theme + '##' + template;
if (store.getTiddlerText(slice)) {
return slice;
}
}
}
// default template
return this.__chooseTemplateForTiddler.apply(this, arguments);
};
// assert theme name as a class on the tiddler
Story.prototype.__refreshTiddler = Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function (title, template, force, customFields, defaultText)
{
var tiddlerElem = this.__refreshTiddler.apply(this, arguments);
var tiddler = store.getTiddler(title);
if (tiddler) {
addClass(tiddlerElem, store.getTiddler(title).fields.theme);
}
return tiddlerElem;
};
}
//}}}
I've been using a [[touch/pen slate computer|http://www.tabletkiosk.com/products/sahara/i400s_pp.asp]] since way before the Ipad. So, for moving around the desktop, I browse with Firefox and the [[Grabanddrag|http://grabanddrag.mozdev.org/index.html]] extension. Get it!
If you don't use Firefox, you could try Eric's [[DragScrollPlugin|http://www.TiddlyTools.com/#DragScrollPlugin]] but that one requires a keyboard (hold the shift while click&drag)...
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 10/01/2011 21:56:05 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup |
| 10/01/2011 23:25:54 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html#Search]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 10/01/2011 23:34:57 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html#Search]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 10/01/2011 23:39:54 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html#Search]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 10/01/2011 23:42:27 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html#Search]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 10/01/2011 23:51:53 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 10/01/2011 23:56:07 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 10/01/2011 23:59:16 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup | ok |
| 11/01/2011 00:28:18 | GUEST | [[stickydesktopTiddlySpot.html|file:///mnt/home/Dropbox/Public/TDeskTop/stickydesktopTiddlySpot.html]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup |
| 11/01/2011 00:29:36 | YourName | [[/|http://stickyd.tiddlyspot.com/]] | [[store.cgi|http://stickyd.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stickyd.tiddlyspot.com/index.html]] | backup |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
major: 4, minor: 1, revision: 3,
date: new Date("Feb 24, 2008"),
source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
coreVersion: '2.2.0'
};
//
// Environment
//
if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false; // true to activate both in Plugin and UploadService
//
// Upload Macro
//
config.macros.upload = {
// default values
defaultBackupDir: '', //no backup
defaultStoreScript: "store.php",
defaultToFilename: "index.html",
defaultUploadDir: ".",
authenticateUser: true // UploadService Authenticate User
};
config.macros.upload.label = {
promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
promptParamMacro: "Save and Upload this TiddlyWiki in %0",
saveLabel: "save to web",
saveToDisk: "save to disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "No store URL in parmeters or options",
usernameOrPasswordMissing: "Username or password missing"
};
config.macros.upload.handler = function(place,macroName,params) {
if (readOnly)
return;
var label;
if (document.location.toString().substr(0,4) == "http")
label = this.label.saveLabel;
else
label = this.label.uploadLabel;
var prompt;
if (params[0]) {
prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0],
(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
} else {
prompt = this.label.promptOption;
}
createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};
config.macros.upload.action = function(params)
{
// for missing macro parameter set value from options
if (!params) params = {};
var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
var username = params[4] ? params[4] : config.options.txtUploadUserName;
var password = config.options.pasUploadPassword; // for security reason no password as macro parameter
// for still missing parameter set default value
if ((!storeUrl) && (document.location.toString().substr(0,4) == "http"))
storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
if (storeUrl.substr(0,4) != "http")
storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
if (!toFilename)
toFilename = bidix.basename(window.location.toString());
if (!toFilename)
toFilename = config.macros.upload.defaultToFilename;
if (!uploadDir)
uploadDir = config.macros.upload.defaultUploadDir;
if (!backupDir)
backupDir = config.macros.upload.defaultBackupDir;
// report error if still missing
if (!storeUrl) {
alert(config.macros.upload.messages.noStoreUrl);
clearMessage();
return false;
}
if (config.macros.upload.authenticateUser && (!username || !password)) {
alert(config.macros.upload.messages.usernameOrPasswordMissing);
clearMessage();
return false;
}
bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password);
return false;
};
config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir)
{
if (!storeUrl)
return null;
var dest = bidix.dirname(storeUrl);
if (uploadDir && uploadDir != '.')
dest = dest + '/' + uploadDir;
dest = dest + '/' + toFilename;
return dest;
};
//
// uploadOptions Macro
//
config.macros.uploadOptions = {
handler: function(place,macroName,params) {
var wizard = new Wizard();
wizard.createWizard(place,this.wizardTitle);
wizard.addStep(this.step1Title,this.step1Html);
var markList = wizard.getElement("markList");
var listWrapper = document.createElement("div");
markList.parentNode.insertBefore(listWrapper,markList);
wizard.setValue("listWrapper",listWrapper);
this.refreshOptions(listWrapper,false);
var uploadCaption;
if (document.location.toString().substr(0,4) == "http")
uploadCaption = config.macros.upload.label.saveLabel;
else
uploadCaption = config.macros.upload.label.uploadLabel;
wizard.setButtons([
{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption,
onClick: config.macros.upload.action},
{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
]);
},
options: [
"txtUploadUserName",
"pasUploadPassword",
"txtUploadStoreUrl",
"txtUploadDir",
"txtUploadFilename",
"txtUploadBackupDir",
"chkUploadLog",
"txtUploadLogMaxLine"
],
refreshOptions: function(listWrapper) {
var opts = [];
for(i=0; i<this.options.length; i++) {
var opt = {};
opts.push();
opt.option = "";
n = this.options[i];
opt.name = n;
opt.lowlight = !config.optionsDesc[n];
opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
opts.push(opt);
}
var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
for(n=0; n<opts.length; n++) {
var type = opts[n].name.substr(0,3);
var h = config.macros.option.types[type];
if (h && h.create) {
h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
}
}
},
onCancel: function(e)
{
backstage.switchTab(null);
return false;
},
wizardTitle: "Upload with options",
step1Title: "These options are saved in cookies in your browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Cancel",
cancelButtonPrompt: "Cancel prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
};
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
backupSaved: "Backup saved",
backupFailed: "Failed to upload backup file",
rssSaved: "RSS feed uploaded",
rssFailed: "Failed to upload RSS feed file",
emptySaved: "Empty template uploaded",
emptyFailed: "Failed to upload empty template file",
mainSaved: "Main TiddlyWiki file uploaded",
mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
//specific upload
loadOriginalHttpPostError: "Can't get original file",
aboutToSaveOnHttpPost: 'About to upload on %0 ...',
storePhpNotFound: "The store script '%0' was not found."
};
bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
var callback = function(status,uploadParams,original,url,xhr) {
if (!status) {
displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
return;
}
if (bidix.debugMode)
alert(original.substr(0,500)+"\n...");
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.upload.uploadRss(uploadParams,original,posDiv);
};
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
// save on localdisk ?
if (document.location.toString().substr(0,4) == "file") {
var path = document.location.toString();
var localPath = getLocalPath(path);
saveChanges();
}
// get original
var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
var originalPath = document.location.toString();
// If url is a directory : add index.html
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + "index.html";
var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
var log = new bidix.UploadLog();
log.startUpload(storeUrl, dest, uploadDir, backupDir);
displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
if (bidix.debugMode)
alert("about to execute Http - GET on "+originalPath);
var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
bidix.upload.uploadRss = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
bidix.upload.uploadMain(params[0],params[1],params[2]);
} else {
displayMessage(bidix.upload.messages.rssFailed);
}
};
// do uploadRss
if(config.options.chkGenerateAnRssFeed) {
var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
var rssString = generateRss();
// no UnicodeToUTF8 conversion needed when location is "file" !!!
if (document.location.toString().substr(0,4) != "file")
rssString = convertUnicodeToUTF8(rssString);
bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
} else {
bidix.upload.uploadMain(uploadParams,original,posDiv);
}
};
bidix.upload.uploadMain = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
var log = new bidix.UploadLog();
if(status) {
// if backupDir specified
if ((params[3]) && (responseText.indexOf("backupfile:") > -1)) {
var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
}
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
store.setDirty(false);
log.endUpload("ok");
} else {
alert(bidix.upload.messages.mainFailed);
displayMessage(bidix.upload.messages.mainFailed);
log.endUpload("failed");
}
};
// do uploadMain
var revised = bidix.upload.updateOriginal(original,posDiv);
bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};
bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
var localCallback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (xhr.status == 404)
alert(bidix.upload.messages.storePhpNotFound.format([url]));
if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
alert(responseText);
if (responseText.indexOf("Debug mode") >= 0 )
responseText = responseText.substring(responseText.indexOf("\n\n")+2);
} else if (responseText.charAt(0) != '0')
alert(responseText);
if (responseText.charAt(0) != '0')
status = null;
callback(status,params,responseText,url,xhr);
};
// do httpUpload
var boundary = "---------------------------"+"AaB03x";
var uploadFormName = "UploadPlugin";
// compose headers data
var sheader = "";
sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
sheader += uploadFormName +"\"\r\n\r\n";
sheader += "backupDir="+uploadParams[3] +
";user=" + uploadParams[4] +
";password=" + uploadParams[5] +
";uploaddir=" + uploadParams[2];
if (bidix.debugMode)
sheader += ";debug=1";
sheader += ";;\r\n";
sheader += "\r\n" + "--" + boundary + "\r\n";
sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
sheader += "Content-Length: " + data.length + "\r\n\r\n";
// compose trailer data
var strailer = new String();
strailer = "\r\n--" + boundary + "--\r\n";
data = sheader + data + strailer;
if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
if (!posDiv)
posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
store.allTiddlersAsHtml() + "\n" +
original.substr(posDiv[1]);
var newSiteTitle = getPageTitle().htmlEncode();
revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
return revised;
};
//
// UploadLog
//
// config.options.chkUploadLog :
// false : no logging
// true : logging
// config.options.txtUploadLogMaxLine :
// -1 : no limit
// 0 : no Log lines but UploadLog is still in place
// n : the last n lines are only kept
// NaN : no limit (-1)
bidix.UploadLog = function() {
if (!config.options.chkUploadLog)
return; // this.tiddler = null
this.tiddler = store.getTiddler("UploadLog");
if (!this.tiddler) {
this.tiddler = new Tiddler();
this.tiddler.title = "UploadLog";
this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
this.tiddler.created = new Date();
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
}
return this;
};
bidix.UploadLog.prototype.addText = function(text) {
if (!this.tiddler)
return;
// retrieve maxLine when we need it
var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
if (isNaN(maxLine))
maxLine = -1;
// add text
if (maxLine != 0)
this.tiddler.text = this.tiddler.text + text;
// Trunck to maxLine
if (maxLine >= 0) {
var textArray = this.tiddler.text.split('\n');
if (textArray.length > maxLine + 1)
textArray.splice(1,textArray.length-1-maxLine);
this.tiddler.text = textArray.join('\n');
}
// update tiddler fields
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
// refresh and notifiy for immediate update
story.refreshTiddler(this.tiddler.title);
store.notify(this.tiddler.title, true);
};
bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
if (!this.tiddler)
return;
var now = new Date();
var text = "\n| ";
var filename = bidix.basename(document.location.toString());
if (!filename) filename = '/';
text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
text += config.options.txtUserName + " | ";
text += "[["+filename+"|"+location + "]] |";
text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
text += uploadDir + " | ";
text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
text += backupDir + " |";
this.addText(text);
};
bidix.UploadLog.prototype.endUpload = function(status) {
if (!this.tiddler)
return;
this.addText(" "+status+" |");
};
//
// Utilities
//
bidix.checkPlugin = function(plugin, major, minor, revision) {
var ext = version.extensions[plugin];
if (!
(ext &&
((ext.major > major) ||
((ext.major == major) && (ext.minor > minor)) ||
((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
// write error in PluginManager
if (pluginInfo)
pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
}
};
bidix.dirname = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(0, lastpos);
} else {
return filePath.substring(0, filePath.lastIndexOf("\\"));
}
};
bidix.basename = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("#")) != -1)
filePath = filePath.substring(0, lastpos);
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(lastpos + 1);
} else
return filePath.substring(filePath.lastIndexOf("\\")+1);
};
bidix.initOption = function(name,value) {
if (!config.options[name])
config.options[name] = value;
};
//
// Initializations
//
// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);
// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");
//optionsDesc
merge(config.optionsDesc,{
txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
txtUploadUserName: "Upload Username",
pasUploadPassword: "Upload Password",
chkUploadLog: "do Logging in UploadLog (default: true)",
txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});
// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');
// Backstage
merge(config.tasks,{
uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
//}}}
there's 3 images that come with this theme:
[[bg_pattern_dot.gif]]
[[btn_resize.png]]
[[white_gradient.png]]
/***
|''Name:''|YourSearchPlugin|
|''Version:''|2.1.5 (2010-02-16)|
|''Source:''|http://tiddlywiki.abego-software.de/#YourSearchPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]|
|''Copyright:''|© 2005-2010 [[abego Software|http://www.abego-software.de]]|
|''~CoreVersion:''|2.1.0|
|''Community:''|[[del.icio.us|http://del.icio.us/post?url=http://tiddlywiki.abego-software.de/index.html%23YourSearchPlugin]]|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; ~InternetExplorer 6.0|
!About YourSearch
YourSearch gives you a bunch of new features to simplify and speed up your daily searches in TiddlyWiki. It seamlessly integrates into the standard TiddlyWiki search: just start typing into the 'search' field and explore!
For more information see [[Help|YourSearch Help]].
!Compatibility
This plugin requires TiddlyWiki 2.1.
Check the [[archive|http://tiddlywiki.abego-software.de/archive]] for ~YourSearchPlugins supporting older versions of TiddlyWiki.
!Source Code
***/
/***
This plugin's source code is compressed (and hidden). Use this [[link|http://tiddlywiki.abego-software.de/archive/YourSearchPlugin/Plugin-YourSearch-src.2.1.5.js]] to get the readable source code.
***/
///%
if(!version.extensions.YourSearchPlugin){version.extensions.YourSearchPlugin={major:2,minor:1,revision:5,source:"http://tiddlywiki.abego-software.de/#YourSearchPlugin",licence:"[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]",copyright:"Copyright (c) abego Software GmbH, 2005-2010 (www.abego-software.de)"};if(!window.abego){window.abego={};}if(!Array.forEach){Array.forEach=function(_1,_2,_3){for(var i=0,_4=_1.length;i<_4;i++){_2.call(_3,_1[i],i,_1);}};Array.prototype.forEach=function(_5,_6){for(var i=0,_7=this.length;i<_7;i++){_5.call(_6,this[i],i,this);}};}abego.toInt=function(s,_8){if(!s){return _8;}var n=parseInt(s);return (n==NaN)?_8:n;};abego.createEllipsis=function(_9){var e=createTiddlyElement(_9,"span");e.innerHTML="…";};abego.shallowCopy=function(_a){if(!_a){return _a;}var _b={};for(var n in _a){_b[n]=_a[n];}return _b;};abego.copyOptions=function(_c){return !_c?{}:abego.shallowCopy(_c);};abego.countStrings=function(_d,s){if(!s){return 0;}var _e=s.length;var n=0;var _f=0;while(1){var i=_d.indexOf(s,_f);if(i<0){return n;}n++;_f=i+_e;}return n;};abego.getBracedText=function(_10,_11,_12){if(!_11){_11=0;}var re=/\{([^\}]*)\}/gm;re.lastIndex=_11;var m=re.exec(_10);if(m){var s=m[1];var _13=abego.countStrings(s,"{");if(!_13){if(_12){_12.lastIndex=re.lastIndex;}return s;}var len=_10.length;for(var i=re.lastIndex;i<len&&_13;i++){var c=_10.charAt(i);if(c=="{"){_13++;}else{if(c=="}"){_13--;}}}if(!_13){if(_12){_12.lastIndex=i-1;}return _10.substring(m.index+1,i-1);}}};abego.select=function(_14,_15,_16,_17){if(!_17){_17=[];}_14.forEach(function(t){if(_15.call(_16,t)){_17.push(t);}});return _17;};abego.consumeEvent=function(e){if(e.stopPropagation){e.stopPropagation();}if(e.preventDefault){e.preventDefault();}e.cancelBubble=true;e.returnValue=true;};abego.TiddlerFilterTerm=function(_18,_19){if(!_19){_19={};}var _1a=_18;if(!_19.textIsRegExp){_1a=_18.escapeRegExp();if(_19.fullWordMatch){_1a="\\b"+_1a+"\\b";}}var _1b=new RegExp(_1a,"m"+(_19.caseSensitive?"":"i"));this.tester=new abego.MultiFieldRegExpTester(_1b,_19.fields,_19.withExtendedFields);};abego.TiddlerFilterTerm.prototype.test=function(_1c){return this.tester.test(_1c);};abego.parseNewTiddlerCommandLine=function(s){var m=/(.*?)\.(?:\s+|$)([^#]*)(#.*)?/.exec(s);if(!m){m=/([^#]*)()(#.*)?/.exec(s);}if(m){var r;if(m[3]){var s2=m[3].replace(/#/g,"");r=s2.parseParams("tag");}else{r=[[]];}var _1d=m[2]?m[2].trim():"";r.push({name:"text",value:_1d});r[0].text=[_1d];return {title:m[1].trim(),params:r};}else{return {title:s.trim(),params:[[]]};}};abego.parseTiddlerFilterTerm=function(_1e,_1f,_20){var re=/\s*(?:(?:\{([^\}]*)\})|(?:(=)|([#%!])|(?:(\w+)\s*\:(?!\/\/))|(?:(?:("(?:(?:\\")|[^"])+")|(?:\/((?:(?:\\\/)|[^\/])+)\/)|(\w+\:\/\/[^\s]+)|([^\s\)\-\"]+)))))/mg;var _21={"!":"title","%":"text","#":"tags"};var _22={};var _23;re.lastIndex=_1f;while(1){var i=re.lastIndex;var m=re.exec(_1e);if(!m||m.index!=i){throw "Word or String literal expected";}if(m[1]){var _24={};var _25=abego.getBracedText(_1e,0,_24);if(!_25){throw "Invalid {...} syntax";}var f=Function("tiddler","return ("+_25+");");return {func:f,lastIndex:_24.lastIndex,markRE:null};}if(m[2]){_23=true;}else{if(m[3]){_22[_21[m[3]]]=1;}else{if(m[4]){_22[m[4]]=1;}else{var _26=m[6];var _27=m[5]?window.eval(m[5]):m[6]?m[6]:m[7]?m[7]:m[8];var _20=abego.copyOptions(_20);_20.fullWordMatch=_23;_20.textIsRegExp=_26;var _28=[];for(var n in _22){_28.push(n);}if(_28.length==0){_20.fields=_20.defaultFields;}else{_20.fields=_28;_20.withExtendedFields=false;}var _29=new abego.TiddlerFilterTerm(_27,_20);var _2a=_26?_27:_27.escapeRegExp();if(_2a&&_23){_2a="\\b"+_2a+"\\b";}return {func:function(_2b){return _29.test(_2b);},lastIndex:re.lastIndex,markRE:_2a?"(?:"+_2a+")":null};}}}}};abego.BoolExp=function(s,_2c,_2d){this.s=s;var _2e=_2d&&_2d.defaultOperationIs_OR;var _2f=/\s*(?:(\-|not)|(\())/gi;var _30=/\s*\)/g;var _31=/\s*(?:(and|\&\&)|(or|\|\|))/gi;var _32=/\s*[^\)\s]/g;var _33=/\s*(\-|not)?(\s*\()?/gi;var _34;var _35=function(_36){_33.lastIndex=_36;var m=_33.exec(s);var _37;var _38;if(m&&m.index==_36){_36+=m[0].length;_37=m[1];if(m[2]){var e=_34(_36);_30.lastIndex=e.lastIndex;if(!_30.exec(s)){throw "Missing ')'";}_38={func:e.func,lastIndex:_30.lastIndex,markRE:e.markRE};}}if(!_38){_38=_2c(s,_36,_2d);}if(_37){_38.func=(function(f){return function(_39){return !f(_39);};})(_38.func);_38.markRE=null;}return _38;};_34=function(_3a){var _3b=_35(_3a);while(1){var l=_3b.lastIndex;_31.lastIndex=l;var m=_31.exec(s);var _3c;var _3d;if(m&&m.index==l){_3c=!m[1];_3d=_35(_31.lastIndex);}else{try{_3d=_35(l);}catch(e){return _3b;}_3c=_2e;}_3b.func=(function(_3e,_3f,_40){return _40?function(_41){return _3e(_41)||_3f(_41);}:function(_42){return _3e(_42)&&_3f(_42);};})(_3b.func,_3d.func,_3c);_3b.lastIndex=_3d.lastIndex;if(!_3b.markRE){_3b.markRE=_3d.markRE;}else{if(_3d.markRE){_3b.markRE=_3b.markRE+"|"+_3d.markRE;}}}};var _43=_34(0);this.evalFunc=_43.func;if(_43.markRE){this.markRegExp=new RegExp(_43.markRE,_2d.caseSensitive?"mg":"img");}};abego.BoolExp.prototype.exec=function(){return this.evalFunc.apply(this,arguments);};abego.BoolExp.prototype.getMarkRegExp=function(){return this.markRegExp;};abego.BoolExp.prototype.toString=function(){return this.s;};abego.MultiFieldRegExpTester=function(re,_44,_45){this.re=re;this.fields=_44?_44:["title","text","tags"];this.withExtendedFields=_45;};abego.MultiFieldRegExpTester.prototype.test=function(_46){var re=this.re;for(var i=0;i<this.fields.length;i++){var s=store.getValue(_46,this.fields[i]);if(typeof s=="string"&&re.test(s)){return this.fields[i];}}if(this.withExtendedFields){return store.forEachField(_46,function(_47,_48,_49){return typeof _49=="string"&&re.test(_49)?_48:null;},true);}return null;};abego.TiddlerQuery=function(_4a,_4b,_4c,_4d,_4e){if(_4c){this.regExp=new RegExp(_4a,_4b?"mg":"img");this.tester=new abego.MultiFieldRegExpTester(this.regExp,_4d,_4e);}else{this.expr=new abego.BoolExp(_4a,abego.parseTiddlerFilterTerm,{defaultFields:_4d,caseSensitive:_4b,withExtendedFields:_4e});}this.getQueryText=function(){return _4a;};this.getUseRegExp=function(){return _4c;};this.getCaseSensitive=function(){return _4b;};this.getDefaultFields=function(){return _4d;};this.getWithExtendedFields=function(){return _4e;};};abego.TiddlerQuery.prototype.test=function(_4f){if(!_4f){return false;}if(this.regExp){return this.tester.test(_4f);}return this.expr.exec(_4f);};abego.TiddlerQuery.prototype.filter=function(_50){return abego.select(_50,this.test,this);};abego.TiddlerQuery.prototype.getMarkRegExp=function(){if(this.regExp){return "".search(this.regExp)>=0?null:this.regExp;}return this.expr.getMarkRegExp();};abego.TiddlerQuery.prototype.toString=function(){return (this.regExp?this.regExp:this.expr).toString();};abego.PageWiseRenderer=function(){this.firstIndexOnPage=0;};merge(abego.PageWiseRenderer.prototype,{setItems:function(_51){this.items=_51;this.setFirstIndexOnPage(0);},getMaxPagesInNavigation:function(){return 10;},getItemsCount:function(_52){return this.items?this.items.length:0;},getCurrentPageIndex:function(){return Math.floor(this.firstIndexOnPage/this.getItemsPerPage());},getLastPageIndex:function(){return Math.floor((this.getItemsCount()-1)/this.getItemsPerPage());},setFirstIndexOnPage:function(_53){this.firstIndexOnPage=Math.min(Math.max(0,_53),this.getItemsCount()-1);},getFirstIndexOnPage:function(){this.firstIndexOnPage=Math.floor(this.firstIndexOnPage/this.getItemsPerPage())*this.getItemsPerPage();return this.firstIndexOnPage;},getLastIndexOnPage:function(){return Math.min(this.getFirstIndexOnPage()+this.getItemsPerPage()-1,this.getItemsCount()-1);},onPageChanged:function(_54,_55){},renderPage:function(_56){if(_56.beginRendering){_56.beginRendering(this);}try{if(this.getItemsCount()){var _57=this.getLastIndexOnPage();var _58=-1;for(var i=this.getFirstIndexOnPage();i<=_57;i++){_58++;_56.render(this,this.items[i],i,_58);}}}finally{if(_56.endRendering){_56.endRendering(this);}}},addPageNavigation:function(_59){if(!this.getItemsCount()){return;}var _5a=this;var _5b=function(e){if(!e){var e=window.event;}abego.consumeEvent(e);var _5c=abego.toInt(this.getAttribute("page"),0);var _5d=_5a.getCurrentPageIndex();if(_5c==_5d){return;}var _5e=_5c*_5a.getItemsPerPage();_5a.setFirstIndexOnPage(_5e);_5a.onPageChanged(_5c,_5d);};var _5f;var _60=this.getCurrentPageIndex();var _61=this.getLastPageIndex();if(_60>0){_5f=createTiddlyButton(_59,"Previous","Go to previous page (Shortcut: Alt-'<')",_5b,"prev");_5f.setAttribute("page",(_60-1).toString());_5f.setAttribute("accessKey","<");}for(var i=-this.getMaxPagesInNavigation();i<this.getMaxPagesInNavigation();i++){var _62=_60+i;if(_62<0){continue;}if(_62>_61){break;}var _63=(i+_60+1).toString();var _64=_62==_60?"currentPage":"otherPage";_5f=createTiddlyButton(_59,_63,"Go to page %0".format([_63]),_5b,_64);_5f.setAttribute("page",(_62).toString());}if(_60<_61){_5f=createTiddlyButton(_59,"Next","Go to next page (Shortcut: Alt-'>')",_5b,"next");_5f.setAttribute("page",(_60+1).toString());_5f.setAttribute("accessKey",">");}}});abego.LimitedTextRenderer=function(){var _65=40;var _66=4;var _67=function(_68,_69,_6a){var n=_68.length;if(n==0){_68.push({start:_69,end:_6a});return;}var i=0;for(;i<n;i++){var _6b=_68[i];if(_6b.start<=_6a&&_69<=_6b.end){var r;var _6c=i+1;for(;_6c<n;_6c++){r=_68[_6c];if(r.start>_6a||_69>_6b.end){break;}}var _6d=_69;var _6e=_6a;for(var j=i;j<_6c;j++){r=_68[j];_6d=Math.min(_6d,r.start);_6e=Math.max(_6e,r.end);}_68.splice(i,_6c-i,{start:_6d,end:_6e});return;}if(_6b.start>_6a){break;}}_68.splice(i,0,{start:_69,end:_6a});};var _6f=function(_70){var _71=0;for(var i=0;i<_70.length;i++){var _72=_70[i];_71+=_72.end-_72.start;}return _71;};var _73=function(c){return (c>="a"&&c<="z")||(c>="A"&&c<="Z")||c=="_";};var _74=function(s,_75){if(!_73(s[_75])){return null;}for(var i=_75-1;i>=0&&_73(s[i]);i--){}var _76=i+1;var n=s.length;for(i=_75+1;i<n&&_73(s[i]);i++){}return {start:_76,end:i};};var _77=function(s,_78,_79){var _7a;if(_79){_7a=_74(s,_78);}else{if(_78<=0){return _78;}_7a=_74(s,_78-1);}if(!_7a){return _78;}if(_79){if(_7a.start>=_78-_66){return _7a.start;}if(_7a.end<=_78+_66){return _7a.end;}}else{if(_7a.end<=_78+_66){return _7a.end;}if(_7a.start>=_78-_66){return _7a.start;}}return _78;};var _7b=function(s,_7c){var _7d=[];if(_7c){var _7e=0;var n=s.length;var _7f=0;do{_7c.lastIndex=_7e;var _80=_7c.exec(s);if(_80){if(_7e<_80.index){var t=s.substring(_7e,_80.index);_7d.push({text:t});}_7d.push({text:_80[0],isMatch:true});_7e=_80.index+_80[0].length;}else{_7d.push({text:s.substr(_7e)});break;}}while(true);}else{_7d.push({text:s});}return _7d;};var _81=function(_82){var _83=0;for(var i=0;i<_82.length;i++){if(_82[i].isMatch){_83++;}}return _83;};var _84=function(s,_85,_86,_87,_88){var _89=Math.max(Math.floor(_88/(_87+1)),_65);var _8a=Math.max(_89-(_86-_85),0);var _8b=Math.min(Math.floor(_86+_8a/3),s.length);var _8c=Math.max(_8b-_89,0);_8c=_77(s,_8c,true);_8b=_77(s,_8b,false);return {start:_8c,end:_8b};};var _8d=function(_8e,s,_8f){var _90=[];var _91=_81(_8e);var pos=0;for(var i=0;i<_8e.length;i++){var t=_8e[i];var _92=t.text;if(t.isMatch){var _93=_84(s,pos,pos+_92.length,_91,_8f);_67(_90,_93.start,_93.end);}pos+=_92.length;}return _90;};var _94=function(s,_95,_96){var _97=_96-_6f(_95);while(_97>0){if(_95.length==0){_67(_95,0,_77(s,_96,false));return;}else{var _98=_95[0];var _99;var _9a;if(_98.start==0){_99=_98.end;if(_95.length>1){_9a=_95[1].start;}else{_67(_95,_99,_77(s,_99+_97,false));return;}}else{_99=0;_9a=_98.start;}var _9b=Math.min(_9a,_99+_97);_67(_95,_99,_9b);_97-=(_9b-_99);}}};var _9c=function(_9d,s,_9e,_9f,_a0){if(_9f.length==0){return;}var _a1=function(_a2,s,_a3,_a4,_a5){var t;var _a6;var pos=0;var i=0;var _a7=0;for(;i<_a3.length;i++){t=_a3[i];_a6=t.text;if(_a4<pos+_a6.length){_a7=_a4-pos;break;}pos+=_a6.length;}var _a8=_a5-_a4;for(;i<_a3.length&&_a8>0;i++){t=_a3[i];_a6=t.text.substr(_a7);_a7=0;if(_a6.length>_a8){_a6=_a6.substr(0,_a8);}if(t.isMatch){createTiddlyElement(_a2,"span",null,"marked",_a6);}else{createTiddlyText(_a2,_a6);}_a8-=_a6.length;}if(_a5<s.length){abego.createEllipsis(_a2);}};if(_9f[0].start>0){abego.createEllipsis(_9d);}var _a9=_a0;for(var i=0;i<_9f.length&&_a9>0;i++){var _aa=_9f[i];var len=Math.min(_aa.end-_aa.start,_a9);_a1(_9d,s,_9e,_aa.start,_aa.start+len);_a9-=len;}};this.render=function(_ab,s,_ac,_ad){if(s.length<_ac){_ac=s.length;}var _ae=_7b(s,_ad);var _af=_8d(_ae,s,_ac);_94(s,_af,_ac);_9c(_ab,s,_ae,_af,_ac);};};(function(){function _b0(msg){alert(msg);throw msg;};if(version.major<2||(version.major==2&&version.minor<1)){_b0("YourSearchPlugin requires TiddlyWiki 2.1 or newer.\n\nCheck the archive for YourSearch plugins\nsupporting older versions of TiddlyWiki.\n\nArchive: http://tiddlywiki.abego-software.de/archive");}abego.YourSearch={};var _b1;var _b2;var _b3=function(_b4){_b1=_b4;};var _b5=function(){return _b1?_b1:[];};var _b6=function(){return _b1?_b1.length:0;};var _b7=4;var _b8=10;var _b9=2;var _ba=function(s,re){var m=s.match(re);return m?m.length:0;};var _bb=function(_bc,_bd){var _be=_bd.getMarkRegExp();if(!_be){return 1;}var _bf=_bc.title.match(_be);var _c0=_bf?_bf.length:0;var _c1=_ba(_bc.getTags(),_be);var _c2=_bf?_bf.join("").length:0;var _c3=_bc.title.length>0?_c2/_bc.title.length:0;var _c4=_c0*_b7+_c1*_b9+_c3*_b8+1;return _c4;};var _c5=function(_c6,_c7,_c8,_c9,_ca,_cb){_b2=null;var _cc=_c6.reverseLookup("tags",_cb,false);try{var _cd=[];if(config.options.chkSearchInTitle){_cd.push("title");}if(config.options.chkSearchInText){_cd.push("text");}if(config.options.chkSearchInTags){_cd.push("tags");}_b2=new abego.TiddlerQuery(_c7,_c8,_c9,_cd,config.options.chkSearchExtendedFields);}catch(e){return [];}var _ce=_b2.filter(_cc);var _cf=abego.YourSearch.getRankFunction();for(var i=0;i<_ce.length;i++){var _d0=_ce[i];var _d1=_cf(_d0,_b2);_d0.searchRank=_d1;}if(!_ca){_ca="title";}var _d2=function(a,b){var _d3=a.searchRank-b.searchRank;if(_d3==0){if(a[_ca]==b[_ca]){return (0);}else{return (a[_ca]<b[_ca])?-1:+1;}}else{return (_d3>0)?-1:+1;}};_ce.sort(_d2);return _ce;};var _d4=80;var _d5=50;var _d6=250;var _d7=50;var _d8=25;var _d9=10;var _da="yourSearchResult";var _db="yourSearchResultItems";var _dc;var _dd;var _de;var _df;var _e0;var _e1=function(){if(version.extensions.YourSearchPlugin.styleSheetInited){return;}version.extensions.YourSearchPlugin.styleSheetInited=true;setStylesheet(store.getTiddlerText("YourSearchStyleSheet"),"yourSearch");};var _e2=function(){return _dd!=null&&_dd.parentNode==document.body;};var _e3=function(){if(_e2()){document.body.removeChild(_dd);}};var _e4=function(e){_e3();var _e5=this.getAttribute("tiddlyLink");if(_e5){var _e6=this.getAttribute("withHilite");var _e7=highlightHack;if(_e6&&_e6=="true"&&_b2){highlightHack=_b2.getMarkRegExp();}story.displayTiddler(this,_e5);highlightHack=_e7;}return (false);};var _e8=function(){if(!_de){return;}var _e9=_de;var _ea=findPosX(_e9);var _eb=findPosY(_e9);var _ec=_e9.offsetHeight;var _ed=_ea;var _ee=_eb+_ec;var _ef=findWindowWidth();if(_ef<_dd.offsetWidth){_dd.style.width=(_ef-100)+"px";_ef=findWindowWidth();}var _f0=_dd.offsetWidth;if(_ed+_f0>_ef){_ed=_ef-_f0-30;}if(_ed<0){_ed=0;}_dd.style.left=_ed+"px";_dd.style.top=_ee+"px";_dd.style.display="block";};var _f1=function(){if(_dd){window.scrollTo(0,ensureVisible(_dd));}if(_de){window.scrollTo(0,ensureVisible(_de));}};var _f2=function(){_e8();_f1();};var _f3;var _f4;var _f5=new abego.PageWiseRenderer();var _f6=function(_f7){this.itemHtml=store.getTiddlerText("YourSearchItemTemplate");if(!this.itemHtml){_b0("YourSearchItemTemplate not found");}this.place=document.getElementById(_db);if(!this.place){this.place=createTiddlyElement(_f7,"div",_db);}};merge(_f6.prototype,{render:function(_f8,_f9,_fa,_fb){_f3=_fb;_f4=_f9;var _fc=createTiddlyElement(this.place,"div",null,"yourSearchItem");_fc.innerHTML=this.itemHtml;applyHtmlMacros(_fc,null);refreshElements(_fc,null);},endRendering:function(_fd){_f4=null;}});var _fe=function(){if(!_dd||!_de){return;}var _ff=store.getTiddlerText("YourSearchResultTemplate");if(!_ff){_ff="<b>Tiddler YourSearchResultTemplate not found</b>";}_dd.innerHTML=_ff;applyHtmlMacros(_dd,null);refreshElements(_dd,null);var _100=new _f6(_dd);_f5.renderPage(_100);_f2();};_f5.getItemsPerPage=function(){var n=(config.options.chkPreviewText)?abego.toInt(config.options.txtItemsPerPageWithPreview,_d9):abego.toInt(config.options.txtItemsPerPage,_d8);return (n>0)?n:1;};_f5.onPageChanged=function(){_fe();};var _101=function(){if(_de==null||!config.options.chkUseYourSearch){return;}if((_de.value==_dc)&&_dc&&!_e2()){if(_dd&&(_dd.parentNode!=document.body)){document.body.appendChild(_dd);_f2();}else{abego.YourSearch.onShowResult(true);}}};var _102=function(){_e3();_dd=null;_dc=null;};var _103=function(self,e){while(e!=null){if(self==e){return true;}e=e.parentNode;}return false;};var _104=function(e){if(e.target==_de){return;}if(e.target==_df){return;}if(_dd&&_103(_dd,e.target)){return;}_e3();};var _105=function(e){if(e.keyCode==27){_e3();}};addEvent(document,"click",_104);addEvent(document,"keyup",_105);var _106=function(text,_107,_108){_dc=text;_b3(_c5(store,text,_107,_108,"title","excludeSearch"));abego.YourSearch.onShowResult();};var _109=function(_10a,_10b,_10c,_10d,_10e,_10f){_e1();_dc="";var _110=null;var _111=function(txt){if(config.options.chkUseYourSearch){_106(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}else{story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}_dc=txt.value;};var _112=function(e){_111(_de);return false;};var _113=function(e){if(!e){var e=window.event;}_de=this;switch(e.keyCode){case 13:if(e.ctrlKey&&_e0&&_e2()){_e0.onclick.apply(_e0,[e]);}else{_111(this);}break;case 27:if(_e2()){_e3();}else{this.value="";clearMessage();}break;}if(String.fromCharCode(e.keyCode)==this.accessKey||e.altKey){_101();}if(this.value.length<3&&_110){clearTimeout(_110);}if(this.value.length>2){if(this.value!=_dc){if(!config.options.chkUseYourSearch||config.options.chkSearchAsYouType){if(_110){clearTimeout(_110);}var txt=this;_110=setTimeout(function(){_111(txt);},500);}}else{if(_110){clearTimeout(_110);}}}if(this.value.length==0){_e3();}};var _114=function(e){this.select();clearMessage();_101();};var args=_10e.parseParams("list",null,true);var _115=getFlag(args,"buttonAtRight");var _116=getParam(args,"sizeTextbox",this.sizeTextbox);var btn;if(!_115){btn=createTiddlyButton(_10a,this.label,this.prompt,_112);}var txt=createTiddlyElement(null,"input",null,"txtOptionInput searchField",null);if(_10c[0]){txt.value=_10c[0];}txt.onkeyup=_113;txt.onfocus=_114;txt.setAttribute("size",_116);txt.setAttribute("accessKey",this.accessKey);txt.setAttribute("autocomplete","off");if(config.browser.isSafari){txt.setAttribute("type","search");txt.setAttribute("results","5");}else{txt.setAttribute("type","text");}if(_10a){_10a.appendChild(txt);}if(_115){btn=createTiddlyButton(_10a,this.label,this.prompt,_112);}_de=txt;_df=btn;};var _117=function(){_e3();var _118=_b5();var n=_118.length;if(n){var _119=[];for(var i=0;i<n;i++){_119.push(_118[i].title);}story.displayTiddlers(null,_119);}};var _11a=function(_11b,_11c,_11d,_11e){invokeMacro(_11b,"option",_11c,_11d,_11e);var elem=_11b.lastChild;var _11f=elem.onclick;elem.onclick=function(e){var _120=_11f.apply(this,arguments);_fe();return _120;};return elem;};var _121=function(s){var _122=["''","{{{","}}}","//","<<<","/***","***/"];var _123="";for(var i=0;i<_122.length;i++){if(i!=0){_123+="|";}_123+="("+_122[i].escapeRegExp()+")";}return s.replace(new RegExp(_123,"mg"),"").trim();};var _124=function(){var i=_f3;return (i>=0&&i<=9)?(i<9?(i+1):0):-1;};var _125=new abego.LimitedTextRenderer();var _126=function(_127,s,_128){_125.render(_127,s,_128,_b2.getMarkRegExp());};var _129=TiddlyWiki.prototype.saveTiddler;TiddlyWiki.prototype.saveTiddler=function(_12a,_12b,_12c,_12d,_12e,tags,_12f){_129.apply(this,arguments);_102();};var _130=TiddlyWiki.prototype.removeTiddler;TiddlyWiki.prototype.removeTiddler=function(_131){_130.apply(this,arguments);_102();};config.macros.yourSearch={label:"yourSearch",prompt:"Gives access to the current/last YourSearch result",handler:function(_132,_133,_134,_135,_136,_137){if(_134.length==0){return;}var name=_134[0];var func=config.macros.yourSearch.funcs[name];if(func){func(_132,_133,_134,_135,_136,_137);}},tests:{"true":function(){return true;},"false":function(){return false;},"found":function(){return _b6()>0;},"previewText":function(){return config.options.chkPreviewText;}},funcs:{itemRange:function(_138){if(_b6()){var _139=_f5.getLastIndexOnPage();var s="%0 - %1".format([_f5.getFirstIndexOnPage()+1,_139+1]);createTiddlyText(_138,s);}},count:function(_13a){createTiddlyText(_13a,_b6().toString());},query:function(_13b){if(_b2){createTiddlyText(_13b,_b2.toString());}},version:function(_13c){var t="YourSearch %0.%1.%2".format([version.extensions.YourSearchPlugin.major,version.extensions.YourSearchPlugin.minor,version.extensions.YourSearchPlugin.revision]);var e=createTiddlyElement(_13c,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#YourSearchPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";},copyright:function(_13d){var e=createTiddlyElement(_13d,"a");e.setAttribute("href","http://www.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">© 2005-2008 <b><font color=\"red\">abego</font></b> Software<font>";},newTiddlerButton:function(_13e){if(_b2){var r=abego.parseNewTiddlerCommandLine(_b2.getQueryText());var btn=config.macros.newTiddler.createNewTiddlerButton(_13e,r.title,r.params,"new tiddler","Create a new tiddler based on search text. (Shortcut: Ctrl-Enter; Separators: '.', '#')",null,"text");var _13f=btn.onclick;btn.onclick=function(){_e3();_13f.apply(this,arguments);};_e0=btn;}},linkButton:function(_140,_141,_142,_143,_144,_145){if(_142<2){return;}var _146=_142[1];var text=_142<3?_146:_142[2];var _147=_142<4?text:_142[3];var _148=_142<5?null:_142[4];var btn=createTiddlyButton(_140,text,_147,_e4,null,null,_148);btn.setAttribute("tiddlyLink",_146);},closeButton:function(_149,_14a,_14b,_14c,_14d,_14e){var _14f=createTiddlyButton(_149,"close","Close the Search Results (Shortcut: ESC)",_e3);},openAllButton:function(_150,_151,_152,_153,_154,_155){var n=_b6();if(n==0){return;}var _156=n==1?"open tiddler":"open all %0 tiddlers".format([n]);var _157=createTiddlyButton(_150,_156,"Open all found tiddlers (Shortcut: Alt-O)",_117);_157.setAttribute("accessKey","O");},naviBar:function(_158,_159,_15a,_15b,_15c,_15d){_f5.addPageNavigation(_158);},"if":function(_15e,_15f,_160,_161,_162,_163){if(_160.length<2){return;}var _164=_160[1];var _165=(_164=="not");if(_165){if(_160.length<3){return;}_164=_160[2];}var test=config.macros.yourSearch.tests[_164];var _166=false;try{if(test){_166=test(_15e,_15f,_160,_161,_162,_163)!=_165;}else{_166=(!eval(_164))==_165;}}catch(ex){}if(!_166){_15e.style.display="none";}},chkPreviewText:function(_167,_168,_169,_16a,_16b,_16c){var _16d=_169.slice(1).join(" ");var elem=_11a(_167,"chkPreviewText",_16a,_16c);elem.setAttribute("accessKey","P");elem.title="Show text preview of found tiddlers (Shortcut: Alt-P)";return elem;}}};config.macros.foundTiddler={label:"foundTiddler",prompt:"Provides information on the tiddler currently processed on the YourSearch result page",handler:function(_16e,_16f,_170,_171,_172,_173){var name=_170[0];var func=config.macros.foundTiddler.funcs[name];if(func){func(_16e,_16f,_170,_171,_172,_173);}},funcs:{title:function(_174,_175,_176,_177,_178,_179){if(!_f4){return;}var _17a=_124();var _17b=_17a>=0?"Open tiddler (Shortcut: Alt-%0)".format([_17a.toString()]):"Open tiddler";var btn=createTiddlyButton(_174,null,_17b,_e4,null);btn.setAttribute("tiddlyLink",_f4.title);btn.setAttribute("withHilite","true");_126(btn,_f4.title,_d4);if(_17a>=0){btn.setAttribute("accessKey",_17a.toString());}},tags:function(_17c,_17d,_17e,_17f,_180,_181){if(!_f4){return;}_126(_17c,_f4.getTags(),_d5);},text:function(_182,_183,_184,_185,_186,_187){if(!_f4){return;}_126(_182,_121(_f4.text),_d6);},field:function(_188,_189,_18a,_18b,_18c,_18d){if(!_f4){return;}var name=_18a[1];var len=_18a.length>2?abego.toInt(_18a[2],_d7):_d7;var v=store.getValue(_f4,name);if(v){_126(_188,_121(v),len);}},number:function(_18e,_18f,_190,_191,_192,_193){var _194=_124();if(_194>=0){var text="%0)".format([_194.toString()]);createTiddlyElement(_18e,"span",null,"shortcutNumber",text);}}}};var opts={chkUseYourSearch:true,chkPreviewText:true,chkSearchAsYouType:true,chkSearchInTitle:true,chkSearchInText:true,chkSearchInTags:true,chkSearchExtendedFields:true,txtItemsPerPage:_d8,txtItemsPerPageWithPreview:_d9};for(var n in opts){if(config.options[n]==undefined){config.options[n]=opts[n];}}config.shadowTiddlers.AdvancedOptions+="\n<<option chkUseYourSearch>> Use 'Your Search' //([[more options|YourSearch Options]]) ([[help|YourSearch Help]])// ";config.shadowTiddlers["YourSearch Help"]="!Field Search\nWith the Field Search you can restrict your search to certain fields of a tiddler, e.g"+" only search the tags or only the titles. The general form is //fieldname//'':''//textToSearch// (e."+"g. {{{title:intro}}}). In addition one-character shortcuts are also supported for the standard field"+"s {{{title}}}, {{{text}}} and {{{tags}}}:\n|!What you want|!What you type|!Example|\n|Search ''titles "+"only''|start word with ''!''|{{{!jonny}}} (shortcut for {{{title:jonny}}})|\n|Search ''contents/text "+"only''|start word with ''%''|{{{%football}}} (shortcut for {{{text:football}}})|\n|Search ''tags only"+"''|start word with ''#''|{{{#Plugin}}} (shortcut for {{{tags:Plugin}}})|\n\nUsing this feature you may"+" also search the extended fields (\"Metadata\") introduced with TiddlyWiki 2.1, e.g. use {{{priority:1"+"}}} to find all tiddlers with the priority field set to \"1\".\n\nYou may search a word in more than one"+" field. E.g. {{{!#Plugin}}} (or {{{title:tags:Plugin}}} in the \"long form\") finds tiddlers containin"+"g \"Plugin\" either in the title or in the tags (but does not look for \"Plugin\" in the text). \n\n!Boole"+"an Search\nThe Boolean Search is useful when searching for multiple words.\n|!What you want|!What you "+"type|!Example|\n|''All words'' must exist|List of words|{{{jonny jeremy}}} (or {{{jonny and jeremy}}}"+")|\n|''At least one word'' must exist|Separate words by ''or''|{{{jonny or jeremy}}}|\n|A word ''must "+"not exist''|Start word with ''-''|{{{-jonny}}} (or {{{not jonny}}})|\n\n''Note:'' When you specify two"+" words, separated with a space, YourSearch finds all tiddlers that contain both words, but not neces"+"sarily next to each other. If you want to find a sequence of word, e.g. '{{{John Brown}}}', you need"+" to put the words into quotes. I.e. you type: {{{\"john brown\"}}}.\n\nUsing parenthesis you may change "+"the default \"left to right\" evaluation of the boolean search. E.g. {{{not (jonny or jeremy)}}} finds"+" all tiddlers that contain neither \"jonny\" nor \"jeremy. In contrast to this {{{not jonny or jeremy}}"+"} (i.e. without parenthesis) finds all tiddlers that either don't contain \"jonny\" or that contain \"j"+"eremy\".\n\n!'Exact Word' Search\nBy default a search result all matches that 'contain' the searched tex"+"t. E.g. if you search for {{{Task}}} you will get all tiddlers containing 'Task', but also '~Complet"+"edTask', '~TaskForce' etc.\n\nIf you only want to get the tiddlers that contain 'exactly the word' you"+" need to prefix it with a '='. E.g. typing '=Task' will find the tiddlers that contain the word 'Tas"+"k', ignoring words that just contain 'Task' as a substring.\n\n!~CaseSensitiveSearch and ~RegExpSearch"+"\nThe standard search options ~CaseSensitiveSearch and ~RegExpSearch are fully supported by YourSearc"+"h. However when ''~RegExpSearch'' is on Filtered and Boolean Search are disabled.\n\nIn addition you m"+"ay do a \"regular expression\" search even with the ''~RegExpSearch'' set to false by directly enterin"+"g the regular expression into the search field, framed with {{{/.../}}}. \n\nExample: {{{/m[ae][iy]er/"+"}}} will find all tiddlers that contain either \"maier\", \"mayer\", \"meier\" or \"meyer\".\n\n!~JavaScript E"+"xpression Filtering\nIf you are familiar with JavaScript programming and know some TiddlyWiki interna"+"ls you may also use JavaScript expression for the search. Just enter a JavaScript boolean expression"+" into the search field, framed with {{{ { ... } }}}. In the code refer to the variable tiddler and e"+"valuate to {{{true}}} when the given tiddler should be included in the result. \n\nExample: {{{ { tidd"+"ler.modified > new Date(\"Jul 4, 2005\")} }}} returns all tiddler modified after July 4th, 2005.\n\n!Com"+"bined Search\nYou are free to combine the various search options. \n\n''Examples''\n|!What you type|!Res"+"ult|\n|{{{!jonny !jeremy -%football}}}|all tiddlers with both {{{jonny}}} and {{{jeremy}}} in its tit"+"les, but no {{{football}}} in content.|\n|{{{#=Task}}}|All tiddlers tagged with 'Task' (the exact wor"+"d). Tags named '~CompletedTask', '~TaskForce' etc. are not considered.|\n\n!Access Keys\nYou are encour"+"aged to use the access keys (also called \"shortcut\" keys) for the most frequently used operations. F"+"or quick reference these shortcuts are also mentioned in the tooltip for the various buttons etc.\n\n|"+"!Key|!Operation|\n|{{{Alt-F}}}|''The most important keystroke'': It moves the cursor to the search in"+"put field so you can directly start typing your query. Pressing {{{Alt-F}}} will also display the pr"+"evious search result. This way you can quickly display multiple tiddlers using \"Press {{{Alt-F}}}. S"+"elect tiddler.\" sequences.|\n|{{{ESC}}}|Closes the [[YourSearch Result]]. When the [[YourSearch Resul"+"t]] is already closed and the cursor is in the search input field the field's content is cleared so "+"you start a new query.|\n|{{{Alt-1}}}, {{{Alt-2}}},... |Pressing these keys opens the first, second e"+"tc. tiddler from the result list.|\n|{{{Alt-O}}}|Opens all found tiddlers.|\n|{{{Alt-P}}}|Toggles the "+"'Preview Text' mode.|\n|{{{Alt-'<'}}}, {{{Alt-'>'}}}|Displays the previous or next page in the [[Your"+"Search Result]].|\n|{{{Return}}}|When you have turned off the 'as you type' search mode pressing the "+"{{{Return}}} key actually starts the search (as does pressing the 'search' button).|\n\n//If some of t"+"hese shortcuts don't work for you check your browser if you have other extensions installed that alr"+"eady \"use\" these shortcuts.//";config.shadowTiddlers["YourSearch Options"]="|>|!YourSearch Options|\n|>|<<option chkUseYourSearch>> Use 'Your Search'|\n|!|<<option chkPreviewText"+">> Show Text Preview|\n|!|<<option chkSearchAsYouType>> 'Search As You Type' Mode (No RETURN required"+" to start search)|\n|!|Default Search Filter:<<option chkSearchInTitle>>Title ('!') <<option chk"+"SearchInText>>Text ('%') <<option chkSearchInTags>>Tags ('#') <<option chkSearchExtendedFiel"+"ds>>Extended Fields<html><br><font size=\"-2\">The fields of a tiddlers that are searched when you don"+"'t explicitly specify a filter in the search text <br>(Explictly specify fields using one or more '!"+"', '%', '#' or 'fieldname:' prefix before the word/text to find).</font></html>|\n|!|Number of items "+"on search result page: <<option txtItemsPerPage>>|\n|!|Number of items on search result page with pre"+"view text: <<option txtItemsPerPageWithPreview>>|\n";config.shadowTiddlers["YourSearchStyleSheet"]="/***\n!~YourSearchResult Stylesheet\n***/\n/*{{{*/\n.yourSearchResult {\n\tposition: absolute;\n\twidth: 800"+"px;\n\n\tpadding: 0.2em;\n\tlist-style: none;\n\tmargin: 0;\n\n\tbackground: #ffd;\n\tborder: 1px solid DarkGra"+"y;\n}\n\n/*}}}*/\n/***\n!!Summary Section\n***/\n/*{{{*/\n.yourSearchResult .summary {\n\tborder-bottom-width:"+" thin;\n\tborder-bottom-style: solid;\n\tborder-bottom-color: #999999;\n\tpadding-bottom: 4px;\n}\n\n.yourSea"+"rchRange, .yourSearchCount, .yourSearchQuery {\n\tfont-weight: bold;\n}\n\n.yourSearchResult .summary ."+"button {\n\tfont-size: 10px;\n\n\tpadding-left: 0.3em;\n\tpadding-right: 0.3em;\n}\n\n.yourSearchResult .summa"+"ry .chkBoxLabel {\n\tfont-size: 10px;\n\n\tpadding-right: 0.3em;\n}\n\n/*}}}*/\n/***\n!!Items Area\n***/\n/*{{{*"+"/\n.yourSearchResult .marked {\n\tbackground: none;\n\tfont-weight: bold;\n}\n\n.yourSearchItem {\n\tmargin-to"+"p: 2px;\n}\n\n.yourSearchNumber {\n\tcolor: #808080;\n}\n\n\n.yourSearchTags {\n\tcolor: #008000;\n}\n\n.yourSearc"+"hText {\n\tcolor: #808080;\n\tmargin-bottom: 6px;\n}\n\n/*}}}*/\n/***\n!!Footer\n***/\n/*{{{*/\n.yourSearchFoote"+"r {\n\tmargin-top: 8px;\n\tborder-top-width: thin;\n\tborder-top-style: solid;\n\tborder-top-color: #999999;"+"\n}\n\n.yourSearchFooter a:hover{\n\tbackground: none;\n\tcolor: none;\n}\n/*}}}*/\n/***\n!!Navigation Bar\n***/"+"\n/*{{{*/\n.yourSearchNaviBar a {\n\tfont-size: 16px;\n\tmargin-left: 4px;\n\tmargin-right: 4px;\n\tcolor: bla"+"ck;\n\ttext-decoration: underline;\n}\n\n.yourSearchNaviBar a:hover {\n\tbackground-color: none;\n}\n\n.yourSe"+"archNaviBar .prev {\n\tfont-weight: bold;\n\tcolor: blue;\n}\n\n.yourSearchNaviBar .currentPage {\n\tcolor: #"+"FF0000;\n\tfont-weight: bold;\n\ttext-decoration: none;\n}\n\n.yourSearchNaviBar .next {\n\tfont-weight: bold"+";\n\tcolor: blue;\n}\n/*}}}*/\n";config.shadowTiddlers["YourSearchResultTemplate"]="<!--\n{{{\n-->\n<span macro=\"yourSearch if found\">\n<!-- The Summary Header ============================"+"================ -->\n<table class=\"summary\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"+"<tbody>\n <tr>\n\t<td align=\"left\">\n\t\tYourSearch Result <span class=\"yourSearchRange\" macro=\"yourSearc"+"h itemRange\"></span>\n\t\t of <span class=\"yourSearchCount\" macro=\"yourSearch count\"></span>\n"+"\t\tfor <span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>\n\t</td>\n\t<td class=\"yourSea"+"rchButtons\" align=\"right\">\n\t\t<span macro=\"yourSearch chkPreviewText\"></span><span class=\"chkBoxLabel"+"\">preview text</span>\n\t\t<span macro=\"yourSearch newTiddlerButton\"></span>\n\t\t<span macro=\"yourSearch openAllButton\"></span>\n\t\t<span macro=\"yourSearch lin"+"kButton 'YourSearch Options' options 'Configure YourSearch'\"></span>\n\t\t<span macro=\"yourSearch linkB"+"utton 'YourSearch Help' help 'Get help how to use YourSearch'\"></span>\n\t\t<span macro=\"yourSearch clo"+"seButton\"></span>\n\t</td>\n </tr>\n</tbody></table>\n\n<!-- The List of Found Tiddlers ================="+"=========================== -->\n<div id=\"yourSearchResultItems\" itemsPerPage=\"25\" itemsPerPageWithPr"+"eview=\"10\"></div>\n\n<!-- The Footer (with the Navigation) ==========================================="+"= -->\n<table class=\"yourSearchFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody"+">\n <tr>\n\t<td align=\"left\">\n\t\tResult page: <span class=\"yourSearchNaviBar\" macro=\"yourSearch naviBar"+"\"></span>\n\t</td>\n\t<td align=\"right\"><span macro=\"yourSearch version\"></span>, <span macro=\"yourSearc"+"h copyright\"></span>\n\t</td>\n </tr>\n</tbody></table>\n<!-- end of the 'tiddlers found' case ========="+"================================== -->\n</span>\n\n\n<!-- The \"No tiddlers found\" case ================="+"========================== -->\n<span macro=\"yourSearch if not found\">\n<table class=\"summary\" border="+"\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n <tr>\n\t<td align=\"left\">\n\t\tYourSearch Resu"+"lt: No tiddlers found for <span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>.\n\t</td>\n\t<t"+"d class=\"yourSearchButtons\" align=\"right\">\n\t\t<span macro=\"yourSearch newTiddlerButton\"></span>\n\t\t<span macro=\"yourSearch linkButton 'YourSearch Options'"+" options 'Configure YourSearch'\"></span>\n\t\t<span macro=\"yourSearch linkButton 'YourSearch Help' help"+" 'Get help how to use YourSearch'\"></span>\n\t\t<span macro=\"yourSearch closeButton\"></span>\n\t</td>\n <"+"/tr>\n</tbody></table>\n</span>\n\n\n<!--\n}}}\n-->\n";config.shadowTiddlers["YourSearchItemTemplate"]="<!--\n{{{\n-->\n<span class='yourSearchNumber' macro='foundTiddler number'></span>\n<span class='yourSea"+"rchTitle' macro='foundTiddler title'/></span> - \n<span class='yourSearchTags' macro='found"+"Tiddler field tags 50'/></span>\n<span macro=\"yourSearch if previewText\"><div class='yourSearchText' macro='fo"+"undTiddler field text 250'/></div></span>\n<!--\n}}}\n-->";config.shadowTiddlers["YourSearch"]="<<tiddler [[YourSearch Help]]>>";config.shadowTiddlers["YourSearch Result"]="The popup-like window displaying the result of a YourSearch query.";config.macros.search.handler=_109;var _195=function(){if(config.macros.search.handler!=_109){alert("Message from YourSearchPlugin:\n\n\nAnother plugin has disabled the 'Your Search' features.\n\n\nYou may "+"disable the other plugin or change the load order of \nthe plugins (by changing the names of the tidd"+"lers)\nto enable the 'Your Search' features.");}};setTimeout(_195,5000);abego.YourSearch.getStandardRankFunction=function(){return _bb;};abego.YourSearch.getRankFunction=function(){return abego.YourSearch.getStandardRankFunction();};abego.YourSearch.getCurrentTiddler=function(){return _f4;};abego.YourSearch.closeResult=function(){_e3();};abego.YourSearch.getFoundTiddlers=function(){return _b1;};abego.YourSearch.getQuery=function(){return _b2;};abego.YourSearch.onShowResult=function(_196){highlightHack=_b2?_b2.getMarkRegExp():null;if(!_196){_f5.setItems(_b5());}if(!_dd){_dd=createTiddlyElement(document.body,"div",_da,"yourSearchResult");}else{if(_dd.parentNode!=document.body){document.body.appendChild(_dd);}}_fe();highlightHack=null;};})();}
//%/
/***
!~YourSearchResult Stylesheet
***/
/*{{{*/
.yourSearchResult {
position: relative;
width: 300px;
padding: 0.2em;
list-style: none;
margin: 0;
background: #CCC;
border: none;
z-index:799;
}
/*}}}*/
/***
!!Summary Section
***/
/*{{{*/
.yourSearchResult .summary {
display:none;
border-bottom-width: thin;
border-bottom-style: solid;
border-bottom-color: #999999;
padding-bottom: 4px;
}
.yourSearchRange, .yourSearchCount, .yourSearchQuery {
font-weight: bold;
}
.yourSearchResult .summary .button {
font-size: 10px;
padding-left: 0.3em;
padding-right: 0.3em;
}
.yourSearchResult .summary .chkBoxLabel {
font-size: 10px;
padding-right: 0.3em;
}
/*}}}*/
/***
!!Items Area
***/
/*{{{*/
.yourSearchResult .marked {
background: none;
font-weight: bold;
}
.yourSearchItem {
margin-top: 2px;
}
.yourSearchNumber {
color: #808080;
}
.yourSearchTags {
color: #008000;
}
.yourSearchText {
color: #808080;
margin-bottom: 6px;
}
/*}}}*/
/***
!!Footer
***/
/*{{{*/
.yourSearchFooter {
display:none;
margin-top: 8px;
border-top-width: thin;
border-top-style: solid;
border-top-color: #999999;
}
.yourSearchFooter a:hover{
display:none;
background: none;
color: none;
}
/*}}}*/
/***
!!Navigation Bar
***/
/*{{{*/
.yourSearchNaviBar a {
font-size: 16px;
margin-left: 4px;
margin-right: 4px;
color: black;
text-decoration: underline;
}
.yourSearchNaviBar a:hover {
background-color: none;
}
.yourSearchNaviBar .prev {
font-weight: bold;
color: blue;
}
.yourSearchNaviBar .currentPage {
color: #FF0000;
font-weight: bold;
text-decoration: none;
}
.yourSearchNaviBar .next {
font-weight: bold;
color: blue;
}
/*}}}*/
/***
!Default tiddlers layout
***/
/*{{{*/
[
{id: 'tiddlerForStarters', x: 819, y: 226, z: 1, width: 186, height: 174, collapsed: false},
{id: 'tiddlertiddlydesktopElements', x: 213, y: 39, z: 2, width: 583, height: 462, collapsed: false},
{id: 'tiddlerSearch', x: 820, y: 43, z: 3, width: 180, height: 150, collapsed: false},
{id: 'tiddlerMakeAnew', x: 10, y: 43, z: 4, width: 180, height: 150, collapsed: false},
{id: 'tiddlerCloseAndSave', x: 227, y: 91, z: 5, width: 193, height: 150, collapsed: false}
]
/*}}}*/
!usage
{{{[img[bg_pattern_dot.gif]]}}}
[img[bg_pattern_dot.gif]]
!notes
//none//
!type
image/gif
!file
./bg_pattern_dot.gif
!url
!data
data:image/gif;base64,R0lGODlhBAAEAIABAOHo7v///yH5BAEAAAEALAAAAAAEAAQAAAIEjI8JBQA7
!usage
{{{[img[btn_resize.png]]}}}
[img[btn_resize.png]]
!notes
//none//
!type
image/png
!file
./btn_resize.png
!url
!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbRJREFUOMudkk9rU0EUxX933ryg5Jsobm03bW3SSvsJrKv2MxUX6kYXCiKouBUX0o1umiYGTWigrVa0oGAguMh7M3NcvJgi1D/pwIW5A/dwfneOSeI8Z/vFqlICf57hWy9X1PvylhBsdoE7O031T7rTfiaBe68bGnztkOeGmaFZBB60lnXwvYPPDTPAhPSfCI+6SzoatvG5gTnMQDJSJty/hp/0FnU82sPXhM/h83GN9cUmmReZ198dPNtf0Kcfe/jccMEwia2bi0jgDMzA/pSD54MlfRztTuxCiEYojLKsqhg7xoU7G+Fp/5qOhrs4B5kX3XaductrmIODwUUac9fBwDgD4XF3WR9GLfLcSEkIY2ujsi3B5sYCiKqw3xEetho6HLbIa8JnCZepQsCIYYJROsrCKAujGNspwv03TfVO2sRkxBJ67+pcvbROCI73nTrzV9aIwTgcXKA5v0qMRpKrEO7uNLX/rUPuwaqUsHmjsl0Wv+4ilKfvMUIMYLdfrah/0q5ynQvvReYTLoNskjgEKVnlLhghQJj8ho/RCNGme5AgyeGiiAaYTReYJgIxGiEYMcJPouzs1zCI2FsAAAAASUVORK5CYII=
You can also use the ThemedTiddlerPlugin that looks for a theme field
set on a tiddler.
You can get it here
http://whatfettle.com/2008/07/ThemedTiddlerPlugin/
This is good to use if you want to change the structure of the tiddler
as well as the style of it.
Another option is to use my AddClassPlugin, which adds a class to a
tiddler so that you can apply CSS only to the tiddlers that have that
class. This is how the stickynotes[1] space works.
You can get it from
http://colmbritton.tiddlyspace.com/#AddClassPlugin
Then you just need to add
Class: <div class='editor' macro='edit classname'></div>
to your editTemplate and you can now add any class you want to a
tiddler
Hope that helps,
Colm
[1] - http://stickynotes.tiddlyspace.com
en add <span macro='addClass'></span>
to viewtemplate
The stickynote themedtiddler is based on Colm Britton's [[stickynotes|http://stickynotes.tiddlyspace.com/]] who said: "I think it would be cool if you could move them around"...
I retained his moz-shadow but threw out the cool transform bits, because when using chrome or IE it interferes with the resize function of the dekstop
I haven't been combining the two for a long time, so more problems will certainly pop up, but here's the thing so far:
* any shadow tiddler that you haven't been editing before putting in the desktopplugin will not be editable.
* the 'save layout' and 'restore layout' macro will not work. The macro writes your layout fine to the [[__tiddlyDesktopLayout]] tiddler but then tiddlyspace refuses to save it.
The 'empty' version lives at http://tiddlydesktop.tiddlyspace.com
/***
|Name|tiddlyDesktopBundle packed and ~StyleSheet definitions placed in theme tiddler|
|Description|Essential plugins for TiddlyDesktop theme modified for use with current ~TiddlyWiki version and default style (shadowed styles and templates added to a systemTheme tiddler)|
|Requires|tiddlyDesktopTheme, InlineJavascriptPlugin, OpenTaggedTiddlers, batchTagToolsBundle, TagToolTemplate|
|Source|http://www.digitaldimsum.co.uk/tiddlywiki/|
|Author|JonnyLeRoy|
***/
/***
!.FunctionDecorator
Thanks to [[Roman Porotnikov|http://www.jroller.com/page/deep/20030701]] - note: this systemConfig needs to be evaluated before other ones that use the Aspects so the name starts with "."
***/
/*{{{*/
Aspects=new Object();Aspects.addBefore=function(C,D,A){var B=C[D];C[D]=function(){return B.apply(this,A(arguments,B,this))}};Aspects.addAfter=function(B,D,C){var A=B[D];B[D]=function(){return C(A.apply(this,arguments),arguments,A,this)}};Aspects.addAround=function(C,D,A){var B=C[D];C[D]=function(){return A(arguments,B,this)}};
/*}}}*/
/***
|Name|JumpMacro|
|Author|Saq Imtiaz|
|Source|http://tw.lewcid.org/svn/plugins|
|License|http://creativecommons.org/licenses/by-sa/3.0/|
***/
/*{{{*/
config.macros.jump={};config.macros.jump.handler=function(a,b,c,d,e,f){var g=(c[0]&&c[0]!=".")?c[0]:"jump";var h=(c[1]&&c[1]!=".")?c[1]:"jump to an open tiddler";var i=(c[2]&&c[2]=="top")?true:false;var j=createTiddlyButton(a,g,h,this.onclick);if(i==true){j.setAttribute("top","true")}};config.macros.jump.onclick=function(e){if(!e){var e=window.event}var c=resolveTarget(e);var d=c.getAttribute("top");var f=Popup.create(this);if(f){if(d=="true"){createTiddlyButton(createTiddlyElement(f,"li"),"Top \u2191","Top of TW",config.macros.jump.top);createTiddlyElement(f,"hr")}story.forEachTiddler(function(a,b){createTiddlyLink(createTiddlyElement(f,"li"),a,true)})}Popup.show(f,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation()}return false};config.macros.jump.top=function(){window.scrollTo(0,0)};
/*}}}*/
/***
|Name|JumpMacro|
|Author|Saq Imtiaz|
|Source|http://tw.lewcid.org/svn/plugins|
|License|http://creativecommons.org/licenses/by-sa/3.0/|
***/
/*{{{*/
config.macros.jump={};config.macros.jump.handler=function(a,b,c,d,e,f){var g=(c[0]&&c[0]!=".")?c[0]:"jump";var h=(c[1]&&c[1]!=".")?c[1]:"jump to an open tiddler";var i=(c[2]&&c[2]=="top")?true:false;var j=createTiddlyButton(a,g,h,this.onclick);if(i==true){j.setAttribute("top","true")}};config.macros.jump.onclick=function(e){if(!e){var e=window.event}var c=resolveTarget(e);var d=c.getAttribute("top");var f=Popup.create(this);if(f){if(d=="true"){createTiddlyButton(createTiddlyElement(f,"li"),"Top \u2191","Top of TW",config.macros.jump.top);createTiddlyElement(f,"hr")}story.forEachTiddler(function(a,b){createTiddlyLink(createTiddlyElement(f,"li"),a,true)})}Popup.show(f,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation()}return false};config.macros.jump.top=function(){window.scrollTo(0,0)};
/*}}}*/
/***
!Collapse / Expand all tiddlers
***/
/*{{{*/
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'\\w'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.4.9={5:"fold 6",3:"Collapse 6 p f"};2.4.9.d=0(a){b(a,1.5,1.3,0(){q.9();g 7})};o.n.9=0(){1.m(0(a,e){2.l.k.j(a,i,7)})};2.4.8={5:"h 6",3:"h 6 p f"};2.4.8.d=0(a){b(a,1.5,1.3,0(){q.8();g 7})};o.n.8=0(){1.m(0(a,e){2.l.k.j(a,7,i)})};2.4.c={5:"cascade",3:"Layout 6 open f nicely"};2.4.c.d=0(a){b(a,1.5,1.3,0(){layout.c();g 7})};',[],27,'function|this|config|prompt|macros|label|all|false|expandAll|collapseAll||createTiddlyButton|autoLayout|handler||Tiddlers|return|expand|true|toggle|collapseTiddler|commands|forEachTiddler|prototype|Story|visible|story'.split('|'),0,{}))
/*}}}*/
/***
!Collapse Tiddler
***/
/*{{{*/
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'\\w'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4.7.h.3={6:"-",k:"Collapse 0 x",9:"+",l:"Expand 0 x"};4.commands.3={6:4.7.h.3.6,k:4.7.h.3.k,9:4.7.h.3.9,l:4.7.h.3.l,handler:8(a,b,c){0.v(c,u,u)},v:8(a,b,c){2 d=document.getElementById(story.idPrefix+a);2 e=0.q(d);2 f=0.p(d);5(c&&f.1.y=="o"){0.n(d,f,e,"block",d.1.w,0.6,0.k)}else{5(b){5(d.1.j){d.1.w=d.1.j}0.n(d,f,e,"o",f.1.j,0.9,0.l)}}},q:8(a){2 b=a.getElementsByTagName("a");t(i s b){2 c=b[i];5(c.m==0.6||c.m==0.9){r c}}},p:8(a){2 b=a.childNodes;t(i s b){2 c=b[i];5(c&&c.className=="collapsible"){r c}}},n:8(a,b,c,d,e,f,g){b.1.y=d;c.m=f;c.setAttribute("title",g);5(typeof e!="undefined"){a.1.j=e}a.collapsed=d=="o"}};',[],35,'this|style|var|collapseTiddler|config|if|text|views|function|toggleText||||||||wikified||height|tooltip|toggleTooltip|innerHTML|toggleDisplay|none|findCollapseDiv|getCollapseLink|return|in|for|true|toggle|_0|tiddler|display'.split('|'),0,{}))
/*}}}*/
/***
!Core Drag Functionality
Borrowed from [[DOM Drag|http://www.youngpup.net]] with some changes
***/
/*{{{*/
var Drag={obj:null,init:function(B,A){B.onmousedown=Drag.start;B.root=A&&A!=null?A:B;if(isNaN(parseInt(B.root.style.left))){B.root.style.left="0px"}if(isNaN(parseInt(B.root.style.top))){B.root.style.top="0px"}B.root.onDragStart=new Function();B.root.onDragEnd=new Function();B.root.onDrag=new Function()},start:function(B){var C=Drag.obj=this;B=Drag.fixE(B);var D=parseInt(C.root.style.top);var A=parseInt(C.root.style.left);C.root.onDragStart(A,D);C.lastMouseX=B.clientX;C.lastMouseY=B.clientY;document.onmousemove=Drag.drag;document.onmouseup=Drag.end;return false},drag:function(E){E=Drag.fixE(E);var F=Drag.obj;var C=E.clientY;var D=E.clientX;var H=parseInt(F.root.style.top);var B=parseInt(F.root.style.left);var A,G;A=B+((D-F.lastMouseX)*1);G=H+((C-F.lastMouseY)*1);if(G<TiddlyDesktop.canvas.top){G=TiddlyDesktop.canvas.top}if(A+F.clientWidth<TiddlyDesktop.canvas.left){A=TiddlyDesktop.canvas.left-F.clientWidth}Drag.obj.root.style.left=A+"px";Drag.obj.root.style.top=G+"px";Drag.obj.root.clientX=A+"px";Drag.obj.root.clientY=G+"px";Drag.obj.lastMouseX=D;Drag.obj.lastMouseY=C;Drag.obj.root.onDrag(A,G);return false},end:function(){document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style.left),parseInt(Drag.obj.root.style.top));Drag.obj=null},fixE:function(A){if(typeof A=="undefined"){A=window.event}if(typeof A.layerX=="undefined"){A.layerX=A.offsetX}if(typeof A.layerY=="undefined"){A.layerY=A.offsetY}return A}};
/*}}}*/
/***
!Drag Tiddler
***/
/*{{{*/
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'\\w'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 e;5 8(){f(e==2){i}e=2;3 A=2.q;A.n(2);A.l(2);9.8(2)}6.7.o=6.7.t;6.7.t=5(A,G,D,B,F){2.o(A,G,D,B,F);3 C=k.h(2.idPrefix+G);3 E=C.getElementsByTagName("div")[0];9.w(C);C.8=8;C.onmousedown=8;C.8();g.u.s.toggle(G,r,d);9.p(C,d);f(E){E.c=5(){2.4.height="28px"};E.c();E.ondblclick=5(H){2.c();H=fixE(H);g.u.s.handler(H,null,G);H.cancelBubble=d;f(H.j){H.j()}};Drag.init(E,C);C.onDragStart=5(H,I){2.4.a=2.4.b;2.4.b="red"};C.onDragEnd=5(H,L){2.4.b=2.4.a?2.4.a:"#999";9.p(2,r);3 I=k.h("sidebar");3 J=I.q;3 K=I.offsetTop;J.n(I);J.l(I);I.4.top=K+"px"}}};6.7.m=6.7.v;6.7.v=5(D,A,B){3 C=2.m(D,A,B);9.w(C);i C};',[],33,'||this|var|style|function|Story|prototype|bringToFront|layout|borderColor_old|borderColor|fixHeight|true|lastClicked|if|config|getElementById|return|stopPropagation|document|appendChild|old_refreshTiddler|removeChild|old_displayTiddler|add|parentNode|false|collapseTiddler|displayTiddler|commands|refreshTiddler|limitHeight'.split('|'),0,{}))
/*}}}*/
/***
!Tiddler Layout
***/
/*{{{*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)<36?c.toString(36):String.fromCharCode(c+29))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'\\w{1,2}'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8 U(){}U.I={i:[],add:8(C,A){h B={j:C.j,x:findPosX(C),y:findPosY(C),z:7.i.w,1b:8(){h D=Q.O(7.j);v"\\n{j: \'%0\', x: %1, y: %2, z: %3, m: %4, r: %5, W: %6}".1c([7.j,7.x,7.y,7.z,D.K,D.1a,(!!D.W)])}};7.M(C);9(A){7.J(B,C,18)}7.i.17(B);7.i.S(8(E,D){v E.x-D.x})},J:8(C,B,A){9(A){7.s(C)}B.k.J="absolute";B.k.P=C.x+"o";B.k.X=C.y+"o";B.11()},s:8(A){q(t p 7.i){h B=7.i[t];9(10.Z(B.x-A.x)<G.s.P){A.x+=G.s.P;9(10.Z(B.y-A.y)<G.s.X){A.y+=G.s.X}}}},M:8(A){q(t p 7.i){h B=7.i[t];9(B.j==A.j){7.i.splice(t,1);break}}},autoLayout:8(){h A=[];q(t p 7.i){9(7.i[t].j){A.17(7.i[t].j.Y(u.L.w))}}u.closeAllTiddlers();u.displayTiddlers(V,A.reverse())},11:8(A){h B=7.i.S(8(F,E){v F.z-E.z});h D=B.w;q(t p B){h C=B[t];9(C.j==A.j){D=C.z;C.z=B.w}T{9(C.z>D){C.z--}}}},marshall:8(){v"[%0\\n]".1c([7.i.1b()])},unmarshall:8(c){h d=eval(c).S(8(a,b){v a.z-b.z});q(t p d){9(d[t].j){h e=d[t];h f=e.j.Y(u.L.w);u.displayTiddler(V,f);h g=Q.O(e.j);7.J(e,g,19);9(e.m){g.k.m=e.m+"o";g.k.r=e.r+"o";9(e.W){config.commands.collapseTiddler.toggle(f,18,19)}T{g.l.k.m=(e.m-15)+"o";g.l.k.r=(e.r-60)+"o"}}}}},N:8(A){A.14=8(){h B=7.getElementsByTagName("div");q(d p B){h C=B[d];9(C&&C.16=="l"){7.l=C}T{9(C&&C.16=="H"){7.H=C}}}};A.N=8(){7.14();9(7.1a>400){7.l.k.r="380px"}9(7.l&&7.l.K>=7.H.K){7.l.k.m=(7.H.K-15)+"o"}};A.N()}};h 13=new U();R.I.12=R.I.1d;R.I.1d=8(D,A,C){h B=Q.O(7.L+D);9(B!=V){13.M(B)}7.12(D,A,C)};',[],76,'|||||||this|function|if||||||||var|tiddlers|id|style|scrollable|width||px|in|for|height|cascade||story|return|length||||||||||TiddlyDesktop|windowBar|prototype|position|clientWidth|idPrefix|remove|limitHeight|getElementById|left|document|Story|sort|else|Layout|null|collapsed|top|substring|abs|Math|bringToFront|old_closeTiddler|layout|findMovingParts||className|push|true|false|clientHeight|toString|format|closeTiddler'.split('|'),0,{}))
/*}}}*/
/***
!Save Layout
Save the layout to a tiddler for redisplaying later
***/
/*{{{*/
config.macros.saveLayout={label:"save layout",prompt:"Save the current layout as the default",handler:function(A,D,F,C,E,B){createTiddlyButton(A,this.label,this.prompt,this.saveLayout)},saveLayout:function(){var A="__tiddlyDesktopLayout";var C=layout.marshall();C="/***\n!Default tiddlers layout\n***/\n/*{{{*/\n"+C+"\n/*}}}*/\n";var B=store.saveTiddler(A,A,C,config.options.txtUserName,new Date(),"excludeLists");if(config.options.chkAutoSave){saveChanges()}}};config.macros.restoreLayout={label:"restore layout",prompt:"Restores the last saved layout",handler:function(A,D,F,C,E,B){createTiddlyButton(A,this.label,this.prompt,restart)}};this["restart"]=function(){var A=store.getTiddlerText("__tiddlyDesktopLayout");var B=store.getTiddlerText("DefaultTiddlers");if(window.location.hash){story.displayTiddlers(null,convertUTF8ToUnicode(decodeURI(window.location.hash.substr(1))).readBracketedList())}else{if(A){layout.unmarshall(A)}else{if(B){story.displayTiddlers(null,B.readBracketedList())}}}};
/*}}}*/
/***
!Core Sizer Functionality
Structure taken from [[DOM Drag|http://www.youngpup.net]]
***/
/*{{{*/
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'\\w'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 1={5:j,c:0,d:0,b:0,9:0,init:6(B,A){B.onmousedown=1.k;B.2=A&&A!=j?A:B;B.2.onSizeStart=u s();B.2.r=u s()},k:6(A){4 B=1.5=this;A=e(A);B.2.onSizeStartPre(A);1.9=m(B.2.offsetHeight);1.b=m(B.2.offsetWidth);B.2.8.l=1.9+"7";B.2.8.n=1.b+"7";1.c=A.o;1.d=A.x;B.2.onSizeStartPost(A);3.v=3.i;3.t=3.h;3.i=1.w;3.h=1.q;f p},w:6(C){C=e(C);4 B=(C.o-1.c);4 E=(C.x-1.d);4 A=B+1.b;4 D=E+1.9;g(A<a){A=a}g(D<a){D=a}1.5.2.8.n=A+"7";1.5.2.8.l=D+"7";1.5.2.r(B,E);f p},q:6(){3.i=3.v;3.h=3.t;1.5=j}};6 e(A){g(typeof A=="undefined"){A=window.event}f A};',[],34,'|Sizer|root|document|var|obj|function|px|style|startHeight|100|startWidth|startX|startY|fixE|return|if|onmouseup|onmousemove|null|start|height|parseInt|width|clientX|false|end|onSize|Function|_1|new|_0|drag|clientY'.split('|'),0,{}))
/*}}}*/
/***
!Resize Tiddler
***/
/*{{{*/
config.macros.sizer={};config.macros.sizer.handler=function(H,G,F,E,D,C){var B=createTiddlyElement(H,"span",null,"resizer","");var A=document.getElementById(story.idPrefix+C.title);Sizer.init(B,A);A.onSizeStartPre=function(){this.findMovingParts();this.scrollable.startHeight=parseInt(this.scrollable.offsetHeight);this.scrollable.startWidth=parseInt(this.scrollable.offsetWidth);this.windowBar.startHeight=parseInt(this.windowBar.clientHeight)};A.onSizeStartPost=function(){this.windowBar.fixHeight()};A.onSize=function(J,L){var I=J+this.scrollable.startWidth;var K=L+this.scrollable.startHeight;if(I<80){I=80}if(K<50){K=50}this.scrollable.style.width=I+"px";this.scrollable.style.height=K+"px";this.windowBar.fixHeight()}};
/*}}}*/
/***
!CloseAllPreOpenAllTags
Requires http://www.digitaldimsum.co.uk/#_.FunctionDecorator
***/
/*{{{*/
Aspects.addBefore(this,"onClickTagOpenAll",function(A){story.closeAllTiddlers();return A});
/*}}}*/
/***
!Tiddly Desktop
Core stuff - should move more functionality (like decorating Tiddlers) into here
***/
/*{{{*/
var TiddlyDesktop={canvas:{top:39,left:60},cascade:{top:20,left:20}};
/*}}}*/
//{{{
function checkDisplay(c){var d=c["displayMessage"];c["displayMessage"]=function(a,b){d.apply(this,arguments);setTimeout(clearMessage,10000)}}checkDisplay(this);
//}}}
//{{{
config.commands.jump.text="↗";
config.commands.closeOthers.text="☼";
config.commands.closeTiddler.text="✕"
//}}}
See for a general introduction to the TiddlyDesktop: http://tiddlyhome.bidix.info/desk/
These are my additional findings:
* you /will/ need the divs 'windowBar', 'collapsible' and 'scrollable' as 'headdiv' or they'll lose their functionality. Windowbar ensures the drag/move function, collapsible of course the collapse function, scrollable gives your tiddler the scrollbar but also the scaling when resizing. So wrapping the tiddler in some other div doesn't work, wrapping the tiddler in windowbar neither.
* the red border when moving a tiddler is 'hardcoded' in the plugin. I left it as is to give you the original desktopbundle. In the stickynotetheme it's overridden by putting the bordercolor to !important.
* the limit above which you can't place a tiddler on the top of your screen is also hardcoded.
* when using images you will need to set their size to 100%,100% or they won't resize with the tiddler. Use the imagesizeplugin for tiddlylinks and the appropriate html for external links. For SVG you'll need to set the code to : width="100%" height="100%" viewBox="0 0 somevalue somevalue".
* normal search only displays the first found tiddler. I used Udo's YourSearchPlugin.
* the 'jump to tiddler' macro doesn't work in the horizontal axis, which means when you put a tiddler to the right of your original viewport the jump does scroll down but not sideways. I put up a question about this in the tiddlywikigroup, but there hasn't been a solution yet: http://groups.google.com/group/tiddlywiki/browse_thread/thread/520f069deb9b365c/5cb2966a1e80c385?lnk=gst&q=jump+to#5cb2966a1e80c385
!usage
{{{[img[white_gradient.png]]}}}
[img[white_gradient.png]]
!notes
//none//
!type
image/png
!file
./white_gradient.png
!url
!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAAEeCAYAAABcyXrWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB5BJREFUeNrt1LuqXWUYRuHd2FiksUhhI2ghWKRQCCgIgiBYiCgGEUQCigkxgRDxLIrGs17zdhWrmPysbM0uxjeLpxg38PLynJ2fn/9zyf5+jP76j/58jP440e9Lv53o1//RL0sPj/38iH5a+vGCflj6ftN3S99u+ubQ15u+Wvpy0xdLn296sHR/071Nd5c+O3bn0O2lW8c+PfTJpo+Xbm76aNOHSx9sen/pxqH3jr176J1Nb296a+nNpTc2vb702tKrm1459vKx60svbXrx0LWlF070/NJzx57d9MzS0ye6eqKnHtGVEz15QU9c0NllO4MOdKADnRKdy8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzopPNCBDnSgk8IDHehABzq7hQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdHYFD3SgAx3opPBABzrQgU4KD3SgAx3opPBABzrQgU4KD3SgAx3opPBABzrQgU4KD3SgAx3opPBABzrQgc5u4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnRQe6EAHOtBJ4YEOdKADnXF4oAMd6EAnhQc60IEOdFJ4oAMd6EAnhQc60IEOdFJ4oAMd6EBnFB7oQAc60EnhgQ50oAOdFB7oQAc60EnhgQ50oAOdcXigAx3oQCeFBzrQgQ50UnigAx3oQCeFBzrQgQ50UnigAx3oQGd38EAHOtCBTgoPdKADHeik8EAHOtCBTgoPdKADHeik8EAHOtCBTgoPdKADHeik8EAHOtCBTgoPdKADHeik8EAHOtCBzig80IEOdKCTwgMd6EAHOik80IEOdKCTwgMd6EAHOiPwQAc60IFOCg90oAMd6OwCHuhABzpK4YEOdKCjFB7oQAc6SuGBDnSgoxQe6EAHOkrhgQ50oKNReKADHegohQc60IGOUnigAx3oKIUHOtCBjnYDD3SgAx2l8EAHOtBRCg90oAMdpfBABzrQUQoPdKADHaXwQAc60FEKD3SgAx2NwgMd6EBHKTzQgQ50lMIDHehARyk80IEOdDQGD3SgAx2l8EAHOtBRCg90oAMdjcIDHehARyk80IEOdJTCAx3oQEcpPNCBDnQ0Bg90oAMdpfBABzrQUQoPdKADHeXwQAc60NEYPNCBDnSUwgMd6EBHKTzQgQ50NAoPdKADHaXwQAc60FEKD3SgAx2l8EAHOtDRGDzQgQ50lMIDHehARyk80IEOdDQKD3SgAx2l8EAHOtBRCg90oAMdpfBABzrQ0Rg80IEOdJTCAx3oQEcpPNCBDnQ0Cg90oAMdpfBABzrQUQoPdKADHaXwQAc60NEYPNCBDnSUwgMd6EBHKTzQgQ50NAYPdKADHaXwQAc60FEKD3SgAx2NwgMd6EBHKTzQgQ50lMIDHehARyk80IEOdDQCD3SgAx2l8EAHOtBRDg90oAMdjcIDHehIKTzQgY6UwgMd6EgpPNCBjjQCD3SgI6XwQAc6Ug4PdKAjjcEDHehIKTzQgY6UwgMd6Eij8EAHOlIKD3SgI6XwQAc6UgoPdKAjjcEDHehIKTzQgY6UwgMd6Ehj8EAHOlIKD3SgI6XwQAc60ig80IGOlMIDHehIKTzQgY6UwgMd6Ehj8EAHOlIKD3SgI6XwQAc60ig80IGOlMIDHehIKTzQgY6UwgMd6Eg5PNCBjjQCD3SgI6XwQAc6Ug4PdKAjjcEDHehIKTzQgY6UwgMd6Ehj8EAHOlIKD3SgI6XwQAc60ig80IGOlMIDHehIKTzQgY6UwgMd6Eij8EAHOlIKD3SgI6XwQAc6UgoPdKAjjcEDHehIKTzQgY6UwgMd6Eij8EAHOlIKD3SgI6XwQAc6UgoPdKAjjcIDHehIKTzQgY6UwgMd6EgpPNCBjjQGD3SgI6XwQAc6UgoPdKAjjcADHehIKTzQgY40Ag90nEFK4YGOI0ij8EBHUgoPdCSl8EBHUgoPdCSNwQMdSSk80JGUwgMdSTk80JE0Cg90JKXwQEdSCg90JKXwQEfSODzQkZTCAx1JKTzQkZTCAx1JKTzQkTQKD3QkpfBAR1IKD3QkpfBAR9IIPNCRlMIDHUlj8EBHUgoPdCSl8EBH0ig80JGUwgMdSSk80JGUwgMdSePwQEdSCg90JKXwQEdSCg90JKXwQEfSODzQkZTCAx1JKTzQkZTCAx1JKTzQkbQLeKAjKYUHOpJSeKAjKYUHOpJSeKAjKYUHOpLG4YGOpBQe6EhK4YGOpBQe6EhK4YGOpN3AAx1JKTzQkZTCAx1JKTzQkZTCAx1JKTzQkZTCAx1Ju4HHQJJSeIwjKYXHMJJSeIwiKYXHIJJSeIwhKYVHksAjCTySBB5J4JEk8EgCjySBRxJ4JIFHksAjCTySBB5J4JEk8EjaWf8CWg1fVAtLPwwAAAAASUVORK5CYII=