Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
<<forEachTiddler where 'tiddler.tags.contains("Elev") && tiddler.fields["gang"]&& tiddler.fields["kl"] && tiddler.fields["kl"].contains(10)'
sortBy 'tiddler.title'
write
'(index < 200)? "| !"+(index+1)+" | <<tag "+tiddler.fields["gang"]+" \>\> | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | [img(3em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |[["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>| !<<tag Elev [[Elever i 10.]] \>\> <<tag Kl klasse \>\> |h\n"
+"|!#| <<tag GangOversigt Gang \>\> | <<tag Lærere K-gruppe \>\> | ||h\n"'
end 'count+"stk 10. klasses elever\n"' none '"Ingen 10. klasse elever\n"'>>
<<forEachTiddler where 'tiddler.tags.contains("Elev") && tiddler.fields["gang"]&& tiddler.fields["kl"] && tiddler.fields["kl"].contains(9)'
sortBy 'tiddler.title'
write
'(index < 200)? "|!"+(index+1)+"| <<tag "+tiddler.fields["gang"]+" \>\> | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | [img(3em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |[["+tiddler.title+"]]|\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>| !<<tag Elev [[Elever i 9.]] \>\> <<tag Kl klasse \>\> |h\n"
+"|!#| <<tag GangOversigt Gang \>\> | <<tag Lærere K-gruppe \>\> || |h\n"'
end 'count+"stk 9. klasses elever\n"' none '"Ingen 9. klasse elever\n"'>>
{{mmheading{~AV-udstyr}}}<<treeview2 "AV" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "AV-ID"' >>
<<forEachTiddler where 'tiddler.tags.contains("Lærere") && tiddler.fields["email"]'
sortBy 'tiddler.title.toUpperCase()'
write
'(index < 200)? "|!"+(index+1)+"|[["+tiddler.fields["fuldenavn"] +"|"+tiddler.title +"]]| [["+tiddler.title +"]] |[["+tiddler.fields["email"]+"|mailto:"+tiddler.fields["email"]+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>| !Send mails |h\n"
+"|!| !Navn | !Initialer | !Jobmail |h\n"'
end 'count+" med jobmailadresser\n"' none '"ingen \n"'>>
<<tiddler [[IntroTræblik]]>>
{{tuduSlider{<<slider chkBookSummary Bibliografi 'Andre »'>>}}}
/***
!Metadata:
|''Name:''|ArchivedTimeline|
|''Description:''|Timeline archived monthly.|
|''Version:''|0.7.0|
|''Date:''|Aug 25, 2007|
|''Source:''|http://sourceforge.net/project/showfiles.php?group_id=150646|
|''Author:''|BramChen (bram.chen (at) gmail (dot) com)|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.0.11|
|''Browser:''|Firefox 1.5+; InternetExplorer 6.0|
!Syntax:
{{{<<timeline [modified|created [maxentries [dateFormate]]]>>}}}
!Examples:
{{{<<timeline>>}}}
{{{<<timeline created 10>>}}}
{{{<<timeline modified 10 "MMM DD, YYYY">>}}}
!Revision History:
|''Version''|''Date''|''Note''|
|0.7.0|Jul 25, 2006|Accept a date format parameter|
|0.6.3|Jan 14, 2007|Cleaned codes, Removed config.macros.timeline.slider and config.macros.timeline.onClickSlider|
|0.6.2|Dec 10, 2006|Add monthFormat to display month format for Chinese|
|0.6.1|Aug 12, 2006|A great effect on config.macros.timeline.slider for Firefox, thanks Bob McElrath|
|0.6.0|Jul 25, 2006|Runs compatibly with TW 2.1.0 (rev #403+)|
|0.5.2|Jun 21, 2006|Fixed bugs for dateFormat of TW 2.1|
|~|~|Change default dateFormat to "0DD MMM, YYYY"|
|0.5.1|Jun 04, 2006|Added config.macros.archivedTimeline.orderBy for localization|
|0.5.0|Apr 19, 2006|Fixed bug for twice records of the same date ()|
|~|~|Added Date.prototype.convertToLocalYYYYMMDDHHMM<<br>>in order to backward compatible with 2.0.6-|
|0.4.0|Apr 03, 2006|Added new parameter, {{{<<timeline [sortfield] [maxentries]>>}}}|
|~|~|Added config.options.txtTimelineMaxentries|
|0.3.1|Feb 04, 2006|JSLint checked|
|0.3.0|Feb 04, 2006|Fixed several missing variable declarations|
|0.2.0|Dec 26, 2005|changed for the new feature of Macro timeline of TW 2.0.0 beta 6|
|0.1.0|Nov 3, 2005|Initial release|
!Code section:
***/
//{{{
version.extensions.archivedTimeline = {major: 0, minor: 7, revision: 0,
date: new Date("Aug 26, 2007"),
name: "ArchivedTimeline",
type: "Macro",
author: "BramChen",
source: "http://sourceforge.net/project/showfiles.php?group_id=150646"
};
config.options.txtTimelineMaxentries=0;
config.macros.archivedTimeline = {
tooltips: "Arkiveret efter ",
orderBy:{modified: "ændret", created: "lavet"},
monthFormat: "0DD MMM YYYY",
dateFormat: "0DD MMM YYYY"
};
config.macros.timeline = config.macros.archivedTimeline;
config.macros.timeline.handler = function(place,macroName,params) {
var field = params[0] ? params[0] : "modified";
place.appendChild(document.createTextNode(this.tooltips + this.orderBy[field]));
var tiddlers = store.reverseLookup("tags","excludeLists",false,field);
var lastMonth = ""; var lastDay = ""; var theText = "----\n"; var i = 0;
var last = (params[1])?params[1]:config.options.txtTimelineMaxentries;
last = (isNaN(last)||last<1) ? 0:tiddlers.length-Math.min(tiddlers.length,parseInt(last));
var dateFormat = params[2] ? params[2] : this.dateFormat;
var cookie; var archives;
for (var t=tiddlers.length-1; t>=last; t--) {
var tiddler = tiddlers[t];
var theMonth = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,6);
var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
if(theMonth != lastMonth) {
if (lastMonth === "") {
lastMonth = theMonth;
}
else {
place.appendChild(document.createElement('hr'));
cookie = 'chktimeline'+(i++);
archives = this.formatString(this.monthFormat, lastMonth);
var panel = config.macros.slider.createSlider(place,cookie,archives,this.tooltips + archives);
wikify(theText,panel);
lastMonth = theMonth; theText = '----\n';
}
}
if(theDay != lastDay){
theText += tiddler[field].formatString(dateFormat) + '\n';
lastDay = theDay;
}
theText += '* [[' + tiddler.title + ']]\n';
}
place.appendChild(document.createElement('hr'));
cookie = 'chktimeline'+(i++);
archives = this.formatString(this.monthFormat, lastMonth);
var panel = config.macros.slider.createSlider(place,cookie,archives,this.tooltips + archives);
wikify(theText,panel);
place.appendChild(document.createElement('hr'));
};
config.macros.timeline.formatString = function(template, yyyymm)
{
var dateString = new Date(yyyymm.substr(0,4)+'/'+yyyymm.substr(4,2)+'/01');
template = template.replace(/DDD|0DD|DD/g,'');
return dateString.formatString(template);
};
if (!Date.prototype.convertToLocalYYYYMMDDHHMM){
Date.prototype.convertToLocalYYYYMMDDHHMM = function(){
return(String.zeroPad(this.getFullYear(),4) + String.zeroPad(this.getMonth()+1,2) + String.zeroPad(this.getDate(),2) + String.zeroPad(this.getHours(),2) + String.zeroPad(this.getMinutes(),2));
}
}
//}}}
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|3.9.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|AttachFilePluginFormatters, AttachFileMIMETypes|
|Overrides||
|Description|Store binary files as base64-encoded tiddlers with fallback links for separate local and/or remote file storage|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
!!!!!Documentation
>see [[AttachFilePluginInfo]]
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Revisions
<<<
2008.07.21 [3.9.0] Fixup for FireFox 3: use HTML with separate text+button control instead of type='file' control
|please see [[AttachFilePluginInfo]] for additional revision details|
2005.07.20 [1.0.0] Initial Release
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePlugin= {major: 3, minor: 9, revision: 0, date: new Date(2008,7,21)};
// 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",
sourceReport: "| source file:|{{{%0}}}|\n",
nosourceReport: "| source file:|//none//|\n",
dateReport: "| attached on:|%0 by %1|\n",
notesReport: "| description:|%0|\n",
dataReport: "| embedded:|[[%0|%0]] - {{{type=%1, size=%2 bytes, encoded=%3 bytes}}}|\n",
nodataReport: "| embedded:|//none//|\n",
localReport: "| local file:|/%LOCAL_LINK%/[[%0|%1]]|\n",
nolocalReport: "| local file:|//none//|\n",
URLReport: "| remote link:|/%REMOTE_LINK%/[[%0|%0]]|\n",
noURLReport: "| remote link:|//none//|\n",
imageReport: "image\n<<<\nusage: {{{[img[tooltip|%0]] or [img[tooltip|%0][link]]}}}\n[img[tooltip|%0]]\n<<<\n",
dataBlock: "\n/% DO NOT EDIT BELOW THIS POINT\n---BEGIN_DATA---\n%0;base64,\n%1\n---END_DATA---\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;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 style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
description \
</td><td style="border:0" colspan=2>\
<input type=text name="notes" size=15 autocomplete=off>\
</td></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");
var theDate=(new Date()).formatString(config.macros.timeline.dateFormat);
var theSource = src.value!=src.defaultValue?src.value:"";
var theTitle=form.tiddlertitle.value;
var theLocal = form.local.value!=form.local.defaultValue?form.local.value:"";
var theURL = form.URL.value!=form.URL.defaultValue?form.URL.value:"";
var theNotes = form.notes.value;
var theTags = "attachment excludeMissing "+form.tags.value;
var useData=form.useData.checked;
var useLocal=form.useLocal.checked;
var useURL=form.useURL.checked;
var theMIMEType = form.MIMEType.value.length?form.MIMEType.options[form.MIMEType.selectedIndex].text:"";
// validate checkboxes and get filename
if (useData) {
if (theSource.length) { if (!theLocation) var theLocation=theSource; }
else { alert(this.sourceErr); src.focus(); return false; }
}
if (useLocal) {
if (theLocal.length) { if (!theLocation) var theLocation = theLocal; }
else { alert(this.localErr); form.local.focus(); return false; }
}
if (useURL) {
if (theURL.length) { if (!theLocation) var theLocation = theURL; }
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 (!theTitle || !theTitle.trim().length || theTitle==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 && !theMIMEType.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 theMIMEType=theList.options[i].text; theList.selectedIndex=i; break; }
}
// attach the file
return this.createAttachmentTiddler(theSource, theDate, theNotes, theTags, theTitle,
useData, useLocal, useURL, theLocal, theURL, theMIMEType);
},
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 (theSource, theDate, theNotes, theTags, theTitle,
useData, useLocal, useURL, theLocal, theURL, theMIMEType, noshow) {
// encode the data
if (useData) {
if (!theMIMEType.length) {
alert(this.MIMEErr);
form.MIMEType.selectedIndex=1; form.MIMEType.focus();
return false;
}
var theData = this.readFile(theSource); if (!theData) { return false; }
displayMessage('encoding '+theSource);
var theEncoded = this.encodeBase64(theData);
displayMessage('file size='+theData.length+' bytes, encoded size='+theEncoded.length+' bytes');
}
// generate tiddler and refresh
var theText = "";
theText +=theSource.length?this.sourceReport.format([theSource]):this.nosourceReport;
theText +=this.dateReport.format([theDate,config.options.txtUserName]);
theText +=theNotes.length?this.notesReport.format([theNotes]):"";
theText +=useData?this.dataReport.format([theTitle,theMIMEType,theData.length,theEncoded.length]):this.nodataReport;
theText +=useLocal?this.localReport.format([theLocal,theLocal.replace(/\\/g,"/")]):this.nolocalReport;
theText +=useURL?this.URLReport.format([theURL]):this.noURLReport;
theText +=(theMIMEType.substr(0,5)=="image")?this.imageReport.format([theTitle]):"";
theText +=useData?this.dataBlock.format([theMIMEType,theEncoded]):"";
store.saveTiddler(theTitle,theTitle,theText,config.options.txtUserName,new Date(),theTags);
var panel=document.getElementById("attachPanel"); if (panel) panel.style.display="none";
if (!noshow) { story.displayTiddler(null,theTitle); story.refreshTiddler(theTitle,null,true); }
displayMessage('attached "'+theTitle+'"');
return true;
},
//}}}
// // base64 conversion
//{{{
encodeBase64:
function (theData) {
if (!theData) 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<theData.length; ) {
chr1=theData.charCodeAt(i++);
chr2=theData.charCodeAt(i++);
chr3=theData.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="";
count+=4; if (count>60) { out+='\n'; count=0; } // add line break every 60 chars for readability
}
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|3.7.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1.3|
|Type|plugin|
|Requires||
|Overrides|'image' and 'prettyLink' formatters, TiddlyWiki.prototype.getRecursiveTiddlerText|
|Description|run-time library for displaying attachment tiddlers|
This plugin provides "stand-alone" processing for //rendering// attachment tiddlers created by [[AttachFilePlugin]]. Attachment tiddlers are tagged with<<tag attachment>>and contain binary file content (e.g., jpg, gif, pdf, mp3, etc.) that has been stored directly as base64 text-encoded data or can be loaded from external files stored on a local filesystem or remote web server.
NOTE: This plugin does not include the "control panel" and supporting functions needed to //create// new attachment tiddlers. Those features are provided by [[AttachFilePlugin]], which can be installed while building your document, and then safely omitted to reduce the overall file size when you publish your finished document (assuming you don't intend to create any additional attachment tiddlers in that document)
!!!!!Formatters
<<<
This plugin extends the behavior of the following TiddlyWiki core "wikify()" formatters:
* embedded images: {{{[img[tooltip|image]]}}}
* linked embedded images: {{{[img[tooltip|image][link]]}}}
* external/"pretty" links: {{{[[label|link]]}}}
''Please refer to AttachFilePlugin (source: http://www.TiddlyTools.com/#AttachFilePlugin) for additional information.''
<<<
!!!!!Revisions
<<<
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: 3, minor: 7, revision: 0, date: new Date(2007,10,28)};
//}}}
//{{{
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
// Uses Components for FF and ActiveX FSO object for MSIE
if (config.macros.attach.fileExists==undefined) config.macros.attach.fileExists=function(theFile) {
var found=false;
// DEBUG: alert('testing fileExists('+theFile+')...');
if(window.Components) {
try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
catch(e) { return false; } // security access denied
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try { file.initWithPath(theFile); }
catch(e) { return false; } // invalid directory
found = file.exists();
}
else { // use ActiveX FSO object for MSIE
var fso = new ActiveXObject("Scripting.FileSystemObject");
found = fso.FileExists(theFile)
}
// DEBUG: alert(theFile+" "+(found?"exists":"not found"));
return found;
}
//}}}
//{{{
if (config.macros.attach.getAttachment==undefined) config.macros.attach.getAttachment=function(title) {
// extract embedded data, local and remote links (if any)
var startmarker="---BEGIN_DATA---\n";
var endmarker="\n---END_DATA---";
var pos=0; var endpos=0;
var text = store.getTiddlerText(title);
var embedded="";
var locallink="";
var remotelink="";
// look for embedded data, convert to data: URI
if ((pos=text.indexOf(startmarker))!=-1 && (endpos=text.indexOf(endmarker))!=-1)
embedded="data:"+(text.substring(pos+startmarker.length,endpos)).replace(/\n/g,'');
if (embedded.length && !config.browser.isIE)
return embedded; // use embedded data if any... except for IE, which doesn't support data URI
// no embedded data... fallback to local/remote reference links...
// look for 'attachment link markers'
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));
// 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) {
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;
return ""; // attachment URL doesn't resolve
}
//}}}
//{{{
if (config.macros.attach.init_formatters==undefined) config.macros.attach.init_formatters=function() {
if (this.initialized) return;
// find the formatter for "image" and replace the handler
for (var i=0; i<config.formatters.length && config.formatters[i].name!="image"; i++);
if (i<config.formatters.length) config.formatters[i].handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link
{
var e = w.output;
if(lookaheadMatch[5])
{
var link = lookaheadMatch[5];
// ELS -------------
var external=config.formatterHelpers.isExternalLink(link);
if (external)
{
if (config.macros.attach.isAttachment(link))
{
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title = config.macros.attach.linkTooltip + link;
}
else
e = createExternalLink(w.output,link);
}
else
e = createTiddlyLink(w.output,link,false,null,w.isStatic);
// ELS -------------
addClass(e,"imageLink");
}
var img = createTiddlyElement(e,"img");
if(lookaheadMatch[1])
img.align = "left";
else if(lookaheadMatch[2])
img.align = "right";
if(lookaheadMatch[3])
img.title = lookaheadMatch[3];
img.src = lookaheadMatch[4];
// ELS -------------
if (config.macros.attach.isAttachment(lookaheadMatch[4]))
img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);
// ELS -------------
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
//}}}
//{{{
// find the formatter for "prettyLink" and replace the handler
for (var i=0; i<config.formatters.length && config.formatters[i].name!="prettyLink"; i++);
if (i<config.formatters.length) {
config.formatters[i].handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var e;
var text = lookaheadMatch[1];
if(lookaheadMatch[3]) {
// Pretty bracketted link
var link = lookaheadMatch[3];
if (config.macros.attach.isAttachment(link)) {
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title=config.macros.attach.linkTooltip+link;
}
else e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))
? createExternalLink(w.output,link)
: createTiddlyLink(w.output,link,false,null,w.isStatic);
} else {
e = createTiddlyLink(w.output,text,false,null,w.isStatic);
}
createTiddlyText(e,text);
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
} // if "prettyLink" formatter found
this.initialized=true;
}
//}}}
//{{{
config.macros.attach.init_formatters(); // load time init
//}}}
//{{{
if (TiddlyWiki.prototype.coreGetRecursiveTiddlerText==undefined) {
TiddlyWiki.prototype.coreGetRecursiveTiddlerText = TiddlyWiki.prototype.getRecursiveTiddlerText;
TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth) {
return config.macros.attach.isAttachment(title)?
config.macros.attach.getAttachment(title):this.coreGetRecursiveTiddlerText.apply(this,arguments);
}
}
//}}}
/***
|Name|AttachFilePluginInfo|
|Source|http://www.TiddlyTools.com/#AttachFilePlugin|
|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|
|Version|3.9.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Documentation for AttachFilePlugin|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Syntax
<<<
''To display the attach file control panel, simply view the [[AttachFile]] shadow tiddler that is automatically created by the plugin, and contains an instance of the inline control panel.''. Or, you can write:
{{{
<<attach inline>>
}}}
in any tiddler to display the control panel embedded within that tiddler. Note: you can actually use any unique identifier in place of the "inline" keyword. Each unique id creates a separate instance of the controls. If the same ID is used in more than one tiddler, then the control panel is automatically moved to the most recently rendered location. Or, you can write:
{{{
<<attach>>
}}}
(with no ID parameter) in SidebarOptions. This adds a command link that opens the controls as a floating panel, positioned directly to the left of the sidebar.
<<<
!!!!!Usage
<<<
Binary file content can be stored in three different locations:
#embedded in the attachment tiddler (encoded as base64)
#on your filesystem (a 'local link' path/filename)
#on a web server (a 'remote link' URL)
The plugin creates an "attachment tiddler" for each file you attach. Regardless of where you store the binary content, your document can refer to the attachment tiddler rather than using a direct file or URL reference in your embedded image or external links, so that changing document locations will not require updating numerous tiddlers or copying files from one system to another.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
When you attach a file, a tiddler (tagged with<<tag attachment>>) is generated (using the source filename as the tiddler's title). The tiddler contains //''base64 text-encoded binary data''//, surrounded by {{{/%...%/}}} comment markers (so they are not visible when viewing the tiddler). The tiddler also includes summary details about the file: when it was attached, by whom, etc. and, if the attachment is an image file (jpg, gif, or png), the image is automatically displayed below the summary information.
>Note: although you can edit an attachment tiddler, ''don't change any of the encoded content below the attachment header'', as it has been prepared for use in the rest of your document, and even changing a single character can make the attachment unusable. //If needed, you ''can'' edit the header information or even the MIME type declaration in the attachment data, but be very careful not to change any of the base64-encoded binary data.//
With embedded data, your TW document can be completely self-contained...unfortunately, embedding just a few moderately-sized binary files using base64 text-encoding can dramatically increase the size of your document. To avoid this problem, you can create attachment tiddlers that define external local filesystem (file://) and/or remote web server (http://) 'reference' links, without embedding the binary data directly in the tiddler (i.e., uncheck "embed data" in the 'control panel').
These links provide an alternative source for the binary data: if embedded data is not found (or you are running on Internet Explorer, which does not currently support using embedded data), then the plugin tries the local filesystem reference. If a local file is not found, then the remote reference (if any) is used. This "fallback" approach also lets you 'virtualize' the external links in your document, so that you can access very large binary content such as PDFs, MP3's, and even *video* files, by using just a 'remote reference link' without embedding any data or downloading huge files to your hard disk.
Of course, when you //do// download an attached file, the local copy will be used instead of accessing a remote server each time, thereby saving bandwidth and allowing you to 'go mobile' without having to edit any tiddlers to alter the link locations...
<<<
!!!!!Syntax / Examples
<<<
To embed attached files as images or link to them from other tiddlers, use the standard ~TiddlyWiki image syntax ({{{[img[tooltip|filename]]}}}), linked image syntax ({{{[img[tooltip|filename][tiddlername]]}}}) , or "external link" syntax ({{{[[text|URL]]}}}), replacing the filename or URL that is normally entered with the title of an attachment tiddler.
embedded image data:
>{{{[img[Meow|AttachFileSample]]}}}
>[img[Meow|AttachFileSample]]
embedded image data with link to larger remote image:
>{{{[img[click for larger view|AttachFileSample][AttachFileSample2]]}}}
>[img[click for larger view|AttachFileSample][AttachFileSample2]]
'external' link to embedded image data:
>{{{[[click to view attachment|AttachFileSample]]}}}
>[[click to view attachment|AttachFileSample]]
'external' link to remote image:
>{{{[[click to view attachment|AttachFileSample2]]}}}
>[[click to view attachment|AttachFileSample2]]
regular ~TiddlyWiki links to attachment tiddlers:
>{{{[[AttachFileSample]]}}} [[AttachFileSample]]
>{{{[[AttachFileSample2]]}}} [[AttachFileSample2]]
<<<
!!!!!Defining MIME types
<<<
When you select a source file, a ''[[MIME|http://en.wikipedia.org/wiki/MIME]]'' file type is automatically suggested, based on filename extension. The AttachFileMIMETypes tiddler defines the list of MIME types that will be recognized by the plugin. Each MIME type definition consists of exactly two lines of text: the official MIME type designator (e.g., "text/plain", "image/gif", etc.), and a space-separated list of file extensions associated with that type. List entries are separated by "----" (horizontal rules).
<<<
!!!!!Known Limitations
<<<
Internet Explorer does not support the data: URI scheme, and cannot use the //embedded// data to render images or links. However, you can still use the local/remote link definitions to create file attachments that are stored externally. In addition, while it is relatively easy to read local //text// files, reading binary files is not directly supported by IE's FileSystemObject (FSO) methods, and other file I/O techniques are subject to security barriers or require additional MS proprietary technologies (like ASP or VB) that make implementation more difficult. As a result, you cannot //create// new attachment tiddlers using IE.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your document:
* [[AttachFilePlugin]] (tagged with <<tag systemConfig>>)
* [[AttachFilePluginFormatters]] ("runtime distribution library") (tagged with <<tag systemConfig>>)
* [[AttachFileSample]] and [[AttachFileSample2]] //(tagged with <<tag attachment>>)//
* [[AttachFileMIMETypes]] //(defines binary file types)//
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
<<<
!!!!!Revisions
<<<
2008.07.21 [3.9.0] Fixup for FireFox 3: use HTML with separate text+button control instead of type='file' control
2008.05.12 [3.8.1] automatically add 'attach' task to backstage (moved from BackstageTweaks)
2008.04.09 [3.8.0] in onChangeSource(), if source matches current document folder, use relative reference for local link. Also, disable 'embed' when using IE (which //still// doesn't support data: URI)
2008.04.07 [3.7.3] fixed typo in HTML for 'local file link' so that clicking in input field doesn't erase current path/file (if any)
2008.04.07 [3.7.2] auto-create AttachFile shadow tiddler for inline interface
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.12.03 [3.7.1] in createAttachmentTiddler(), added optional "noshow" flag to suppress display of newly created tiddlers.
2007.10.29 [3.7.0] code reduction: removed support for built-in upload to server... on-line hosting of binary attachments is left to the document author, who can upload/host files using 3rd-party web-based services (e.g. www.flickr.com, ) or stand-alone applications (e.g., FTP).
2007.10.28 [3.6.0] code reduction: removed duplicate definition of image and prettyLink formatters. Rendering of attachment tiddlers now //requires// installation of AttachFilePluginFormatters
2007.03.01 [3.5.3] use apply() to invoke hijacked function
2007.02.25 [3.5.2] in hijack of "prettyLink", fix version check for TW2.2 compatibility (prevent incorrect use of fallback handler)
2007.01.09 [3.5.1] onClickAttach() refactored to create separate createAttachmentTiddler() API for use with FileDropPluginHandlers
2006.11.30 [3.5.0] in getAttachment(), for local references, add check for file existence and fallback to remote URL if local file not found. Added fileExists() to encapsulate FF vs. IE local file test function (IE FSO object code is TBD).
2006.11.29 [3.4.8] in hijack for PrettyLink, 'simple bracketed link' opens tiddler instead of external link to attachment
2006.11.29 [3.4.7] in readFile(), added try..catch around initWithPath() to handle invalid/non-existent paths better.
2006.11.09 [3.4.6] REAL FIX for TWv2.1.3: incorporate new TW2.1.3 core "prettyLink" formatter regexp handling logic and check for version < 2.1.3 with fallback to old plugin code. Also, cleanup table layout in HTML (added "border:0" directly to table elements to override stylesheet)
2006.11.08 [3.4.5] TEMPORARY FIX for TWv2.1.3: disable hijack of wikiLink formatter due to changes in core wikiLink regexp definition. //Links to attachments are broken, but you can still use {{{[img[TiddlerName]]}}} to render attachments as images, as well as {{{background:url('[[TiddlerName]]')}}} in CSS declarations for background images.//
2006.09.10 [3.4.4] update formatters for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)
2006.07.24 [3.4.3] in prettyLink formatter, added check for isShadowTiddler() to fix problem where shadow links became external links.
2006.07.13 [3.4.2] in getAttachment(), fixed stripping of newlines so data: used in CSS will work
2006.05.21 [3.4.1] in getAttachment(), fixed substring() to extract data: URI (was losing last character, which broken rendering of SOME images)
2006.05.20 [3.4.0] hijack core getRecursiveTiddlerText() to support rendering attachments in stylesheets (e.g. {{{url([[AttachFileSample]])}}})
2006.05.20 [3.3.6] add "description" feature to easily include notes in attachment tiddler (you can always edit to add them later... but...)
2006.05.19 [3.3.5] add "attach as" feature to change default name for attachment tiddlers. Also, new optional param to specify tiddler name (disables editing)
2006.05.16 [3.3.0] completed XMLHttpRequest handling for GET or POST to configurable server scripts
2006.05.13 [3.2.0] added interface for upload feature. Major rewrite of code for clean object definitions. Major improvements in UI interaction and validation.
2006.05.09 [3.1.1] add wikifer support for using attachments in links from "linked image" syntax: {{{[img[tip|attachment1][attachment2]]}}}
2006.05.09 [3.1.0] lots of code changes: new options for attachments that use embedded data and/or links to external files (local or remote)
2006.05.03 [3.0.2] added {{{/%...%/}}} comments around attachment data to hide it when viewing attachment tiddler.
2006.02.05 [3.0.1] wrapped wikifier hijacks in initAttachmentFormatters() function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals
2005.12.27 [3.0.0] Update for TW2.0. Automatically add 'excludeMissing' tag to attachments
2005.12.16 [2.2.0] Dynamically create/remove attachPanel as needed to ensure only one instance of interface elements exists, even if there are multiple instances of macro embedding.
2005.11.20 [2.1.0] added wikifier handler extensions for "image" and "prettyLink" to render tiddler attachments
2005.11.09 [2.0.0] begin port from old ELS Design adaptation based on ~TW1.2.33
2005.07.20 [1.0.0] Initial release (as adaptation)
<<<
[[Efter titel]]<br>[[Efter forfatter]]<br>[[Efter tema]]<br>[[Tabel|Bøger&Artikler]]<br>[[Bograpport|BogRapport]]<br><<slideShow tag:Bøger>><br><<newTiddler label:"Ny bog/artikel" tag:"authorbook""Bøger">>
[[Link|http://twgroup.tiddlyspot.com]]
<html><div align="center"><iframe src="http://twgroup.tiddlyspot.com" frameborder="0" width="100%" height="600"></iframe></div></html>
<!--{{{-->
<div class='header' macro='gradient vert #00c #003'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler=''></span>
<span class='siteSubtitle' refresh='content' tiddler=''></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div id='topMenu'><span class='topMenu' refresh='content' tiddler='TopMenu'></span></div>
</div><div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='mainMenu' refresh='content' force='true' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' force='true' 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 id='contentFooter' refresh='content' tiddler='ContentFooter'></div></div>
<!--}}}-->
/***
|StyleSheet|BlueTheme|
***/
/***
|PageTemplate|MyPageTemplate|
|ViewTemplate|MyViewTemplate|
|EditTemplate|MyEditTemplate|
***/
/***
!!<<gradient horiz #fff #999>> STYLESHEET>>/%==================================================%/
***/
/***There are extra nested stylesheets at the end of this stylesheet***/
/*{{{*/
body {background-color:#ffffff; color:#000;font-size:0.75em; font-family:arial,helvetica; margin:0; padding:0;auto;}
.tabContents {background-color:#ffe; color #f3f; overflow: auto;}
.tabset a:hover {background:#ffd; color:#f00;}
.viewer {color:#000;line-height: 1.6em;}
.button {border: solid 0px;}
#mainMenu a {color:#04b;}
#mainMenu a:hover {background:#fff;color:#04b;}
.mmheading {color:#800;font-weight:bold;}
#topMenu{font-size: 1.4em;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> HEADER >>/%==================================================%/
***/
/*{{{*/
#displayArea {margin-top:0.0em}
.header {position:relative; height:73px;}
.headerShadow {padding: 1.4em 0em 1em 1em;}
.headerForeground {padding: 1.4em 0em 1em 1em;}
.siteTitle {font-size:1.0em;}
.siteSubtitle {font-size:1em;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> TOOLBAR>>/%==================================================%/
***/
/*{{{*/
.toolbar {color:#900;}
.toolbar a {color:#077;}
.selected .toolbar a {color:#077;}
.selected .toolbar a:hover {color:#090;;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> MAINMENU>>/%==================================================%/
***/
/*{{{*/
#mainMenu {width: 16.5em; text-align: left; font-size: .95em;}
#displayArea {margin: 0em 14em 0em 17em;}
#mainMenu .sliderPanel { margin-left: 1.2em; }
#mainMenu .tiddlyLinkExisting {font-weight: bold;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> SIDEBAR OPTIONS>>/%==================================================%/
***/
/*{{{*/
#sidebarOptions .sliderPanel {background:#eff;font-size:1em;}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebar a:hover {color: #F00;background: #ffd /*#ef9*/;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> VIEWER OPTIONS>>/%==================================================%/
***/
/*{{{*/
.viewer hr {
border: 0px;
border-top: solid 1px #c06;
color: #c06;
}
.viewer blockquote {
border-left: 2px solid #c06;
}
.viewer a:h3 {
color:#600;
text-decoration:underline;
}
.viewer {color:#050;line-height: 1.6em;}
.viewer a.button{color:#04b;
border: solid 1px #008;
background:url([[mainmenugray7ef.gif]]) repeat-x top left;top left;-moz-border-radius: .2em;}
.button {border: solid 0px;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> MISCELLANEOUS>>/%==================================================%/
***/
/*{{{*/
.viewer hr {border: 0px;border-top: solid 1px #c06;color: #c06;width:100%;}
.makeborder {border: solid 1px #008;padding-left: 2px;padding-right: 2px; background:url([[mainmenugray7ef.gif]]) repeat-x top left;top left;-moz-border-radius: .2em;}
/*HR*/
hr {height:1px;width:80%;}
#mainMenu hr {height:1px;color:#c06;width:80%;}
.viewer .popup li .tagger a {display:inline;}
.popup {
max-height:275px;
min-height:auto;
width: 160px;
overflow: auto;
margin:auto;
-moz-border-radius : 0.65em 0.2em 0.2em 0.65em;
background:#eee;
color:#900;
}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> TABS>>/%==================================================%/
***/
/*{{{*/
.tabSelected {
padding: 1px;
cursor: default;
color: #700;
background-color: #000;
border-left:0px solid #000;
border-top:0px solid #000;
border-right:0px solid #000;
font-size:.95em;
font-weight:bold;
padding: 2px 4px;
}
.viewer .tabSelected {
padding: 1px;
cursor: default;
color: #700;
background-color: #000;
border-left:0px solid #000;
border-top:0px solid #000;
border-right:0px solid #000;
font-size:.95em;
font-weight:bold;
padding: 2px 4px;
}
.tabUnselected {
padding: 1px;
color: #070;
background-color: #666;
font-size:.95em;
padding: 2px 4px;
}
.viewer .tabUnselected {
padding: 1px;
color: #700;
background-color: #666;
font-size:.95em;font-weight:bold;
padding: 2px 4px;
}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> GIFFMEX TWEAKS TO STYLESHEETPRINT>>/%==================================================%/
***/
/*{{{*/
/*Invisible table*/
.viewer .invisibletable table {
border-color: white;
}
.viewer .invisibletable table td {
font-size: 1em;
font-family: Verdana;
border-color: white;
padding: 10px 20px 10px 0px;
text-align: left;
vertical-align: top;
}
.viewer .invisibletable table th {
color: #005566;
background-color: white;
border-color: white;
font-family: Verdana;
font-size: 1.2em;
font-weight: bold;
padding: 10px 20px 10px 0px;
text-align: left;
vertical-align: top;
}
/* (so that nothing but tiddler title and text are printed) */
@media print {#tiddlersBar {display: none ! important;}}
@media print {#mainMenu {display: none ! important;}}
@media print {#topMenu {display: none ! important;}}
@media print {#sidebar {display: none ! important;}}
@media print {#messageArea {display: none ! important;}}
@media print {#toolbar {display: none ! important;}}
@media print {.header {display: none ! important;}}
@media print {.tiddler .subtitle {display: none ! important;}}
@media print {.tiddler .toolbar {display; none ! important; }}
@media print {.tiddler .tagging {display; none ! important; }}
@media print {.tiddler .tagged {display; none ! important; }}
@media print {#displayArea {margin: 1em 1em 0em 1em;}}
@media print {.pageBreak {page-break-before: always;}}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> SPECIFIC TIDDLER CUSTOMIZING>>/%==================================================%/
***/
/*{{{*/
#tiddlerTWHelp-SearchResults .viewer {
overflow: auto;
}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> NESTED STYLESHEETS>>/%==================================================%/
***/
[[JqueryTreeviewCSS-B]]
[[StyleSheetShortcuts]]
[[TopMenuStyle2]]
[[StyleSheetTiddlersBarblue]]
/***
!!!<<gradient horiz #fff #999>> ROUNDED CORNERS AND BORDERS>>/%==================================================%/
***/
/*{{{*/
.tiddler {
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
border-bottom: 3px solid #ccc;
border-right: 3px solid #ccc;
margin: 0.5em;
background:#fff;
padding: 0.5em;
-moz-border-radius: 1em; }
#messageArea {
background-color: #eee;
border-color: #8ab;
border-width: 4px;
border-style: dotted;
font-size: 90%;
padding: 0.5em;
-moz-border-radius: 1em; }
#contentFooter {
background: transparent;
padding: 1em 2em;
font-weight:normal;
}
#contentFooter a {
color:#009;
}
{{tuduSlider{<<slider chkBibliografi Bibliografi 'Bibliografi »'>>}}}{{tuduSlider{<<slider chkBøger&Artikler Bøger&Artikler 'tabel »'>>}}}
<<forEachTiddler
where
'tiddler.tags.contains("Bøger") && tiddler.data("wherekept") && tiddler.data("wherekept").contains(context.viewerTiddler.title)'
sortBy
'tiddler.title.toUpperCase()'
write '""+ (tiddler.fields["rapport"]=="true"?"[[√ |BogRapport]]":"") +" <<siteMap [["+tiddler.title+"]] . sliders$)){{indent indent{[img(40px+,)["+store.getValue(tiddler,"title")+" |"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]]}}} "'
none '"//ingen \"bog\" er opgivet endnu//"'
>>
<<forEachTiddler where 'tiddler.tags.contains("Bøger")&& tiddler.fields["rapport"]=="true" '
sortBy 'tiddler.data("wherekept")'
write
'(index < 200)? "|!"+(index+1)+"|[["+tiddler.data("wherekept")+"]] |[["+tiddler.title+"]] | [["+tiddler.data("author")+"]] | [["+tiddler.data("primtopic")+"]] | [img(3em+,)["+store.getValue(tiddler,"title")+" |"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | [["+tiddler.title+"-note]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>|>| !<<wikify [[%0]] title@here \>\> |h\n"
+"| ! | <<tag Elev \>\> | <<tag Bøger Titel\>\> | [[Forfatter|Efter forfatter]] | [[Tema|Efter tema]] | Cover | <<tag NoteArkiv Note\>\> |h\n"'
end 'count+" bøger\n"' none '"ingen bøger \n"'>>
{{comment{<<tiddler AndreBøger&Artikler>>}}}
!!!!Hej Herdis »
Jeg henvender mig til dig - for at tilbyde mig som kursusholder.
Jeg er lærer på [[Himmerlands Ungdomsskole|http://h-u.dk]] i Haubro, nær Aars.
Mit navn er Måns Mårtensson og jeg har været efterskolelærer i snart 11 år. [[(CV) »|http://mmscv.tiddlyspot.com/index.html]] - som [[mindmap »|http://share.xmind.net/_embed/maans66/xmind-022438/]]
Jeg vil gerne tilbyde et eller flere kurser (som kursusholder) i nye IT-værktøj og nettjenester, der alle er OpenSource (gratis), til faglærere og IT-ansvarlige på efterskoler.
Min specielle indfaldsvinkel til disse værktøj vil ganske givet appellere til lærere af forskellige typer, eftersom jeg hverken er programmør, webgrafiker eller teknologinørd.
Jeg er blot en lærer, som har haft mange forskellige ansvarsområder - forskellige fag, og har udviklet en stor interesse for og kompetence indenfor "~GørDetSelv" og "Didaktik til tiden".
Som kursusholder for voksne har jeg ikke den store erfaring, ud over at jeg har været underviser i kurset "Ind i jazzen", som var et modul ud af flere på højskolen "Diget" (Skagen) for ca. 4 år siden. Jeg leverede også en sangaften for kursusdeltagerne, sammen med en af højskolelærerne, ved samme lejlighed. //(Jeg har vist glemt at skrive det i mit CV...)//
!!!~OpenSourceFilosofien: //"~GørDetSelv"// »
~OpenSource er et interessant fænomen i en web2.0 tid, hvor flere og flere opdager at de selv kan være herre over webindhold, egne hjemmesider, tilføje
materiale til vidensbanker (WikiPedia mm) og social communities som FaceBok m.fl.. ~OpenSource er bl.a. en mulighed for selv at vælge rammerne/programmerne til at
hhv. at lave materialer og vælge de typer containere/medier man vil bruge (uden reklamesponsorer etc.)
+++[Introduktion til OpenSource »]<<tiddler OpenSource>>===Kilde: http://vimeo.com/4391700
!!!~GørDetSelv med IT »
Det er efter min mening oplagt at skoler/faglærere vælger deres undervisnings og jobværktøjer ud fra en ~OpenSource filosofi, der samtidig tillader at man
deler/ændrer og distribuerer programmer og materialer, elever og kolleger imellem. Derfor anbefaler jeg at man f.eks. bruger ~OpenOffice og ~TiddlyWiki* så
vidt muligt, til undervisning.
!!!Panelet - en reaktion »
Jeg har lavet et programpanel og en [[reklame for panelet »|http://dl.getdropbox.com/u/1064531/Et%20udviklingsprojekt-2.pdf]], inspireret/provokeret af en Iteoreklame, der ville sælge Microsoft Office til efterskoler, på en måde jeg syntes var lidt usmagelig. De tilbød at man fik en serverudgave, som kun var tilgængelig, så længe eleverne var tilsluttet skolens netværk - og havde en "adgangsnøgle" på en usb. Når skoleåret var omme skulle skolen "forære" eleverne en lightudgave af officeprogrammet - som de kunne have gavn af efterfølgende. Det "usmagelige" bestod i at Microsofts licenckrav, gjorde at skolen ikke måtte give eleverne Officepakken, før skoleåret var endt - fordi licensen var personlig, og derfor ikke måtte bruges i undervisningen.
!!!Lidt brok over Microsoft og deres "lakajer" »
Det skal ikke være nogen hemmelighed at jeg er træt af Microsofts måde at tjene penge på - og at der er så mange "mellemhandlere" som prøver at tjene penge på Microsoft.
Jeg har ikke mødt en edb-konsulent endnu, der ikke er "korrumperet" af Microsofts "specialaftaler", på den ene eller den anden måde.
Det skyldes sikkert først og fremmest at det "er det kunderne vil have" - og Microsoft har også været "dygtige" til at besværliggøre oversættelsen af deres filformater til andre og åbne standarder. Det handler om penge og monopol i en global størrelsesorden - og har meget lidt at gøre med oplysning og fri adgang til ressourcer.
+++[Alternativer »] Heldigvis er der andre, gode alternativer såsom ~OpenOffice.org og ~TiddlyWiki* og jeg synes skoler bør se i den retning.
Der er intet i vejen med ~OpenSource programmer eller filformater, men dem, der skal leve af at supportere har fordele ved at promovere Microsoft og Adobe, der til gengæld har råd til at prioritere markedsføring af deres produkter.
Det er ikke skolens opgave at lære elever at piratkopiering er i orden fordi ingen studerende har råd til at købe de "fulde" versioner af Microsofts officepakke eller Cubase eller Adobe Flash etc.. //(Det er et faktum at alle vil have de "fulde versioner"- "light" er bare ikke godt nok..)//
Vi skal vise dem gode og brugbare alternativer, der egner sig til undervisning og som de kan bruge uden videre med ret til at ændre og kopiere.
~OpenSource programmer må gerne bruges til at tjene penge, man må blot ikke sælge softwaren - eller tage patent på nye programmer bygget på ~OpenSource.. Ved lidt omtanke og uddannelse kan man altså spare prisen på software og i stedet bruge pengene på at udvikle/skræddersy ny software, der passer netop til det man har brug for. Jeg synes tanken er meget spændende - og forsøger at leve op til den filosofi selv.
===
!!!Programmer til undervisning og deling »
I mit job har jeg haft ansvaret for mange forskellige fag i tidens løb bl.a.: Dansk, Kristendom, Musik og Tegning/billedkunst. Derudover har jeg været
skemalægger og de sidste 5 år har jeg været edb-ansvarlig og ~AV-ansvarlig. I undervisningsdelen har jeg opdaget mange fordele ved [[OpenOffice »|http://da.openoffice.org]], som andre kunne have gavn af at kende til. Bl.a. skriver OO ud til pdf, ved tryk på en knap og man sikrer derved at udskrifter svarer til originalen, ved eksempelvis prøver. Til sammenligning findes samme funktionalitet kun i Office 2007 ved tilkøb af Acrobat, - og det er IKKE billigt.
!!!Musik og noder »
Til musikundervisning og forberedelse af undervisning, har jeg brugt at skrive noder og partiturer direkte i OO's programmer (Writer, Draw og Impress, svarer
til Word, Paint og PowerPoint). Det eneste man skal bruge er en installation af programmet [[Lilypond »|http://lilypond.org/web/]] og et [[plugin »|http://ooolilypond.sourceforge.net/]] (tilføjelse) til OO.
Begge dele er gratis, og syntaksen til nodeskrivning er lige til og meget nem at lære. Her er en [[pdf-præsentation/reklame for Lilypond og OpenOffice|http://files.getdropbox.com/u/1064531/Reklame%20for%20OOoLilypond%232.pdf]]
Der er desuden udkommet 2 virkelig gode opensourceprogrammer til node- og tabulaturskrivning: [[MuseScore »|http://www.musescore.org/]] og [[Tuxguitar »|http://www.tuxguitar.com.ar/]].
Begge programmer "taler samme sprog" som mange proprietære nodeprogrammer (midi,musicxml,guitarPro (Sibelius & Finale)) og kan derfor åbne og redigere andre programmers filer.
Programmerne er så "modne" og stabile at de egner sig fint til undervisningsbrug. Elever kan hente så mange kopier de har lyst til.
Audacity er et meget enkelt optageprogram med avancerede muligheder for at arbejde med indbyggede effekter og flere spor. Det er allerede i brug på mange skoler.
!!!"Proprietær" software kontra ~OpenSource. Et eksempel »
Jeg har mange års erfaring i at anvende proprietære musik- og notationsprogrammer såsom: Sibelius, Finale, Musicator, Band in a Box, Audition og
Cubase. Det er min erfaring som lærer på efterskole, at det er meget bedre at bruge programmer, som kan deles med elever - uden at det er
pirateri (eks.: Sibelius koster ca. 6000 for 1 licens - ca 22.000,- for 20 stk - kilde: [[Indigo2 »|http://www.indigo2.dk/sibelius/index.htm]])
Sibeliuseksemplet er blot for en enkeltbrugerlicens til skolen.
Hvad så når eleven skal klare sig selv? Det er uholdbart at basere sin undervisning på programmer, som elever ikke har adgang til uden at gøre noget ulovligt...
[[MuseScore »|http://www.musescore.org/]] er gratis (~OpenSource) og leverer en grafik der er af lige så høj kvalitet - og faktisk en tand bedre hvis det eksporteres til Lilypond.
Programmet er i øvrigt mere pædagogisk og simplere at betjene fordi det ikke har mange af de professionelle funktionaliteter som er indbyggede i Sibelius. Det er
netop problemet med mange af "Flagskibsprogrammerne" - de skal både levere en løsning til professionelle nodesættere og til skoler - derfor er der alt for mange
ting at forholde sig til (På programmets præmisser - vel at mærke!). Til undervisningsbrug er [[MuseScore »|http://www.musescore.org/]] alt rigeligt - og det virkeligt gode, ved ~OpenSource, kommer til udtryk ved at det netop IKKE er en "lightudgave" af et andet program. Alle opdateringer og opgraderinger er sikret - så længe "communitiet" omkring programmet, holder det i live.. Kommer der andre relaterede ~OpenSource produkter kan de som regel "snakke sammen" med det gamle, fordi filformater og koder er "åbne" - og der er en stor vilje til samarbejde, - ofte af ren taknemlighed for deling af programkode og respekt for et programs popularitet.
Det er mit indtryk at ~MuseScore og ~TuxGuitar, begge er meget populære programmer.
Man kan se af aktiviteten på deres communitysider at der er stor interesse omkring deres udvikling og vedligeholdelse.
!!!~MultiMedie & billedkunst »
Nogle af mine mere ambitiøse eksempler på programmer og undervisningsforløb. //NB!: Dette er IKKE ment som et realistisk undervisningsforløb, men blot et eksempel på hvor mange "gratis" og gode ressourcer, der er til rådighed til undervisning i et fag som ~MultiMedie & billedkunst.//
Næsten alle er ~OpenSource. De få (2 stk) som ikke er, kan alligevel bruges gratis af lærere og elever i fulde udgaver, privat! I øvrigt tilbydes disse som særlige skolelicenserede programmer, med nedsat pris for lærere, hvis man har tænkt sig at bruge dem til undervisning. //(De var FOR gode til ikke at nævnes i denne sammenhæng...)//
+++[MultiMedie&Billedkunst »]
<<tiddler MultiMedie&Billedkunst >>===
!!!Tidens trends - web2.0 og "ejerskab": //"Didaktik til tiden"// »
Wikis, Blogs og ~SocialCommunities er netbaserede tjenester, der har fyldt meget på internettet de seneste 5 -6 år. For mange mennesker er disse tjenester = internettet.
Unge mennesker i dag er afhængige af de sociale netværk som de vedligeholder via internettet og forventer at kunne kommunikere via webinterfaces.
For blot et par år siden var det mest mobiltelefoni og sms, i dag er det fortrinsvis ~FaceBook og lignende tjenester. Twitter er også godt på vej til Danmark. (Se [[Tweets.dk »|http://tweetdk.tiddlyspot.com/index.html]] )
!!!Didaktik til tiden »
En markant og afgørende forskel på almindelig tekstbehandling og webtekst er brugen af hyperlinks. Hyperlinks og tagging (mærkning) er nettets "filstier og
mapper". Disse egenskaber ved nettet kan bruges i et enkelt htmldokument v.h.a. javascript - også offline, - det er her [[TiddlyWiki*|http://tiddlywiki.com/]]
kommer ind i billedet. ~TiddlyWiki er blot et enkelt html-dokument, som "betjenes/redigeres" i en internetbrowser. Fordi siden er baseret på javascript,
kræver den ind imellem en anden browser end Internet Explorer - FireFox er bedst men Google Chrome og Safari (Mac) er også gode.
!!!Citat fra http://tiddlywiki.com »
//"~TiddlyWiki is a single html file which has all the characteristics of a wiki - including all of the content, the functionality (including editing, saving, tagging and searching) and the style sheet. Because it's a single file, it's very portable - you can email it, put it on a web server or share it via a USB stick.
But it's not just a wiki! It has very powerful plugin capabilities, so it can also be used to build new tools. You have full control over how it looks and behaves."//
Kilde: [[TiddlyWiki - a reusable non-linear personal web notebook »|http://tiddlywiki.com/]]
+++[TiddlyWikis historie »] (Filmklip - interview med Jeremy Ruston) Kilde: http://vimeo.com/852169
<html><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=852169&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=852169&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><p><a href="http://vimeo.com/852169">History of TiddlyWiki</a> from <a href="http://vimeo.com/user423727">Phil Whitehouse</a> on <a href="http://vimeo.com">Vimeo</a>.</p></html>===Tålmodighed!! - Filmen skal loades....
!!!~TiddlyWikis jeg har "lavet": oversat, designet og skræddersyet »
~TiddlyWiki, er et udmærket præsentationsværktøj og ved mindre modifikationer og "skræddersyninger" kan
TiddlyWiki bruges som program til alt muligt skolerelateret.
Herunder er en oversigt over mange af de skræddersyede TW'er jeg har brugt i dette skoleår:
//NB: De er alle meget forskellige både i layout og funktionalitet, men bygger alle på den oprindelige [[TiddlyWiki »|http://tiddlywiki.com]] af Jeremy Ruston//
+++[Oversigt »]
#[[Opgivelser »|http://opgivelser.tiddlyspot.com]] (En Danskhjemmeside, til kommunikation med elever og censor omkring synopseprøven i år)
#[[Kristendom »|http://kristendom.tiddlyspot.com]] (En kristendomshjemmeside, til kommunikation med elever og censor omkring prøven i år (findes også i [[en udgave kun til censor og mig »|http://kristendoms.tiddlyspot.com]] med oplæg - beskyttet med password)navn: kristendoms kode: kultur) Fagkonsulent Niels Lysholm har set på den og rost konceptet. Min censor var også meget tilfreds med den.
#[[ElevListen »|http://el0809.tiddlyspot.com]] (Et browserprogram baseret på TiddlyWiki, der varetager og producerer lister over bl.a. syge, weekendtilmeldinger, fag, reservationer og kort over alle elever og lærere)
#[[DenMobileElevListe »|http://xn--mns-ula.dk/weekend]] (Det samme som ovenstående blot lavet specielt til mobiltelefon (iPhone))
#Elevlisten har jeg lavet i flere udgaver og versioner. Du kan se nogle pdfpræsentationer [[her »|http://dl.getdropbox.com/u/1064531/Den%20Mobile%20ElevListe.pdf]] [[her »|http://dl.getdropbox.com/u/1064531/ElevListen%20nyt%20april%2009.pdf]] og [[her »|http://el0809.tiddlyspot.com/#Instruktioner]].
#[[BukseTrolden »|http://buksetrolden.tiddlyspot.com/index.html]](Et skriveværktøj til Dansk)
#Blogs [[1 »|http://twgroup.tiddlyspot.com]], [[2 »|http://blog-hu.tiddlyspot.com/index.html]], [[3 »|http://xn--mns-ula.dk/blog/index.html]] og [[4 »|http://edb.tiddlyspot.com/index.html]] - Jeg har lavet flere varianter af ~TiddlyWiki til Blogbrug i undervisningen- fordi jeg synes det er smart at man kan undgå at gøre den offentlig, ved at beholde den på skolens netværk.
#[[LigningsEditorWiki »|http://twligninger.tiddlyspot.com/index.html]] er ja ... en ligningseditor i ~TiddlyWiki. Jeg har blot oversat den til Dansk fra den engelske original: http://twequation.tiddlyspot.com/ »
#[[GeografiWiki »|http://geografiwiki.tiddlyspot.com/index.html]] Er en prototype på et wikiværktøj med inbyggede kort. Man kan lave ~ImageTagging og derved notater til geografiske placeringer. (Ikke helt færdig endnu)
#[[SimpleNoter »|http://simplenoter.tiddlyspot.com/index.html]] (Som navnet siger - et simpelt noteværktøj til alle)
#[[Noter »|http://noter3.tiddlyspot.com/index.html]] (endnu et noteværktøj med en anden type kategorisering)
#[[Bibliografisk arkiv »|http://maans.newp.dk/TiddlyHome/BibliografiskArkiv/]](Bogarkiv - findes også delvist indbygget i [[Opgivelser|http://opgivelser.tiddlyspot.com]]) [[Engelsk udgave »|http://bibtw.tiddlyspot.com/]] jeg har givet ekstra funktionalitet for at demonstrere flere muligheder for engelsktalende ~TW-brugere.
#[[GuitarScrapBog »|http://guitar.tiddlyspot.com/index.html]] (Samling af materialer og videoer til guitarundervisning)
#[[Tegning »|http://tegning.tiddlyspot.com/index.html]] (Samling af materialer og videoer til Tegning/billedkunst)
#[[Lektier&Opgaver »|http://lektier.tiddlyspot.com/]] (Navnet taler vist for sig selv...)
#[[Projekt08 »|http://maans.newp.dk/TiddlyHome/Projekt08/index.html]] (Et overblik over projektopgavearbejdet og en portal til Claroline*)
#[[Etik »|http://etik.tiddlyspot.com]] (Præsentationsværktøj og materialer til Kristendomsundervisningen) Denne TW indeholder bl.a. links til [[elevers "podcasts" »|http://etik.tiddlyspot.com/#Voicethreads]] lavet i [[VoiceThread »|http://voicethread.com]].
#[[BehovsAnalyse »|http://behovsanalyse.tiddlyspot.com/index.html]] (Et digitalt spørgeskema/formular til kolleger omkring brug af IT mm.)
#[[Tiddly4HU »|http://maans.newp.dk/TiddlyHome/index.html]] En rigtig portal til oprettelse af brugere og TiddlyWikis som hjemmesider af skabeloner som portalens administrator selv bestyrer og tilretter. (Desværre virker min nuværende private hosting ikke - så eksempelportalen er dysfunktionel mht. indlogning og administration- Jeg har dog testet den fra en midlertidig server, hvor den virkede perfekt, med indlogning og det hele ;-)) Den kan bruges fra en skoles server til administration af tiddlywikis som elever og lærere opretter selv.
#[[SangtimeNoter »|http://sang.tiddlyspot.com/]](Et arkiveringsredskab + hjælp til at lave sangtimer og have et samarbejde omkring det)
#[[Kaffe »|http://kaffe.tiddlyspot.com/index.html]] (Et arkiverings- og skriveredskab til referater + adgang til lokale filer på netværket - dog kun når TW'en ligger lokalt på netværket - virker ikke online af sikkerhedsmæssige årsager)
#[[TwSpot »|http://twspot.tiddlyspot.com]] Jeg har lavet en mindmap-portal TiddlyWiki for de fleste af mine eksperimenter med TW her: http://twspot.tiddlyspot.com
#[[Tweets.dk »|http://tweetdk.tiddlyspot.com/index.html]] Arkiverings- og søge værktøj til twitter tweets.
#[[DagBog »|http://dagbog.tiddlyspot.com/index.html]] En dagbog kombineret med den mobile elevliste på 2 måder 1) Inkluderet(skrivebeskyttet) og 2) Indlejret (iFrame)
===
!!!~TiddlyWiki online »
TiddlyWikis kan lægges ud som hjemmeside på [[TiddlySpot »|http://tiddlyspot.com]] ganske gratis.
Det er ikke nødvendigt med nogen form for registration eller konto. (i øvrigt reklamefrit område!!)
Man kan lægge sin ~TiddlyWiki ud som en hjemmeside på hvilken som helst server med ftp-adgang eller direkte på skolenetværket i en delt mappe.
Man kan vedhæfte sin ~TiddlyWiki til en mail eller uploade den til sin blog - hvorfra modtageren kan åbne den som hvilken som helst anden hjemmeside (dog uden
redigeringsmuligheder).
!!!~DropBox »
Bruger man [[DropBox »|http://www.getdropbox.com]] på sin pc, kan man blot have sin ~TiddlyWiki liggende i en offentlig mappe (Dokumenter - public) højreklikke på filen vælge "copy public link" - så har man adressen til sin ~TiddlyWiki på nettet og kan dele adressen med andre. Hver gang man laver ændringer i filen på sin pc, synkroniserer
DropBox filen på nettet og linket peger på den sidste nye udgave. Det lyder måske indviklet - men det er faktisk meget enkelt - også at demonstrere - det er teknikken bag som er kompliceret.
!!!~TiddlyWiki offline »
Egenskaber som især adskiller TiddlyWiki fra alle andre Wikis og nettjenester er at den kan bruges offline og nemt kan ændre både funktionalitet og udseende alt
efter behov. Den kan bruges offline og er først og fremmest personlig (der er intet flerbrugersystem i en enkelt TW, selvom man kan skrive brugernavn og derved
signere sine edits).
!!!Alternativ lignende online flerbruger-Wiki »
Hvis man er interesseret i en strømlinet online Wiki, der bygger på mange af de samme principper som TiddlyWiki er der en her:
En nystartet wikiengine (igen OpenSource) er [[Wagn »|http://wagn.org]] (ægte flerbrugermulighed!). Den har et gui som på mange måder ligner TiddlyWikis.
I stedet for "Tiddlers" kaldes de forskellige entries for "cards". Disse kort kan kategoriseres, sorteres - og leverer en slags "organisk database" der er også er
selve wikien. Den er utroligt enkel (ligefrem smuk - efter min mening) og viser nye veje for brugervenlighed og interaktion. Check den ud her: http://wagn.org
!!!Sociale netværk »
Jeg har tænkt mig at installere [[Elgg »|http://elgg.org/]], der er en slags FaceBook-klon (igen OpenSource) som en lokal netværkstjeneste på min skole. Vi
skal have lavet en netværksomlægning først - så jeg får ikke mulighed for at teste systemet før engang i november 09.
Jeg mener mig dog i stand til at præsentere og demonstrere systemet/portalen for interesserede.
!!!Claroline, et Lms-system a lá Moodle »
[[Claroline »|http://www.claroline.net/services/index.html]] er et system til at administrere klasser og fag på en skole.
Jeg har brugt det dette skoleår og er meget tilfreds med dets funktionaliteter. F.eks. har jeg sat det op til at administrere elever, grupper og lærere i
projektarbejdet i 9.kl. på vores skole (jvf. TW nr 10: Projekt08) Det er på mange måder nemmere at gå til end Moodle - men ser dog ikke lige så smart ud.
Hvis der er nogen som har forsøgt sig med Moodle og har givet op - så er Claroline en nemmere løsning, som alle kan lære at bruge hurtigt.
Lærere bliver administratorer for deres egne hold og fag - Elever kan vænnes til at se deres personlige skemaer, følge med i agendaer for de enkelte hold og
hente lektiematerialer fra delte mapper. "Min" Claroline er her: http://maans.newp.dk/claroline/ »
Se de forskellige fag ved at klikke på oversigten:
+++[Kursuskategorier »]
*[[Kulturfag »|http://maans.newp.dk/claroline/index.php?category=KULTUR]] (3)
*[[Matematik & Naturfag »|http://maans.newp.dk/claroline/index.php?category=MATNA]] (1)
*[[Sprogfag »|http://maans.newp.dk/claroline/index.php?category=SPROG]] (3)
*[[Valgfag »|http://maans.newp.dk/claroline/index.php?category=VALG]] (2)
*[[Andre »|http://maans.newp.dk/claroline/index.php?category=ANDRE]] (5)
===
!!!Panelet og linux fra en usb »
- Blot en sidebemærkning som evt. kunne interessere systemadministratorer og IT-nørder -
Jeg har lavet en udgave af Panelet som indeholder muligheden for at bruge linux både i Windows (virtuelt) - og som erstatning for Windows. dvs. man starter sin
pc op fra usb'en og bruger Panelet inde i Linux i stedet. Pdf: [[Panelet & Linux »|http://files.getdropbox.com/u/1064531/Panelet%20i%20Linux.pdf]] - eller som billedpræsentation: [[Panelet og Linux for alle »|http://files.getdropbox.com/u/1064531/Panelet%20og%20Linux%20-%20for%20alle.exe]].
Lige nu, hvor jeg sidder og skriver, er det på en bærbar hvor harddisken er gået i stykker. Intet er længere tilgængeligt udover at pc'en kan tændes.
Jeg har sat en usb i den og startet op på et lille styresystem (PuppyLinux), som jeg har indbygget i min egen version af Panelet på usb'en.
Panelet ligger som genvej på skrivebordet (i PuppyLinuxstyresystemet) og jeg kan åbne Openoffice og de fleste af de andre programmer, som er installerede i panelet.
Alle mine kopier af filer fra den ødelagte harddisk ligger også på usb'en og jeg kan åbne dem i Linux'en.
PuppyLinux kan bruge pc'ens trådløse netkort og har mange andre nyttige programmer indbygget, bl.a. denne mailklient, som til forveksling ligner Thunderbird,
derfor kan jeg checke mail og skrive denne mail.Sætter jeg usb'en i en anden pc, med Windows kørende- vil panelet åbnes til højre i vinduet og alle programmer
kan bruges direkte i Windows (som om de var installerede på gæstepc'en). Min lille PuppyLinux vil også kunne åbnes i sit eget vindue inde i Windows
- men panelet er så "uden for Linux programmet", denne gang - fordi jeg har åbnet panelet på en pc, der allerede kører Windows.
Så er der tale om en såkaldt "Virtuel PC". En pc, der kan køre inde i en anden pc. Lige nu nyder jeg blot at jeg kan bruge den bærbare uden harddisk
- og så er Linuxen IKKE virtuel men meget reel! ;-) !!!
Med venlig hilsen Måns Mårtensson - 25344884
<<foldHeadings closed>>
Creating sub-topics or sub-folders under this top level folder.
1. To create a sub-topics: Click on the top-level you just created.
2. Then in its toolbar click 'add:subtopic'. (Note: This simply makes a new tiddler tagged with title of the original tiddler and it becomes a sub-topic of that tiddler)
3. The new sub-topic will be automatically added to the menu under the folder.
4. Once the above is done, then clicking on this sub-topic and adding to it as in (b: above) it will (automatically) become a sub-folder.
[[Bograpport - klik her!|BogRapport]]
<<forEachTiddler where 'tiddler.tags.contains("Bøger")'
sortBy 'tiddler.fields["title"]'
write
'(index < 200)? "|"+(index+1)+"|[["+tiddler.title+"]] | [["+tiddler.data("author")+"]] | [["+tiddler.data("primtopic")+"]] | [img(3em+,)["+store.getValue(tiddler,"title")+" |"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | [["+tiddler.title+"-note]] | [["+tiddler.data("wherekept")+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>|>| !<<wikify [[%0]] title@here \>\> |h\n"
+"| # | Titel | [[Forfatter|Efter forfatter]] | [[Tema|Efter tema]] | Cover | Note | <<tag Elev \>\> |h\n"'
end 'count+" bøger\n"' none '"ingen bøger \n"'>>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]] wikibar'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div macro='tiddler QuickEditToolbar'></div>
<div class='editor' macro='edit tags'></div>
<div macro='showWhen tiddler.tags.contains("Topics") || tiddler.title =="Enter the name for your new master topic here"'>[[TopicNote]]</div>
<div macro='showWhen tiddler.tags.contains("Note") || tiddler.title =="New Note"'>[[NoteNote]]</div>
<div class='small'>billede URL (jpg/gif):</div>
<div class='editor' macro='edit billede'></div>
<div class='editor' macro='edit text'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span macro='wikify "//@@bgcolor(#99ff33):BogRapport:@@//"'</span><span class macro="checkbox rapport@"></span></span><span class='newbutton' style='padding-right: 0.5em;' macro='newHere title:"Skriv titlen på din bog og klik færdig" label:"*Ny bog/artikel*" tag:"Bøger"'></span></div>
<div class='title' macro='view title'></div>
<table class='borderless' style='width:70%'><tr>
<td style='width:1%'><div class='small' macro='wikify [<img(182px+,)[%1|%0][%1-note]] billede@here title@here'></div>
<div class macro='formTiddler BogRapportTemplate'></div></div></td>
<td style='width:20%'>
<div class='small' macro='formTiddler NewBibEntry'></div></td></table>
<div class='viewer' macro='view text wikified'></div>
<div <span class='menubox' style='float:center;margin:0em' macro='notes heading:"NoteArkiv" tag:"NoteArkiv" suffix:"note"'> </span></div>
<div class='tagClear'></div>
<!--}}}-->
@@color:#C06;''» »'' @@ Tabs containing CSS styling code (controls layout and visual style)
----
<script>
// get all tiddlers tagged with "CSS"
var tids=store.getTaggedTiddlers("CSS");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("CSS")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
/***
|''Name:''|CalendarPlugin|
|''Source:''|http://www.TiddlyTools.com/#CalendarPlugin|
|''Author:''|SteveRumsby|
|''License:''|unknown|
|''~CoreVersion:''|2.0.10|
[Snip - see plugin documentation at the link above]
!!!!!Configuration:
<<option chkDisplayWeekNumbers>> Display week numbers //(note: Monday will be used as the start of the week)//
|''First day of week:''|<<option txtCalFirstDay>>|(Monday = 0, Sunday = 6)|
|''First day of weekend:''|<<option txtCalStartOfWeekend>>|(Monday = 0, Sunday = 6)|
!!!!!Syntax:
|{{{<<calendar>>}}}|Produce a full-year calendar for the current year|
|{{{<<calendar year>>}}}|Produce a full-year calendar for the given year|
|{{{<<calendar year month>>}}}|Produce a one-month calendar for the given month and year|
|{{{<<calendar thismonth>>}}}|Produce a one-month calendar for the current month|
|{{{<<calendar lastmonth>>}}}|Produce a one-month calendar for last month|
|{{{<<calendar nextmonth>>}}}|Produce a one-month calendar for next month|
***/
// //Modify this section to change the text displayed for the month and day names, to a different language for example. You can also change the format of the tiddler names linked to from each date, and the colours used.
//{{{
config.macros.calendar = {};
config.macros.calendar.monthnames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
config.macros.calendar.daynames = ["M", "T", "W", "T", "F", "S", "S"];
config.macros.calendar.weekendbg = "#c0c0c0";
config.macros.calendar.monthbg = "#e0e0e0";
config.macros.calendar.holidaybg = "#ffc0c0";
//}}}
// //''Code section:''
// (you should not need to alter anything below here)//
//{{{
if(config.options.txtCalFirstDay == undefined)
config.options.txtCalFirstDay = 0;
if(config.options.txtCalStartOfWeekend == undefined)
config.options.txtCalStartOfWeekend = 5;
if(config.options.chkDisplayWeekNumbers == undefined)//wn**
config.options.chkDisplayWeekNumbers = false;
if(config.options.chkDisplayWeekNumbers)
config.options.txtCalFirstDay = 0;
config.macros.calendar.tiddlerformat = "0DD/0MM/YYYY"; // This used to be changeable - for now, it isn't// <<smiley :-(>>
version.extensions.calendar = { major: 0, minor: 6, revision: 0, date: new Date(2006, 1, 22)};
config.macros.calendar.monthdays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
config.macros.calendar.holidays = [ ]; // Not sure this is required anymore - use reminders instead
//}}}
// //Is the given date a holiday?
//{{{
function calendarIsHoliday(date)
{
var longHoliday = date.formatString("0DD/0MM/YYYY");
var shortHoliday = date.formatString("0DD/0MM");
for(var i = 0; i < config.macros.calendar.holidays.length; i++) {
if(config.macros.calendar.holidays[i] == longHoliday || config.macros.calendar.holidays[i] == shortHoliday) {
return true;
}
}
return false;
}
//}}}
// //The main entry point - the macro handler.
// //Decide what sort of calendar we are creating (month or year, and which month or year)
// // Create the main calendar container and pass that to sub-ordinate functions to create the structure.
// ELS 2005.10.30: added creation and use of "tbody" for IE compatibility and fixup for year >1900//
// ELS 2005.10.30: fix year calculation for IE's getYear() function (which returns '2005' instead of '105')//
// ELS 2006.05.29: add journalDateFmt handling//
//{{{
config.macros.calendar.handler = function(place,macroName,params)
{
var calendar = createTiddlyElement(place, "table", null, "calendar", null);
var tbody = createTiddlyElement(calendar, "tbody", null, null, null);
var today = new Date();
var year = today.getYear();
if (year<1900) year+=1900;
// get format for journal link by reading from SideBarOptions (ELS 5/29/06 - based on suggestion by Martin Budden)
var text = store.getTiddlerText("SideBarOptions");
this.journalDateFmt = "DD-MMM-YYYY";
var re = new RegExp("<<(?:newJournal)([^>]*)>>","mg"); var fm = re.exec(text);
if (fm && fm[1]!=null) { var pa=fm[1].readMacroParams(); if (pa[0]) this.journalDateFmt = pa[0]; }
if (params[0] == "thismonth")
{
cacheReminders(new Date(year, today.getMonth(), 1, 0, 0), 31);
createCalendarOneMonth(tbody, year, today.getMonth());
}
else if (params[0] == "lastmonth") {
var month = today.getMonth()-1; if (month==-1) { month=11; year--; }
cacheReminders(new Date(year, month, 1, 0, 0), 31);
createCalendarOneMonth(tbody, year, month);
}
else if (params[0] == "nextmonth") {
var month = today.getMonth()+1; if (month>11) { month=0; year++; }
cacheReminders(new Date(year, month, 1, 0, 0), 31);
createCalendarOneMonth(tbody, year, month);
}
else {
if (params[0]) year = params[0];
if(params[1])
{
cacheReminders(new Date(year, params[1]-1, 1, 0, 0), 31);
createCalendarOneMonth(tbody, year, params[1]-1);
}
else
{
cacheReminders(new Date(year, 0, 1, 0, 0), 366);
createCalendarYear(tbody, year);
}
}
window.reminderCacheForCalendar = null;
}
//}}}
//{{{
//This global variable is used to store reminders that have been cached
//while the calendar is being rendered. It will be renulled after the calendar is fully rendered.
window.reminderCacheForCalendar = null;
//}}}
//{{{
function cacheReminders(date, leadtime)
{
if (window.findTiddlersWithReminders == null)
return;
window.reminderCacheForCalendar = {};
var leadtimeHash = [];
leadtimeHash [0] = 0;
leadtimeHash [1] = leadtime;
var t = findTiddlersWithReminders(date, leadtimeHash, null, 1);
for(var i = 0; i < t.length; i++) {
//just tag it in the cache, so that when we're drawing days, we can bold this one.
window.reminderCacheForCalendar[t[i]["matchedDate"]] = "reminder:" + t[i]["params"]["title"];
}
}
//}}}
//{{{
function createCalendarOneMonth(calendar, year, mon)
{
var row = createTiddlyElement(calendar, "tr", null, null, null);
createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon] + " " + year, true, year, mon);
row = createTiddlyElement(calendar, "tr", null, null, null);
createCalendarDayHeader(row, 1);
createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}
//{{{
function createCalendarMonth(calendar, year, mon)
{
var row = createTiddlyElement(calendar, "tr", null, null, null);
createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon] + " " + year, false, year, mon);
row = createTiddlyElement(calendar, "tr", null, null, null);
createCalendarDayHeader(row, 1);
createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}
//{{{
function createCalendarYear(calendar, year)
{
var row;
row = createTiddlyElement(calendar, "tr", null, null, null);
var back = createTiddlyElement(row, "td", null, null, null);
var backHandler = function() {
removeChildren(calendar);
createCalendarYear(calendar, year-1);
};
createTiddlyButton(back, "<", "Previous year", backHandler);
back.align = "center";
var yearHeader = createTiddlyElement(row, "td", null, "calendarYear", year);
yearHeader.align = "center";
//yearHeader.setAttribute("colSpan", 19);
yearHeader.setAttribute("colSpan",config.options.chkDisplayWeekNumbers?22:19);//wn**
var fwd = createTiddlyElement(row, "td", null, null, null);
var fwdHandler = function() {
removeChildren(calendar);
createCalendarYear(calendar, year+1);
};
createTiddlyButton(fwd, ">", "Next year", fwdHandler);
fwd.align = "center";
createCalendarMonthRow(calendar, year, 0);
createCalendarMonthRow(calendar, year, 3);
createCalendarMonthRow(calendar, year, 6);
createCalendarMonthRow(calendar, year, 9);
}
//}}}
//{{{
function createCalendarMonthRow(cal, year, mon)
{
var row = createTiddlyElement(cal, "tr", null, null, null);
createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon], false, year, mon);
createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+1], false, year, mon);
createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+2], false, year, mon);
row = createTiddlyElement(cal, "tr", null, null, null);
createCalendarDayHeader(row, 3);
createCalendarDayRows(cal, year, mon);
}
//}}}
//{{{
function createCalendarMonthHeader(cal, row, name, nav, year, mon)
{
var month;
if(nav) {
var back = createTiddlyElement(row, "td", null, null, null);
back.align = "center";
back.style.background = config.macros.calendar.monthbg;
/*
back.setAttribute("colSpan", 2);
var backYearHandler = function() {
var newyear = year-1;
removeChildren(cal);
cacheReminders(new Date(newyear, mon , 1, 0, 0), 31);
createCalendarOneMonth(cal, newyear, mon);
};
createTiddlyButton(back, "<<", "Previous year", backYearHandler);
*/
var backMonHandler = function() {
var newyear = year;
var newmon = mon-1;
if(newmon == -1) { newmon = 11; newyear = newyear-1;}
removeChildren(cal);
cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);
createCalendarOneMonth(cal, newyear, newmon);
};
createTiddlyButton(back, "<", "Previous month", backMonHandler);
month = createTiddlyElement(row, "td", null, "calendarMonthname", name)
// month.setAttribute("colSpan", 3);
// month.setAttribute("colSpan", 5);
month.setAttribute("colSpan", config.options.chkDisplayWeekNumbers?6:5);//wn**
var fwd = createTiddlyElement(row, "td", null, null, null);
fwd.align = "center";
fwd.style.background = config.macros.calendar.monthbg;
// fwd.setAttribute("colSpan", 2);
var fwdMonHandler = function() {
var newyear = year;
var newmon = mon+1;
if(newmon == 12) { newmon = 0; newyear = newyear+1;}
removeChildren(cal);
cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);
createCalendarOneMonth(cal, newyear, newmon);
};
createTiddlyButton(fwd, ">", "Next month", fwdMonHandler);
/*
var fwdYear = createTiddlyElement(row, "td", null, null, null);
var fwdYearHandler = function() {
var newyear = year+1;
removeChildren(cal);
cacheReminders(new Date(newyear, mon , 1, 0, 0), 31);
createCalendarOneMonth(cal, newyear, mon);
};
createTiddlyButton(fwd, ">>", "Next year", fwdYearHandler);
*/
} else {
month = createTiddlyElement(row, "td", null, "calendarMonthname", name)
//month.setAttribute("colSpan", 7);
month.setAttribute("colSpan",config.options.chkDisplayWeekNumbers?8:7);//wn**
}
month.align = "center";
month.style.background = config.macros.calendar.monthbg;
}
//}}}
//{{{
function createCalendarDayHeader(row, num)
{
var cell;
for(var i = 0; i < num; i++) {
if (config.options.chkDisplayWeekNumbers) createTiddlyElement(row, "td");//wn**
for(var j = 0; j < 7; j++) {
var d = j + (config.options.txtCalFirstDay - 0);
if(d > 6) d = d - 7;
cell = createTiddlyElement(row, "td", null, null, config.macros.calendar.daynames[d]);
if(d == (config.options.txtCalStartOfWeekend-0) || d == (config.options.txtCalStartOfWeekend-0+1))
cell.style.background = config.macros.calendar.weekendbg;
}
}
}
//}}}
//{{{
function createCalendarDays(row, col, first, max, year, mon)
{
var i;
if (config.options.chkDisplayWeekNumbers){
if (first<=max) {
var ww = new Date(year,mon,first);
createTiddlyElement(row, "td", null, null, "w"+ww.getWeek());//wn**
}
else createTiddlyElement(row, "td", null, null, null);//wn**
}
for(i = 0; i < col; i++) {
createTiddlyElement(row, "td", null, null, null);
}
var day = first;
for(i = col; i < 7; i++) {
var d = i + (config.options.txtCalFirstDay - 0);
if(d > 6) d = d - 7;
var daycell = createTiddlyElement(row, "td", null, null, null);
var isaWeekend = ((d == (config.options.txtCalStartOfWeekend-0) || d == (config.options.txtCalStartOfWeekend-0+1))? true:false);
if(day > 0 && day <= max) {
var celldate = new Date(year, mon, day);
// ELS 2005.10.30: use <<date>> macro's showDate() function to create popup
if (window.showDate) {
showDate(daycell,celldate,"popup","DD",config.macros.calendar.journalDateFmt,true, isaWeekend); // ELS 5/29/06 - use journalDateFmt
} else {
if(isaWeekend) daycell.style.background = config.macros.calendar.weekendbg;
var title = celldate.formatString(config.macros.calendar.tiddlerformat);
if(calendarIsHoliday(celldate)) {
daycell.style.background = config.macros.calendar.holidaybg;
}
if(window.findTiddlersWithReminders == null) {
var link = createTiddlyLink(daycell, title, false);
link.appendChild(document.createTextNode(day));
} else {
var button = createTiddlyButton(daycell, day, title, onClickCalendarDate);
}
}
}
day++;
}
}
//}}}
// //We've clicked on a day in a calendar - create a suitable pop-up of options.
// //The pop-up should contain:
// // * a link to create a new entry for that date
// // * a link to create a new reminder for that date
// // * an <hr>
// // * the list of reminders for that date
//{{{
function onClickCalendarDate(e)
{
var button = this;
var date = button.getAttribute("title");
var dat = new Date(date.substr(6,4), date.substr(3,2)-1, date.substr(0, 2));
date = dat.formatString(config.macros.calendar.tiddlerformat);
var popup = createTiddlerPopup(this);
popup.appendChild(document.createTextNode(date));
var newReminder = function() {
var t = store.getTiddlers(date);
displayTiddler(null, date, 2, null, null, false, false);
if(t) {
document.getElementById("editorBody" + date).value += "\n<<reminder day:" + dat.getDate() +
" month:" + (dat.getMonth()+1) +
" year:" + (dat.getYear()+1900) + " title: >>";
} else {
document.getElementById("editorBody" + date).value = "<<reminder day:" + dat.getDate() +
" month:" + (dat.getMonth()+1) +
" year:" + (dat.getYear()+1900) + " title: >>";
}
};
var link = createTiddlyButton(popup, "New reminder", null, newReminder);
popup.appendChild(document.createElement("hr"));
var t = findTiddlersWithReminders(dat, [0,14], null, 1);
for(var i = 0; i < t.length; i++) {
link = createTiddlyLink(popup, t[i].tiddler, false);
link.appendChild(document.createTextNode(t[i].tiddler));
}
}
//}}}
//{{{
function calendarMaxDays(year, mon)
{
var max = config.macros.calendar.monthdays[mon];
if(mon == 1 && (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0)) {
max++;
}
return max;
}
//}}}
//{{{
function createCalendarDayRows(cal, year, mon)
{
var row = createTiddlyElement(cal, "tr", null, null, null);
var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first1 < 0) first1 = first1 + 7;
var day1 = -first1 + 1;
var first2 = (new Date(year, mon+1, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first2 < 0) first2 = first2 + 7;
var day2 = -first2 + 1;
var first3 = (new Date(year, mon+2, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first3 < 0) first3 = first3 + 7;
var day3 = -first3 + 1;
var max1 = calendarMaxDays(year, mon);
var max2 = calendarMaxDays(year, mon+1);
var max3 = calendarMaxDays(year, mon+2);
while(day1 <= max1 || day2 <= max2 || day3 <= max3) {
row = createTiddlyElement(cal, "tr", null, null, null);
createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
createCalendarDays(row, 0, day2, max2, year, mon+1); day2 += 7;
createCalendarDays(row, 0, day3, max3, year, mon+2); day3 += 7;
}
}
//}}}
//{{{
function createCalendarDayRowsSingle(cal, year, mon)
{
var row = createTiddlyElement(cal, "tr", null, null, null);
var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first1 < 0) first1 = first1+ 7;
var day1 = -first1 + 1;
var max1 = calendarMaxDays(year, mon);
while(day1 <= max1) {
row = createTiddlyElement(cal, "tr", null, null, null);
createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
}
}
//}}}
// //ELS 2005.10.30: added styles
//{{{
setStylesheet(".calendar, .calendar table, .calendar th, .calendar tr, .calendar td { text-align:center; } .calendar, .calendar a { margin:0px !important; padding:5px !important; }", "calendarStyles");
//}}}
// // override cookie settings for CalendarPlugin:
//{{{
config.options.txtCalFirstDay=6;
config.options.txtCalStartOfWeekend=5;
//}}}
/***
|Name|CheckboxPlugin|
|Source|http://www.TiddlyTools.com/#CheckboxPlugin|
|Documentation|http://www.TiddlyTools.com/#CheckboxPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Add checkboxes to your tiddler content|
This plugin extends the TiddlyWiki syntax to allow definition of checkboxes that can be embedded directly in tiddler content. Checkbox states are preserved by:
* by setting/removing tags on specified tiddlers,
* or, by setting custom field values on specified tiddlers,
* or, by saving to a locally-stored cookie ID,
* or, automatically modifying the tiddler content (deprecated)
When an ID is assigned to the checkbox, it enables direct programmatic access to the checkbox DOM element, as well as creating an entry in TiddlyWiki's config.options[ID] internal data. In addition to tracking the checkbox state, you can also specify custom javascript for programmatic initialization and onClick event handling for any checkbox, so you can provide specialized side-effects in response to state changes.
!!!!!Documentation
>see [[CheckboxPluginInfo]]
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to [[CheckboxPluginInfo]]
2008.01.05 [2.4.0] set global "window.place" to current checkbox element when processing checkbox clicks. This allows init/beforeClick/afterClick handlers to reference RELATIVE elements, including using "story.findContainingTiddler(place)". Also, wrap handlers in "function()" so "return" can be used within handler code.
|please see [[CheckboxPluginInfo]] for additional revision details|
2005.12.07 [0.9.0] initial BETA release
<<<
!!!!!Code
***/
//{{{
version.extensions.CheckboxPlugin = {major: 2, minor: 4, revision:0 , date: new Date(2008,1,5)};
//}}}
//{{{
config.checkbox = { refresh: { tagged:true, tagging:true, container:true } };
config.formatters.push( {
name: "checkbox",
match: "\\[[xX_ ][\\]\\=\\(\\{]",
lookahead: "\\[([xX_ ])(=[^\\s\\(\\]{]+)?(\\([^\\)]*\\))?({[^}]*})?({[^}]*})?({[^}]*})?\\]",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
// get params
var checked=(lookaheadMatch[1].toUpperCase()=="X");
var id=lookaheadMatch[2];
var target=lookaheadMatch[3];
if (target) target=target.substr(1,target.length-2).trim(); // trim off parentheses
var fn_init=lookaheadMatch[4];
var fn_clickBefore=lookaheadMatch[5];
var fn_clickAfter=lookaheadMatch[6];
var tid=story.findContainingTiddler(w.output); if (tid) tid=tid.getAttribute("tiddler");
var srctid=w.tiddler?w.tiddler.title:null;
config.macros.checkbox.create(w.output,tid,srctid,w.matchStart+1,checked,id,target,config.checkbox.refresh,fn_init,fn_clickBefore,fn_clickAfter);
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} );
config.macros.checkbox = {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
if(!(tiddler instanceof Tiddler)) { // if no tiddler passed in try to find one
var here=story.findContainingTiddler(place);
if (here) tiddler=store.getTiddler(here.getAttribute("tiddler"))
}
var srcpos=0; // "inline X" not applicable to macro syntax
var target=params.shift(); if (!target) target="";
var defaultState=params[0]=="checked"; if (defaultState) params.shift();
var id=params.shift(); if (id && !id.length) id=null;
var fn_init=params.shift(); if (fn_init && !fn_init.length) fn_init=null;
var fn_clickBefore=params.shift();
if (fn_clickBefore && !fn_clickBefore.length) fn_clickBefore=null;
var fn_clickAfter=params.shift();
if (fn_clickAfter && !fn_clickAfter.length) fn_clickAfter=null;
var refresh={ tagged:true, tagging:true, container:false };
this.create(place,tiddler.title,tiddler.title,0,defaultState,id,target,refresh,fn_init,fn_clickBefore,fn_clickAfter);
},
create: function(place,tid,srctid,srcpos,defaultState,id,target,refresh,fn_init,fn_clickBefore,fn_clickAfter) {
// create checkbox element
var c = document.createElement("input");
c.setAttribute("type","checkbox");
c.onclick=this.onClickCheckbox;
c.srctid=srctid; // remember source tiddler
c.srcpos=srcpos; // remember location of "X"
c.container=tid; // containing tiddler (may be null if not in a tiddler)
c.tiddler=tid; // default target tiddler
c.refresh = {};
c.refresh.container = refresh.container;
c.refresh.tagged = refresh.tagged;
c.refresh.tagging = refresh.tagging;
place.appendChild(c);
// set default state
c.checked=defaultState;
// track state in config.options.ID
if (id) {
c.id=id.substr(1); // trim off leading "="
if (config.options[c.id]!=undefined)
c.checked=config.options[c.id];
else
config.options[c.id]=c.checked;
}
// track state in (tiddlername|tagname) or (fieldname@tiddlername)
if (target) {
var pos=target.indexOf("@");
if (pos!=-1) {
c.field=pos?target.substr(0,pos):"checked"; // get fieldname (or use default "checked")
c.tiddler=target.substr(pos+1); // get specified tiddler name (if any)
if (!c.tiddler || !c.tiddler.length) c.tiddler=tid; // if tiddler not specified, default == container
if (store.getValue(c.tiddler,c.field)!=undefined)
c.checked=(store.getValue(c.tiddler,c.field)=="true"); // set checkbox from saved state
} else {
var pos=target.indexOf("|"); if (pos==-1) var pos=target.indexOf(":");
c.tag=target;
if (pos==0) c.tag=target.substr(1); // trim leading "|" or ":"
if (pos>0) { c.tiddler=target.substr(0,pos); c.tag=target.substr(pos+1); }
if (!c.tag.length) c.tag="checked";
var t=store.getTiddler(c.tiddler);
if (t && t.tags)
c.checked=t.isTagged(c.tag); // set checkbox from saved state
}
}
// trim off surrounding { and } delimiters from init/click handlers
if (fn_init) c.fn_init="(function(){"+fn_init.trim().substr(1,fn_init.length-2)+"})()";
if (fn_clickBefore) c.fn_clickBefore="(function(){"+fn_clickBefore.trim().substr(1,fn_clickBefore.length-2)+"})()";
if (fn_clickAfter) c.fn_clickAfter="(function(){"+fn_clickAfter.trim().substr(1,fn_clickAfter.length-2)+"})()";
c.init=true; c.onclick(); c.init=false; // compute initial state and save in tiddler/config/cookie
},
onClickCheckbox: function(event) {
window.place=this;
if (this.init && this.fn_init) // custom function hook to set initial state (run only once)
{ try { eval(this.fn_init); } catch(e) { displayMessage("Checkbox init error: "+e.toString()); } }
if (!this.init && this.fn_clickBefore) // custom function hook to override changes in checkbox state
{ try { eval(this.fn_clickBefore) } catch(e) { displayMessage("Checkbox onClickBefore error: "+e.toString()); } }
if (this.id)
// save state in config AND cookie (only when ID starts with 'chk')
{ config.options[this.id]=this.checked; if (this.id.substr(0,3)=="chk") saveOptionCookie(this.id); }
if (this.srctid && this.srcpos>0 && (!this.id || this.id.substr(0,3)!="chk") && !this.tag && !this.field) {
// save state in tiddler content only if not using cookie, tag or field tracking
var t=store.getTiddler(this.srctid); // put X in original source tiddler (if any)
if (t && this.checked!=(t.text.substr(this.srcpos,1).toUpperCase()=="X")) { // if changed
t.set(null,t.text.substr(0,this.srcpos)+(this.checked?"X":"_")+t.text.substr(this.srcpos+1),null,null,t.tags);
if (!story.isDirty(t.title)) story.refreshTiddler(t.title,null,true);
store.setDirty(true);
}
}
if (this.field) {
if (this.checked && !store.tiddlerExists(this.tiddler))
store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
// set the field value in the target tiddler
store.setValue(this.tiddler,this.field,this.checked?"true":"false");
// DEBUG: displayMessage(this.field+"@"+this.tiddler+" is "+this.checked);
}
if (this.tag) {
if (this.checked && !store.tiddlerExists(this.tiddler))
store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
var t=store.getTiddler(this.tiddler);
if (t) {
var tagged=(t.tags && t.tags.indexOf(this.tag)!=-1);
if (this.checked && !tagged) { t.tags.push(this.tag); store.setDirty(true); }
if (!this.checked && tagged) { t.tags.splice(t.tags.indexOf(this.tag),1); store.setDirty(true); }
}
// if tag state has been changed, update display of corresponding tiddlers (unless they are in edit mode...)
if (this.checked!=tagged) {
if (this.refresh.tagged) {
if (!story.isDirty(this.tiddler)) // the TAGGED tiddler in view mode
story.refreshTiddler(this.tiddler,null,true);
else // the TAGGED tiddler in edit mode (with tags field)
config.macros.checkbox.refreshEditorTagField(this.tiddler,this.tag,this.checked);
}
if (this.refresh.tagging)
if (!story.isDirty(this.tag)) story.refreshTiddler(this.tag,null,true); // the TAGGING tiddler
}
}
if (!this.init && this.fn_clickAfter) // custom function hook to react to changes in checkbox state
{ try { eval(this.fn_clickAfter) } catch(e) { displayMessage("Checkbox onClickAfter error: "+e.toString()); } }
// refresh containing tiddler (but not during initial rendering, or we get an infinite loop!) (and not when editing container)
if (!this.init && this.refresh.container && this.container!=this.tiddler)
if (!story.isDirty(this.container)) story.refreshTiddler(this.container,null,true); // the tiddler CONTAINING the checkbox
return true;
},
refreshEditorTagField: function(title,tag,set) {
var tagfield=story.getTiddlerField(title,"tags");
if (!tagfield||tagfield.getAttribute("edit")!="tags") return; // if no tags field in editor (i.e., custom template)
var tags=tagfield.value.readBracketedList();
if (tags.contains(tag)==set) return; // if no change needed
if (set) tags.push(tag); // add tag
else tags.splice(tags.indexOf(tag),1); // remove tag
for (var t=0;t<tags.length;t++) tags[t]=String.encodeTiddlyLink(tags[t]);
tagfield.value=tags.join(" "); // reassemble tag string (with brackets as needed)
return;
}
}
//}}}
/%
|Name|ChecklistScript|
|Source|http://www.TiddlyTools.com/#ChecklistScript|
|Version|1.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.4|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|sample HTML/script to create simple self-contained tag-based checklists|
IMPORTANT NOTE: for proper display, this tiddler requires either TiddlyWiki version 2.4 or above, or TiddlyTools' [[CoreTweaksArchive]] fix for ticket #578 (trims leading/trailing newlines from tiddler section content).
----- EDIT THIS SECTION ONLY ----- %/
Fem ting at gøre HVER dag:
<<<
<<tiddler ChecklistScript##toggletag with: spørgsmål>> Stil spørgsmål
<<tiddler ChecklistScript##toggletag with: svar>> Søg svar
<<tiddler ChecklistScript##toggletag with: sjov>> Hav det sjovt
<<tiddler ChecklistScript##toggletag with: forskel>> Gør en forskel
<<tiddler ChecklistScript##toggletag with: smil>> Smil
----
<<tiddler ChecklistScript##toggleall with: "spørgsmål svar sjov forskel smil">> //slå alle ting til//
<<<
<<tiddler ChecklistScript##resetall with: "reset alle" "spørgsmål svar sjov forskel smil">>
/% ----- DO NOT EDIT BELOW THIS LINE -----
!toggletag
<html><hide linebreaks><form style="display:inline">
<input type="checkbox" name='c' onclick="
var tid=story.findContainingTiddler(this).getAttribute('tiddler');
store.setTiddlerTag(tid,this.checked,'$1');
">
</form></html><script>
var t=store.getTiddler(story.findContainingTiddler(place).getAttribute('tiddler'));
place.lastChild.getElementsByTagName('form')[0].c.checked=t.isTagged('$1');
</script>
!end toggletag
!toggleall
<html><hide linebreaks><form style="display:inline">
<input type="checkbox" name="c" onclick="
var tid=story.findContainingTiddler(this).getAttribute('tiddler');
var tags='$1'.readBracketedList();
store.suspendNotifications();
for (var t=0; t<tags.length; t++)
store.setTiddlerTag(tid,this.checked,tags[t]);
store.resumeNotifications();
story.refreshTiddler(tid,null,true);
">
</form></html><script>
var t=store.getTiddler(story.findContainingTiddler(place).getAttribute('tiddler'));
var tags='$1'.readBracketedList();
place.lastChild.getElementsByTagName('form')[0].c.checked=t.tags.containsAll(tags);
</script>
!end toggleall
!resetall
<html><hide linebreaks><form style="display:inline">
<input type="button" value="$1" onclick="
var tid=story.findContainingTiddler(this).getAttribute('tiddler');
var tags='$2'.readBracketedList();
store.suspendNotifications();
for (var t=0; t<tags.length; t++)
store.setTiddlerTag(tid,false,tags[t]);
store.resumeNotifications();
story.refreshTiddler(tid,null,true);
"></form></html>
!end resetall
%/
/***
|Name|ClickifyPlugin|
|Source|http://www.TiddlyTools.com/#ClickifyPlugin|
|Documentation|http://www.TiddlyTools.com/#ClickifyPlugin|
|Version|1.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|re-compute parameters when a 'command link' macro is clicked|
!!!!!Usage
<<<
Normally, when you use a //computed parameter// in a macro, it's value is determined when the macro is rendered. The {{{<<clickify>>}}} macro can be used to force the macro parameters of an 'on-click' command link (such as created by the {{{<<newTiddler>>}}} macro) to be automatically re-computed when the command link is clicked, rather than when it is initially displayed. This allows use of computed values that depend upon data that may change between the time the macro is rendered and when it's action is actually triggered by a click.
To apply this extended processing to any macro that creates a command link, simply insert the 'clickify' keyword in front of the usual macro name, like this:
{{{
<<clickify macroName param param param ...>>
}}}
<<<
!!!!!Example
<<<
When {{{<<newTiddler>>}}} is clicked, prompt for a title and set default text to current timestamp:
{{{
<<clickify newTiddler title:{{prompt('enter a title','NewTiddler')}} text:{{new Date()}}>>
}}}
><<clickify newTiddler title:{{prompt('enter a title','NewTiddler')}} text:{{new Date()}}>>
<<<
!!!!!Revisions
<<<
2009.02.08 [1.0.1] make sure command link has been rendered before trying to modify it
2009.01.25 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ClickifyPlugin={major: 1, minor: 0, revision: 1, date: new Date(2009,2,8)};
config.macros.clickify={
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var cmd='<<'+paramString+'>>';
var e=createTiddlyElement(place,'span');
wikify(cmd.replace(/alert\(|prompt\(|confirm\(/g,'isNaN('),e);
var b=e.getElementsByTagName('a')[0]; if (!b) return;
b.setAttribute('cmd',cmd);
b.onclick=function(ev) {
var cmd=this.getAttribute('cmd');
var e=createTiddlyElement(this.parentNode,'span');
e.style.display='none';
wikify(cmd,e);
e.getElementsByTagName('a')[0].onclick();
this.parentNode.removeChild(e);
}
}
}
//}}}
/***
|Name:|CloseOnCancelPlugin|
|Description:|Closes the tiddler if you click new tiddler then cancel. Default behaviour is to leave it open|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#CloseOnCancelPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.commands.cancelTiddler,{
handler_mptw_orig_closeUnsaved: config.commands.cancelTiddler.handler,
handler: function(event,src,title) {
this.handler_mptw_orig_closeUnsaved(event,src,title);
if (!store.tiddlerExists(title) && !store.isShadowTiddler(title))
story.closeTiddler(title,true);
return false;
}
});
//}}}
//{{{
/***
|Name:|AutoClearMessageMacro|
|Description|It auto closes the pop-up messages after 3 seconds.Change the 3000 to modify the time.|
***/
{{{
//window.oldDisplayMessage = displayMessage;
//displayMessage = function (text,linkText)
//{ oldDisplayMessage(text,linkText);
//setTimeout( 'clearMessage()', 9000 );}
}}}
config.options.chkShowQuickEdit=true;
//tweak closeAll for toolbar
config.commands.closeAll ={
text:"luk alle",
tooltip:"luk alle"};
config.commands.closeAll.handler = function(event,src,title)
{story.closeAllTiddlers();return false;}
//config TiddlersBar
config.options.chkDisableTabsBar=false;
// re-label default text for some standard UI elements
config.commands.permalink.text="link";
config.commands.references.text="references";
merge(config.macros.toolbar,{ moreLabel: 'more\u25BC', lessLabel: '\u25C4less' });
// allows custom response when tiddler does not exist (e.g. redirection to alternative tiddler)
config.shadowTiddlers.MissingTiddler=config.views.wikified.defaultText.replace(/%0/,'$1'); // default to standard message
config.views.wikified.defaultText='<<tiddler MissingTiddler with: [[%0]]>>';
// wrap AdvancedOptions and PluginManager default content in a groupbox (and use a smaller font)
config.shadowTiddlers.AdvancedOptions=
config.shadowTiddlers.AdvancedOptions.replace(
/<<options>>/,
"{{small groupbox{<<options>>}}}");
config.shadowTiddlers.PluginManager=
config.shadowTiddlers.PluginManager.replace(
/<<plugins>>/,
"{{small groupbox{<<plugins>>}}}");
// message used by ConfirmExitPlugin when no changes have been made
config.messages.confirmExit_nochanges='\tTiddlyTools... Small Tools for Big Ideas™\n\t'
+store.getTiddlerText("SiteUrl",document.location.protocol=="http"?document.location.href:"");
//}}}
/***
|Name|ConfirmSavePlugin|
|Source|http://www.TiddlyTools.com/#ConfirmSavePlugin|
|Documentation|http://www.TiddlyTools.com/#ConfirmSavePlugin|
|Version|1.1.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|window.saveChanges()|
|Options|##Configuration|
|Description|if tiddlers are being edited, or there are no unsaved changes, ask before saving|
When <<saveChanges>> command link is clicked, if there are tiddlers still being edited or there are no changes unsaved changes, then ask for confirmation before saving the document to the file.
!!!!!Configuration
<<<
:
<<option chkConfirmSaveIfEditing>> confirm saving if tiddlers are still being edited
<<option chkConfirmSaveIfNoChanges>> confirm saving if there are no unsaved tiddler changes
<<<
!!!!!Revisions
<<<
2008.03.15 [1.1.0] added option settings and check for 'no unsaved changes'
2008.03.15 [1.0.0] Initial Release.
<<<
!!!!!Code
***/
//{{{
version.extensions.ConfirmSavePlugin= {major: 1, minor: 1, revision: 0, date: new Date(2008,3,15)};
//}}}
//{{{
if (config.options.chkConfirmSaveIfEditing==undefined) config.options.chkConfirmSaveIfEditing=true;
if (config.options.chkConfirmSaveIfNoChanges==undefined) config.options.chkConfirmSaveIfNoChanges=true;
//}}}
//{{{
if (config.macros.saveChanges.confirmSave_onClick==undefined)
config.macros.saveChanges.confirmSave_onClick=config.macros.saveChanges.onClick
config.macros.saveChanges.onClick=function(e) {
var msg="";
var editing=[]; // check for tiddlers being edited
if (config.options.chkConfirmSaveIfEditing)
story.forEachTiddler(function(tid,elem) { if (elem.getAttribute("dirty")=="true") editing.push(tid);});
if (editing.length) {
msg+="There "+(editing.length>1?"are ":"is ")+editing.length;
msg+=" tiddler"+(editing.length>1?"s":"")+" currently being edited:\n\n";
msg+=editing.join(", ")+"\n\n";
msg+="Changes to "+(editing.length>1?"these tiddlers":"this tiddler");
msg+=" will not be saved until editing is completed.";
} else if (config.options.chkConfirmSaveIfNoChanges && !store.isDirty())
msg+="There are no unsaved tiddler changes";
if (msg.length) {
msg+="\n\nPress OK to save the document anyway.";
if (!confirm(msg)) return false;
}
return config.macros.saveChanges.confirmSave_onClick.apply(this,arguments); // let core save
}
//}}}
{{center{
<script>var today=new Date();document.write('<font style="color:#666">'+'URL='+window.location+'</font>')</script>~~
@@color:#666;^^<script>
var tiddlers=store.getTiddlers("modified");
var last=tiddlers[tiddlers.length-1];
var when=last.modified.formatString("YYYY/0MM/0DD at 0hh:0mm:0ss");
return "Last Modified: " +when
</script>^^@@
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
var path = options.path ? '; path=' + options.path : '';
var domain = options.domain ? '; domain=' + options.domain : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};
/***
|Name|CoreTweaks|
|Source|http://www.TiddlyTools.com/#CoreTweaks|
|Version|use with TW2.4.3|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2.0|
|Type|plugin|
|Requires||
|Overrides|various|
|Description|a small collection of overrides to TW core functions|
This tiddler contains changes TW core functions to provide minor changes in standard features or behavior. It is hoped that some of these tweaks may someday be added into the TW core, so that these adjustments will be available without needing these add-on definitions.
>''Note: the changes contained in this tiddler are generally applicable for version 2.4.3 of TiddlyWiki.''
>Please view [[CoreTweaksArchive]] for tweaks that may be used with earlier versions of TiddlyWiki.
***/
//{{{
// calculate TW version number - used to determine which tweaks should be applied
var ver=version.major+version.minor/10+version.revision/100;
//}}}
/***
----
***/
// // open tickets:
// // {{block{
/***
!!!890 add conditional test to """<<tiddler>>""" macro
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/890 - OPEN
This tweak extends the {{{<<tiddler>>}}} macro syntax so you can include a javascript-based //test expression// to determine if the tiddler transclusion should be performed:
{{{
<<tiddler TiddlerName if:{{...}} with: param param etc.>>
}}}
If the test is ''true'', then the tiddler is transcluded as usual. If the test is ''false'', then the transclusion is skipped and //no output is produced//.
***/
//{{{
config.macros.tiddler.if_handler = config.macros.tiddler.handler;
config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
params = paramString.parseParams('name',null,true,false,true);
if (!getParam(params,'if',true)) return;
this.if_handler.apply(this,arguments);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!831 backslash-quoting for embedding newlines in 'line-mode' formats
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/831 - OPEN
This tweak pre-processes source content to convert 'double-backslash-newline' into {{{<br>}}} before wikify(), so that literal newlines can be embedded in line-mode wiki syntax (e.g., tables, bullets, etc.)
***/
//{{{
window.coreWikify = wikify;
window.wikify = function(source,output,highlightRegExp,tiddler)
{
if (source) arguments[0]=source.replace(/\\\\\n/mg,'<br>');
coreWikify.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!829 """<<tag>>""" macro - sortby parameter
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/829 - OPEN
This tweak adds an optional 'sortby' parameter to the """<<tag tagname label tip sortby>>""" macro, as well as the """<<allTags excludeTag sortby>>""" macro used to generate the sidebar contents 'tags' list. Specify the field on which the contents of each tag popup is to be sorted, with a '+' or '-' prefix to indicate ascending/descending order, respectively.
Example: """<<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>"""
Try it: <<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>
Similarly, to change the sort order used by the popups from all tags shown in the sidebar contents, edit the [[TagTags]] shadow tiddler and enter: """<<allTags excludeLists -modified>>"""
***/
//{{{
// hijack tag handler() to add 'sortby' attribute to tag button
config.macros.tag.CoreTweaksSortTags_handler=config.macros.tag.handler;
config.macros.tag.handler = function(place,macroName,params)
{
this.CoreTweaksSortTags_handler.apply(this,arguments);
var btn=place.lastChild;
if (params[3]) btn.setAttribute('sortby',params[3]);
}
// tweak <<allTags>> macro to add 'sortby' attribute to each tag button
var fn=config.macros.allTags.handler;
var lines=fn.toString().split('\n');
lines.splice(lines.length-2,0,['if(params[1]) btn.setAttribute("sortby",params[1]);']);
fn=lines.join('\n');
eval('config.macros.allTags.handler='+fn);
// tweak tag event handler to:
// * use tag filtering (only if '[' is present in tag value)
// * use optional 'sortby' attribute
// * save 'sortby' value in 'open all' command (for displaying tiddlers in sorted order)
var fn=onClickTag;
fn=fn.toString().replace(
/store.getTaggedTiddlers\(tag\);/g,
'(tag.indexOf("[")==-1?store.getTaggedTiddlers(tag):store.filterTiddlers(tag));'
+'var sortby=this.getAttribute("sortby");'
+'if(sortby&&sortby.length) store.sortTiddlers(tagged,sortby);'
);
fn=fn.toString().replace(
/openAll.setAttribute\("tag",\s*tag\);/g,
'openAll.setAttribute("tag",tag); openAll.setAttribute("sortby",sortby);'
);
eval(fn);
// tweak 'open all' event handler to use 'sortby' attribute
var fn=onClickTagOpenAll;
fn=fn.toString().replace(
/story.displayTiddlers\(this,\s*tiddlers\);/g,
'var sortby=this.getAttribute("sortby");'
+'if(sortby&&sortby.length) store.sortTiddlers(tiddlers,sortby);'
+'story.displayTiddlers(this,tiddlers);'
);
eval(fn);
//}}}
// // }}}}}}// // {{block{
/***
!!!824 ~WindowTitle - alternative to combined ~SiteTitle/~SiteSubtitle in window titlebar
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/824 - OPEN
This tweak allows definition of an optional [[WindowTitle]] tiddler that, when present, provides alternative text for display in the browser window's titlebar, instead of using the combined text content from [[SiteTitle]] and [[SiteSubtitle]] (which will still be displayed as usual in the TiddlyWiki document header area).
Note: this ticket replaces http://trac.tiddlywiki.org/ticket/401 (closed), which proposed using a custom [[PageTitle]] tiddler for this purpose. ''If you were using the previous '401 ~PageTitle' tweak, you will need to rename [[PageTitle]] to [[WindowTitle]] to continue to use your custom window title text''
***/
//{{{
config.shadowTiddlers.WindowTitle='<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>';
window.getPageTitle=function() { return wikifyPlain('WindowTitle'); }
store.addNotification('WindowTitle',refreshPageTitle); // so title stays in sync with tiddler changes
//}}}
// // }}}}}}// // {{block{
/***
!!!784 allow tiddler sections in TiddlyLinks to be used as anchor points for intra-tiddler scrolling.
>http://trac.tiddlywiki.org/ticket/784 - OPEN - Please see separate [[SectionLinksPlugin]]
!!!683 FireFox3 Import bug: 'browse' button replacement
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/683 - OPEN
The web standard 'type=file' input control that has been used as a local path/file picker for TiddlyWiki no longer works as expected in FireFox3, which has, for security reasons, limited javascript access to this control so that *no* local filesystem path information can be revealed, even when it is intentional and necessary, as it is with TiddlyWiki. This tweak provides alternative HTML source that patches the backstage import panel. It replaces the 'type=file' input control with a text+button combination of controls that invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
>Note: ''This tweak also requires http://trac.tiddlywiki.org/ticket/604 - cross-platform askForFilename()''
***/
//{{{
if (window.Components) {
var fixhtml='<input name="txtBrowse" style="width:30em"><input type="button" value="..."'
+' onClick="window.browseForFilename(this.previousSibling,true)">';
var cmi=config.macros.importTiddlers;
cmi.step1Html=cmi.step1Html.replace(/<input type='file' size=50 name='txtBrowse'>/,fixhtml);
}
merge(config.messages,{selectFile:'Please enter or select a file'}); // ready for I18N translation
window.browseForFilename=function(target,mustExist) { // note: both params are optional
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.askForFilename(msg,path,file,mustExist); // requires #604
if (target && result.length) // set target field and trigger handling
{ target.value=result; target.onchange(); }
return result;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!604 cross-platform askForFilename()
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/604 - OPEN
invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
***/
//{{{
window.askForFilename=function(msg,path,file,mustExist) {
var r = window.mozAskForFilename(msg,path,file,mustExist);
if(r===null || r===false)
r = window.ieAskForFilename(msg,path,file,mustExist);
if(r===null || r===false)
r = window.javaAskForFilename(msg,path,file,mustExist);
if(r===null || r===false)
r = prompt(msg,path+file);
return r||'';
}
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='html';
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;
}
window.ieAskForFilename=function(msg,path,file,mustExist) {
if(!config.browser.isIE) return false;
try {
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
s.FilterIndex=3; // default to HTML files;
s.InitialDir=path;
s.FileName=file;
return s.showOpen()?s.FileName:'';
}
catch(ex) { displayMessage(ex.toString()); }
return result;
}
window.javaAskForFilename=function(msg,path,file,mustExist) {
if(!document.applets['TiddlySaver']) return false;
// TBD: implement java-based askFile(...) function
try { return document.applets['TiddlySaver'].askFile(msg,path,file,mustExist); }
catch(ex) { displayMessage(ex.toString()); }
}
//}}}
// // }}}}}}// // {{block{
/***
!!!657 wrap tabs onto multiple lines
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/657 - OPEN
This tweak inserts an extra space element following each tab, allowing them to wrap onto multiple lines if needed.
***/
//{{{
config.macros.tabs.handler = function(place,macroName,params)
{
var cookie = params[0];
var numTabs = (params.length-1)/3;
var wrapper = createTiddlyElement(null,'div',null,'tabsetWrapper ' + cookie);
var tabset = createTiddlyElement(wrapper,'div',null,'tabset');
tabset.setAttribute('cookie',cookie);
var validTab = false;
for(var t=0; t<numTabs; t++) {
var label = params[t*3+1];
var prompt = params[t*3+2];
var content = params[t*3+3];
var tab = createTiddlyButton(tabset,label,prompt,this.onClickTab,'tab tabUnselected');
createTiddlyElement(tab,'span',null,null,' ',{style:'font-size:0pt;line-height:0px'}); // ELS
tab.setAttribute('tab',label);
tab.setAttribute('content',content);
tab.title = prompt;
if(config.options[cookie] == label)
validTab = true;
}
if(!validTab)
config.options[cookie] = params[1];
place.appendChild(wrapper);
this.switchTab(tabset,config.options[cookie]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!628 hide 'no such macro' errors
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/628 - OPEN
When invoking a macro that is not defined, this tweak prevents the display of the 'error in macro... no such macro' message. This is useful when rendering tiddler content or templates that reference macros that are defined by //optional// plugins that have not been installed in the current document.
<<option chkHideMissingMacros>> hide 'no such macro' error messages
***/
//{{{
if (config.options.chkHideMissingMacros===undefined)
config.options.chkHideMissingMacros=false;
window.coreTweaks_missingMacro_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
if (!config.macros[macro] || !config.macros[macro].handler)
if (config.options.chkHideMissingMacros) return;
window.coreTweaks_missingMacro_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!608/609/610 toolbars - toggles, separators and transclusion
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/608 - OPEN (more/less toggle)
http://trac.tiddlywiki.org/ticket/609 - OPEN (separators)
http://trac.tiddlywiki.org/ticket/610 - OPEN (wikify tiddler/slice/section content)
This combination tweak extends the """<<toolbar>>""" macro to add use of '<' to insert a 'less' menu command (the opposite of '>' == 'more'), as well as use of '*' to insert linebreaks and "!" to insert a vertical line separator between toolbar items. In addition, this tweak add the ability to use references to tiddlernames, slices, or sections and render their content inline within the toolbar, allowing easy creation of new toolbar commands using TW content (such as macros, links, inline scripts, etc.)
To produce a one-line style, with "less" at the end, use
| ViewToolbar| foo bar baz > yabba dabba doo < |
resulting in:
{{{
foo bar baz more
and
foo bar baz yabba dabba doo less
}}}
or to use the CoreTweaks? two-line style:
| ViewToolbar| foo bar baz > < * yabba dabba doo |
which would produce:
{{{
foo bar baz more
and
foo bar baz less
yabba dabba doo
}}}
''see [[ToolbarCommands]] for examples of how these features can be used''
***/
//{{{
merge(config.macros.toolbar,{
moreLabel: 'mere\u25BC',
morePrompt: 'Show additional commands',
lessLabel: '\u25C4mindre',
lessPrompt: 'Hide additional commands',
separator: '|'
});
config.macros.toolbar.onClickMore = function(ev) {
var e = this.nextSibling;
e.style.display = 'inline'; // show menu
this.style.display = 'none'; // hide button
return false;
};
config.macros.toolbar.onClickLess = function(ev) {
var e = this.parentNode;
var m = e.previousSibling;
e.style.display = 'none'; // hide menu
m.style.display = 'inline'; // show button
return false;
};
config.macros.toolbar.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
for(var t=0; t<params.length; t++) {
var c = params[t];
switch(c) {
case '!': // ELS - SEPARATOR (added)
createTiddlyText(place,this.separator);
break;
case '*': // ELS - LINEBREAK (added)
createTiddlyElement(place,'BR');
break;
case '<': // ELS - LESS COMMAND (added)
var btn = createTiddlyButton(place,
this.lessLabel,this.lessPrompt,config.macros.toolbar.onClickLess,'moreCommand');
break;
case '>':
var btn = createTiddlyButton(place,
this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore,'moreCommand');
var e = createTiddlyElement(place,'span',null,'moreCommand');
e.style.display = 'none';
place = e;
break;
default:
var theClass = '';
switch(c.substr(0,1)) {
case '+':
theClass = 'defaultCommand';
c = c.substr(1);
break;
case '-':
theClass = 'cancelCommand';
c = c.substr(1);
break;
}
if(c in config.commands)
this.createCommand(place,c,tiddler,theClass);
else { // ELS - WIKIFY TIDDLER/SLICE/SECTION (added)
if (c.substr(0,1)=='~') c=c.substr(1); // ignore leading ~
var txt=store.getTiddlerText(c);
if (txt) {
// trim any leading/trailing newlines
txt=txt.replace(/^\n*/,'').replace(/\n*$/,'');
// trim PRE format wrapper if any
txt=txt.replace(/^\{\{\{\n/,'').replace(/\n\}\}\}$/,'');
// render content into toolbar
wikify(txt,createTiddlyElement(place,'span'),null,tiddler);
}
} // ELS - end WIKIFY CONTENT
break;
}
}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!529 IE fixup - case-sensitive element lookup of tiddler elements
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/529 - OPEN
This tweak hijacks the standard browser function, document.getElementById(), to work-around the case-INsensitivity error in Internet Explorer (all versions up to and including IE7) //''Note: This tweak is only applied when using IE, and only for lookups of rendered tiddler elements within the containing 'tiddlerDisplay' element.''//
***/
//{{{
if (config.browser.isIE) {
document.coreTweaks_coreGetElementById=document.getElementById;
document.getElementById=function(id) {
var e=document.coreTweaks_coreGetElementById(id);
if (!e || !e.parentNode || e.parentNode.id!='tiddlerDisplay') return e;
for (var i=0; i<e.parentNode.childNodes.length; i++)
if (id==e.parentNode.childNodes[i].id) return e.parentNode.childNodes[i];
return null;
};
}
//}}}
// // }}}}}}// // {{block{
/***
!!!471 'creator' field for new tiddlers
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/471 - OPEN
This tweak HIJACKS the core's saveTiddler() function to automatically add a 'creator' field to a tiddler when it is FIRST created. You can use """<<view creator>>""" (or """<<view creator wikified>>""" if you prefer) to show this value embedded directly within the tiddler content, or {{{<span macro="view creator"></span>}}} in the ViewTemplate and/or EditTemplate to display the creator value in each tiddler.
***/
//{{{
// hijack saveTiddler()
TiddlyWiki.prototype.CoreTweaks_creatorSaveTiddler=TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler=function(title,newTitle,newBody,modifier,modified,tags,fields)
{
var existing=store.tiddlerExists(title);
var tiddler=this.CoreTweaks_creatorSaveTiddler.apply(this,arguments);
if (!existing) store.setValue(title,'creator',config.options.txtUserName);
return tiddler;
}
//}}}
// // }}}}}}
// // closed: won't fix //(leave as core tweaks)//
// // {{block{
/***
!!!637 TiddlyLink tooltip - custom formatting
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/637 - CLOSED: WON'T FIX
This tweak modifies the tooltip format that appears when you mouseover a link to a tiddler. It adds an option to control the date format, as well as displaying the size of the tiddler (in bytes)
Tiddler link tooltip format:
{{stretch{<<option txtTiddlerLinkTootip>>}}}
^^where: %0=title, %1=username, %2=modification date, %3=size in bytes, %4=description slice^^
Tiddler link tooltip date format:
{{stretch{<<option txtTiddlerLinkTooltipDate>>}}}
***/
//{{{
config.messages.tiddlerLinkTooltip='%0 - %1, %2 (%3 bytes) - %4';
config.messages.tiddlerLinkTooltipDate='DDD, MMM DDth YYYY 0hh12:0mm AM';
config.options.txtTiddlerLinkTootip=
config.options.txtTiddlerLinkTootip||config.messages.tiddlerLinkTooltip;
config.options.txtTiddlerLinkTooltipDate=
config.options.txtTiddlerLinkTooltipDate||config.messages.tiddlerLinkTooltipDate;
Tiddler.prototype.getSubtitle = function() {
var modifier = this.modifier;
if(!modifier) modifier = config.messages.subtitleUnknown;
var modified = this.modified;
if(modified) modified = modified.formatString(config.options.txtTiddlerLinkTooltipDate);
else modified = config.messages.subtitleUnknown;
var descr=store.getTiddlerSlice(this.title,'Description')||'';
return config.options.txtTiddlerLinkTootip.format([this.title,modifier,modified,this.text.length,descr]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!607 add HREF link on permaview command
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/607 - CLOSED: WON'T FIX
This tweak automatically sets the HREF for the 'permaview' sidebar command link so you can use the 'right click' context menu for faster, easier bookmarking. Note that this does ''not'' automatically set the permaview in the browser's current location URL... it just sets the HREF on the command link. You still have to click the link to apply the permaview.
***/
//{{{
config.macros.permaview.handler = function(place)
{
var btn=createTiddlyButton(place,this.label,this.prompt,this.onClick);
addEvent(btn,'mouseover',this.setHREF);
addEvent(btn,'focus',this.setHREF);
};
config.macros.permaview.setHREF = function(event){
var links = [];
story.forEachTiddler(function(title,element) {
links.push(String.encodeTiddlyLink(title));
});
var newURL=document.location.href;
var hashPos=newURL.indexOf('#');
if (hashPos!=-1) newURL=newURL.substr(0,hashPos);
this.href=newURL+'#'+encodeURIComponent(links.join(' '));
}
//}}}
// // }}}}}}// // {{block{
/***
!!!458 add permalink-like HREFs on internal TiddlyLinks
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/458 - CLOSED: WON'T FIX
This tweak assigns a permalink-like HREF to internal Tiddler links (which normally do not have any HREF defined). This permits the link's context menu (right-click) to include 'open link in another window/tab' command. Based on a request from Dustin Spicuzza.
***/
//{{{
window.coreTweaks_createTiddlyLink=window.createTiddlyLink;
window.createTiddlyLink=function(place,title,includeText,theClass,isStatic,linkedFromTiddler,noToggle)
{
// create the core button, then add the HREF (to internal links only)
var link=window.coreTweaks_createTiddlyLink.apply(this,arguments);
if (!isStatic)
link.href=document.location.href.split('#')[0]+'#'+encodeURIComponent(String.encodeTiddlyLink(title));
return link;
}
//}}}
// // }}}}}}
// // <<foldHeadings>>
[[►|CreateNewBranches]]''Creating sub-topics or sub-folders under this top level folder.''
----
@@lingth-height:1.4em;
##To create sub-topics: Click on the top-level you just created.
##Then __in its toolbar__ click @@color:#008;'add:subtopic'@@. (Note: This simply makes a new tiddler tagged with title of the top level tiddler and it becomes a sub-topic of that tiddler)
##The new sub-topic will be automatically added to the menu under the top level tiddler.
##Once the above is done, then clicking on this sub-topic and adding to it as in (b: above) it will (automatically) become a __sub-folder__.
@@
[[►|CreateNewMenu]]''These instructions describe how to make a new top level Treeview menu folder for inserting into the MainMenu.''
''This is how you create'' your main Treeview menu. All subsequent sub-folders under it are created by adding a sub-topic under it. That sub-topic will automatically become a __sub-folder__ when you add a sub-topic under it.
#''Create'' top level tiddler first.
#''Change'' NEWTOPLEVELFOLDERNAME to your desired top level name.
#''Change'' UNIQUEID to associate it with your new top folder name.
#''Then copy'' and paste into MainMenu.
<<<
<html><textarea rows="3" cols="55" wrap="virtual"><<treeview2 "NEWTOPLEVELFOLDERNAME" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "UNIQUEID"'>></textarea></html>
<<<
@@color:#C06;''»''@@ The {{{(antisesame: "closed")}}} option means any folder branch tagged __ 'closed'__ will be __collapsed__ upon startup.
@@color:#C06;''»''@@ {{{(persist: "cookie")}}} means the state of the Treemenu __persists__ and will remain where you left it between sessions.
@@color:#C06;''»''@@ {{{(persist: true)}}} means the state will __only persist__ during a __single__ session.
@@color:#C06;''»''@@ ''For more options'' see the plugin at the author's site at http://treeview.tiddlyspot.com/
<<forEachTiddler
where
'tiddler.tags.containsAll(["NoteArkiv",context.inTiddler.title])'
sortBy
'tiddler.title.toUpperCase()'
write '"<<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"dagbog\" er lavet endnu//"'
>>
Anders Agerlund
Anders Rahbek Hansen
Anna Agger Rasmussen
Anne Bach Sørensen
Anne Sofie Palm Hansen
Boanna Stig Frølund
Camilla Graff
Christian Asp
Jeanette Bach Andreasen
Kasper Hasselkvist
Kathrine Østergaard Petersen
Line Domino
Mathias Bülow Kastbjerg
Mathias Damgaard-Iversen
Nicholaj Hejsel Vejlgaard
Patrick Rolff
Simon Staunsbæk
Simone Madsen
/***
|''Navn:''|DanishTranslationPlugin|
|''Beskrivelse:''|Translation of TiddlyWiki into Danish|
|''Forfatter:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''Kilde:''|www.example.com |
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/association/locales/core/en/locale.en.js |
|''Version:''|0.3.7|
|''Dato:''|Jul 6, 2007|
|''Kommentarer:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''Licens:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]] |
|''~CoreVersion:''|2.4|
***/
//{{{
//--
//-- Translateable strings
//--
// Strings in "double quotes" should be translated; strings in 'single quotes' should be left alone
config.locale = "da"; // W3C language tag
if (config.options.txtUserName == 'YourName') // do not translate this line, but do translate the next line
merge(config.options,{txtUserName: "DitNavn"});
merge(config.tasks,{
save: {text: "gem", tooltip: "Gem dine ændringer til denne TiddlyWiki", action: saveChanges},
sync: {text: "synk", tooltip: "Synkronisér ændringer med andre TiddlyWiki filer og servere", content: '<<sync>>'},
importTask: {text: "importér", tooltip: "Importér tiddlers og plugins fra andre TiddlyWiki filer og servere", content: '<<importTiddlers>>'},
tweak: {text: "Tilpas", tooltip: "Tilpas TiddlyWikis udseende og opførsel", content: '<<options>>'},
upgrade: {text: "upgradér", tooltip: "Upgrader TiddlyWikis kerne kode", content: '<<upgrade>>'},
plugins: {text: "udvidelser", tooltip: "Administrér installerede udvidelser", content: '<<plugins>>'}
});
// Options that can be set in the options panel and/or cookies
merge(config.optionsDesc,{
txtUserName: "Brugernavn til signering af dine ændringer",
chkRegExpSearch: "Avend almindelige udtryk til søgninger",
chkCaseSensitiveSearch: "Forskel på store og små bogstaver",
chkIncrementalSearch: "Bogstav for bogstav-søgning",
chkAnimate: "Anvend animationer",
chkSaveBackups: "Gem en backupfil når der gemmes ændringer",
chkAutoSave: "Gem automatisk ændringer",
chkGenerateAnRssFeed: "Lav et RSS feed når der gemmes ændringer",
chkSaveEmptyTemplate: "Lav en tom skabelon når der gemmes ændringer",
chkOpenInNewWindow: "Åben internet links i et nyt vindue",
chkToggleLinks: "Når man klikker på et link i åbne tiddlers lukkes de",
chkHttpReadOnly: "Skjul redigeringsværktøjer når den vises over HTTP",
chkForceMinorUpdate: "Opdatér ikke brugernavn og dato når tiddlers bliver ændrede",
chkConfirmDelete: "Bed om bekræftelse før tiddlers slettes",
chkInsertTabs: "Brug tab tasten til at indsætte tab tegn istedet for at hoppe imellem felter",
txtBackupFolder: "Navn på mappe til brug for backups",
txtMaxEditRows: "Maximum antal af rækker i edit bokse",
txtFileSystemCharSet: "Default tegnsæt til at gemme ændringer (Kun i Firefox/Mozilla)"});
merge(config.messages,{
customConfigError: "Der opstod problemer ved loading af udvidelser. Se PluginManager for detaljer",
pluginError: "Fejl: %0",
pluginDisabled: "Ikke udført fordi det er slået fra via 'systemConfigDisable' tag",
pluginForced: "Udført fordi det er tvunget via 'systemConfigForce' tag",
pluginVersionError: "Ikke udført fordi denne udvidelse kræver en nyere udgave af TiddlyWiki",
nothingSelected: "Intet er valgt. Du er nødt til at vælge en eller flere ting først",
savedSnapshotError: "Det ser ud som om denne TiddlyWiki er blevet gemt forkert. Se venligst http://www.tiddlywiki.com/#DownloadSoftware for details",
subtitleUnknown: "(ukendt)",
undefinedTiddlerToolTip: "Tiddleren '%0' findes ikke endnu",
shadowedTiddlerToolTip: "Tiddleren '%0' findes ikke endnu, men har en foruddefineret skygge værdi",
tiddlerLinkTooltip: "%0 - %1, %2",
externalLinkTooltip: "Internet link til %0",
noTags: "Der er ingen taggede tiddlere",
notFileUrlError: "Du er nødt til at gemme denne TiddlyWiki til en fil før du kan gemme ændringer",
cantSaveError: "Det er ikke muligt at gemme ændringer. Mulige grunde indbefatter:\n- din browser understøtter det ikke (Firefox, Internet Explorer, Safari og Opera virker alle fint hvis de er konfigurerede korrekt)\n- stien til din TiddlyWiki fil indeholder ulovlige tegn\n- TiddlyWiki HTML filen er blevet flyttet eller omdøbt",
invalidFileError: "Den originale fil '%0' lader ikke til at være en rigtig TiddlyWiki",
backupSaved: "Backup gemt",
backupFailed: "Det lykkedes IKKE at gemme en backup fil",
rssSaved: "RSS feed gemt",
rssFailed: "Det lykkedes IKKE at gemme et RSS feed",
emptySaved: "Tom skabelon gemt",
emptyFailed: "Det lykkedes IKKE at gemme en tom skabelon",
mainSaved: "Hoved TiddlyWiki fil gemt",
mainFailed: "Det lykkedes IKKE at gemme hoved TiddlyWiki filen. Dine ændringer er IKKE blevet gemt",
macroError: "Fejl i makro <<\%0>>",
macroErrorDetails: "Fejl ved udførsel af makro <<\%0>>:\n%1",
missingMacro: "Ingen sådan makro",
overwriteWarning: "En tiddler med navnet '%0' findes allerede. Vælg OK for at overskrive den",
unsavedChangesWarning: "ADVARSEL! Der er ugemte æmdringer i TiddlyWikien\n\nVælg OK for at gemme\nVælg FORTRYD for at afvise",
confirmExit: "--------------------------------\n\nDer er ugemte ændringer i TiddlyWikien. Hvis du fortsætter vil du miste disse ændringer\n\n--------------------------------",
saveInstructions: "GemÆndringer",
unsupportedTWFormat: "Ikke understøttet TiddlyWiki format '%0'",
tiddlerSaveError: "Fejl ved forsøg på at gemme tiddler '%0'",
tiddlerLoadError: "Fejl ved load af tiddler '%0'",
wrongSaveFormat: "Kan ikke gemme med formatet '%0'. Bruger standard format til at gemme.",
invalidFieldName: "Ikke tilladt feltnavn %0",
fieldCannotBeChanged: "Felt '%0' kan ikke ændres",
loadingMissingTiddler: "Forsøger at hente tiddleren '%0' fra '%1' serveren ved:\n\n'%2' i arbejdsområdet '%3'",
upgradeDone: "Opgradering til version %0 er nu fuldført\n\nKlik 'OK' for at genopfriske den nyligt opgraderede TiddlyWiki"});
merge(config.messages.messageClose,{
text: "luk",
tooltip: "luk dette meddelelsesområde"});
config.messages.backstage = {
open: {text: "bagscenen", tooltip: "Åben bagsceneområdet for at ændre på nogle grundlæggende indstillinger"},
close: {text: "luk", tooltip: "Luk bagsceneområdet"},
prompt: "bagscenen: ",
decal: {
edit: {text: "edit", tooltip: "Redigér tiddleren '%0'"}
}
};
config.messages.listView = {
tiddlerTooltip: "Klik for at se hele denne tiddlers tekst",
previewUnavailable: "(forhåndsvisning er ikke tilgængelig)"
};
config.messages.dates.months = ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November","December"];
config.messages.dates.days = ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"];
config.messages.dates.shortMonths = ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"];
config.messages.dates.shortDays = ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"];
// suffixes for dates, eg "1ste","2den","3die"..."30te","31te"
config.messages.dates.daySuffixes = ["ste","den","die","te","te","te","te","te","te","te",
"te","te","te","te","te","te","te","te","te","te",
"ste","den","die","te","te","te","te","te","te","te",
"te"];
config.messages.dates.am = "formiddag";
config.messages.dates.pm = "eftermiddag";
merge(config.messages.tiddlerPopup,{
});
merge(config.views.wikified.tag,{
labelNoTags: "ingen tags",
labelTags: "tags: ",
openTag: "Åben tag '%0'",
tooltip: "Vis tiddlere der er taggede med '%0'",
openAllText: "Åben alle",
openAllTooltip: "Åben alle disse tiddlere",
popupNone: "Ingen andre tiddlere er taggede med '%0'"});
merge(config.views.wikified,{
defaultText: "Tiddleren '%0' findes ikke endnu. Dobbelt-klik for at lave den",
defaultModifier: "(mangler)",
shadowModifier: "(indbygget skygge tiddler)",
dateFormat: "DD MMM YYYY", // use this to change the date format for your locale, eg "YYYY MMM DD", do not translate the Y, M or D
createdPrompt: "lavet"});
merge(config.views.editor,{
tagPrompt: "Skriv tags delt med mellemrum, [[brug 2 dobbelte firkantede klammer]] om nødvendigt, eller tilføj allerede eksisterende",
defaultText: "Skriv teksten til '%0'"});
merge(config.views.editor.tagChooser,{
text: "tags",
tooltip: "Vælg eksisterende tags som tilføjelse til denne tiddler",
popupNone: "Der er ikke defineret nogen tags",
tagTooltip: "Tilføj tagget '%0'"});
merge(config.messages,{
sizeTemplates:
[
{unit: 1024*1024*1024, template: "%0\u00a0GB"},
{unit: 1024*1024, template: "%0\u00a0MB"},
{unit: 1024, template: "%0\u00a0KB"},
{unit: 1, template: "%0\u00a0B"}
]});
merge(config.macros.search,{
label: "søg",
prompt: "Søg i denne TiddlyWiki",
accessKey: "F",
successMsg: "Der er fundet %0 tiddlere som matcher %1",
failureMsg: "Der er ikke fundet nogen tiddlere som matcher %0"});
merge(config.macros.tagging,{
label: "tagger: ",
labelNotTag: "tagger ikke",
tooltip: "Liste over tiddlere der er taggede med '%0'"});
merge(config.macros.timeline,{
dateFormat: "DD MMM YYYY"});// use this to change the date format for your locale, eg "YYYY MMM DD", do not translate the Y, M or D
merge(config.macros.allTags,{
tooltip: "Vis tiddlere der er taggede med '%0'",
noTags: "Der er ingen taggede tiddlere"});
config.macros.list.all.prompt = "Alle tiddlere i alfabetisk orden";
config.macros.list.missing.prompt = "Tiddlere der linkes til men som ikke er definerede";
config.macros.list.orphans.prompt = "Tiddlere som der ikke linkes til fra nogen andre tiddlere";
config.macros.list.shadowed.prompt = "Tiddlere som er skyggede med grundlæggende indhold";
config.macros.list.touched.prompt = "Tiddlere som er blevet ændret lokalt ";
merge(config.macros.closeAll,{
label: "luk alle",
prompt: "Luk alle viste tiddlere (untaget dem som er ved at blive redigerede)"});
merge(config.macros.permaview,{
label: "vis permalink",
prompt: "Lav et link til en URL som henter alle de netop nu synlige tiddlere"});
merge(config.macros.saveChanges,{
label: "gem ændringer",
prompt: "Gem alle tiddlere for at lave en ny TiddlyWiki",
accessKey: "S"});
merge(config.macros.newTiddler,{
label: "ny tiddler",
prompt: "Lav en ny tiddler",
title: "Ny Tiddler",
accessKey: "N"});
merge(config.macros.newJournal,{
label: "ny journal",
prompt: "Lav en ny tiddler ud fra nuværende dato og tid",
accessKey: "J"});
merge(config.macros.options,{
wizardTitle: "Tilpas avancerede muligheder",
step1Title: "Disse muligheder gemmes i cookies i din browser",
step1Html: "<input type='hidden' name='markList'></input><br><input type='checkbox' checked='false' name='chkUnknown'>Show unknown options</input>",
unknownDescription: "//(ukendt)//",
listViewTemplate: {
columns: [
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
});
merge(config.macros.plugins,{
wizardTitle: "Administrer udvidelser",
step1Title: "Aktive udvidelser",
step1Html: "<input type='hidden' name='markList'></input>", // DO NOT TRANSLATE
skippedText: "(Denne udvidelse er ikke blevet aktiveret fordi den først er blevet tilføjet efter start)",
noPluginText: "Der er ikke installeret nogen udvidelser",
confirmDeleteText: "Er du sikker på at du vil slette disse udvidelser:\n\n%0",
removeLabel: "Fjern systemConfig tag",
removePrompt: "Fjern systemConfig tag",
deleteLabel: "slet",
deletePrompt: "Slet disse tiddlere permanent",
listViewTemplate: {
columns: [
{name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
{name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'},
{name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'},
{name: 'Forced', field: 'forced', title: "Forced", tag: 'systemConfigForce', type: 'TagCheckbox'},
{name: 'Disabled', field: 'disabled', title: "Disabled", tag: 'systemConfigDisable', type: 'TagCheckbox'},
{name: 'Executed', field: 'executed', title: "Loaded", type: 'Boolean', trueText: "Yes", falseText: "No"},
{name: 'Startup Time', field: 'startupTime', title: "Startup Time", type: 'String'},
{name: 'Error', field: 'error', title: "Status", type: 'Boolean', trueText: "Error", falseText: "OK"},
{name: 'Log', field: 'log', title: "Log", type: 'StringList'}
],
rowClasses: [
{className: 'error', field: 'error'},
{className: 'warning', field: 'warning'}
]}
});
merge(config.macros.toolbar,{
moreLabel: "mere",
morePrompt: "Vis flere muligheder"
});
merge(config.macros.refreshDisplay,{
label: "genopfrisk",
prompt: "Genopfrisk hele TiddlyWikiens udseende"
});
merge(config.macros.importTiddlers,{
readOnlyWarning: "Du kan ikke importere til en låst TiddlyWiki fil. Prøv at åbne den fra en fil:// URL",
wizardTitle: "Importer tiddlere fra en anden fil eller server",
step1Title: "Trin 1: Find serveren eller TiddlyWiki filen",
step1Html: "Vælg servertypen: <select name='selTypes'><option value=''>Choose...</option></select><br>Enter the URL or pathname here: <input type='text' size=50 name='txtPath'><br>...or browse for a file: <input type='file' size=50 name='txtBrowse'><br><hr>...or select a pre-defined feed: <select name='selFeeds'><option value=''>Choose...</option></select>",
openLabel: "open",
openPrompt: "Åben forbindelsen til denne fil eller server",
openError: "Der var problemer med at hente tiddlywiki filen",
statusOpenHost: "Forbinder til hosten",
statusGetWorkspaceList: "Henter en liste over tilgængelige arbejdsområder",
step2Title: "Trin 2: Vælg arbejdsområde",
step2Html: "Indskriv et navn på arbejdsområdet: <input type='text' size=50 name='txtWorkspace'><br>...eller vælg et der allerede er der: <select name='selWorkspace'><option value=''>Choose...</option></select>",
cancelLabel: "fortryd",
cancelPrompt: "Fortryd denne import",
statusOpenWorkspace: "Åben arbejdsområdet",
statusGetTiddlerList: "Henter listen over tilgængelige tiddlere",
errorGettingTiddlerList: "Fejl ved hentning af liste over tiddlere, klik Fortryd for at prøve igen",
step3Title: "Trin 3: Vælg hvilke tiddlere der skal importeres",
step3Html: "<input type='hidden' name='markList'></input><br><input type='checkbox' checked='true' name='chkSync'>Keep these tiddlers linked to this server so that you can synchronise subsequent changes</input><br><input type='checkbox' name='chkSave'>Save the details of this server in a 'systemServer' tiddler called:</input> <input type='text' size=25 name='txtSaveTiddler'>",
importLabel: "importer",
importPrompt: "Importer disse tiddlere",
confirmOverwriteText: "Er du sikker på at du vil overskrive disse tiddlere:\n\n%0",
step4Title: "Trin 4: Importerer %0 tiddler(e)",
step4Html: "<input type='hidden' name='markReport'></input>", // DO NOT TRANSLATE
doneLabel: "udført",
donePrompt: "Luk denne wizard",
statusDoingImport: "Importerer tiddlere",
statusDoneImport: "Alle tiddlere er importede",
systemServerNamePattern: "%2 on %1",
systemServerNamePatternNoWorkspace: "%1",
confirmOverwriteSaveTiddler: "Tiddleren '%0' findes allerede. Klik 'OK' for at overskrive den med detaljerne fra denne server, eller 'Fortryd' for at efterlade uændret",
serverSaveTemplate: "|''Type:''|%0|\n|''URL:''|%1|\n|''Workspace:''|%2|\n\nDenne tiddler blev lavet automatisk for at skrive denne servers detaljer",
serverSaveModifier: "(System)",
listViewTemplate: {
columns: [
{name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
{name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'},
{name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'},
{name: 'Tags', field: 'tags', title: "Tags", type: 'Tags'}
],
rowClasses: [
]}
});
merge(config.macros.upgrade,{
wizardTitle: "Opgrader TiddlyWikis kerne kode",
step1Title: "Opdater eller reparer denne TiddlyWiki til sidste nye udgivelse",
step1Html: "Du er ved at opgradere til sidste nye udgave af TiddlyWikis kerne kode (from <a href='%0' class='externalLink' target='_blank'>%1</a>). Dit indhold vil blive bibeholdt under opgraderinen.<br><br>Bemærk at opgraderinger kan konfikte med gamle udvidelser. Hvis du får problemer med den opgraderede fil se her <a href='http://www.tiddlywiki.org/wiki/CoreUpgrades' class='externalLink' target='_blank'>http://www.tiddlywiki.org/wiki/CoreUpgrades</a>",
errorCantUpgrade: "Kan ikke opgradere denne TiddlyWiki. Du kan kun opgradere en TiddlyWiki fil som er gemt lokalt på en pc",
errorNotSaved: "Du skal gemme ændringer før du kan gennemføre en opgradering",
step2Title: "Bekræft opgraderingsdetaljer",
step2Html_downgrade: "Du er ved at nedgradere til TiddlyWiki version %0 fra %1.<br><br>Nedgradering til en ældre udgave af kerne koden er IKKE tilrådeligt",
step2Html_restore: "Denne tiddlyWike bruger allerede den sidste nye kerne kode (%0).<br><br>Du kan fortsætte med opgraderingen for at sikre dig at koden ikke er blevet ødelagt",
step2Html_upgrade: "Du er ved at opgradere til TiddlyWiki version %0 fra %1",
upgradeLabel: "opgrader",
upgradePrompt: "Forbered opgraderingsprocessen",
statusPreparingBackup: "Forbereder backup",
statusSavingBackup: "Gemmer backup fil",
errorSavingBackup: "Der var problemer med at gemme backup filen",
statusLoadingCore: "Loader kernekoden",
errorLoadingCore: "Fejl ved load af kernekoden",
errorCoreFormat: "Fejl ved den nye kernekode",
statusSavingCore: "Gemmer den nye kernekode",
statusReloadingCore: "Genloader den nye kernekode",
startLabel: "start",
startPrompt: "Start opgraderingsprocessen",
cancelLabel: "fortryd",
cancelPrompt: "Fortryd opgraderingsprocessen",
step3Title: "Opgradering afbrudt",
step3Html: "Du har afbrudt opgraderingsprocessen"
});
merge(config.macros.sync,{
listViewTemplate: {
columns: [
{name: 'Selected', field: 'selected', rowName: 'title', type: 'Selector'},
{name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'},
{name: 'Server Type', field: 'serverType', title: "Server type", type: 'String'},
{name: 'Server Host', field: 'serverHost', title: "Server host", type: 'String'},
{name: 'Server Workspace', field: 'serverWorkspace', title: "Server workspace", type: 'String'},
{name: 'Status', field: 'status', title: "Synchronisation status", type: 'String'},
{name: 'Server URL', field: 'serverUrl', title: "Server URL", text: "View", type: 'Link'}
],
rowClasses: [
],
buttons: [
{caption: "Synkronisér disse tiddlere", name: 'sync'}
]},
wizardTitle: "Synkroniser med internet servere og filer",
step1Title: "Vælg hvilke tiddlere du vil synkronisere",
step1Html: "<input type='hidden' name='markList'></input>", // DO NOT TRANSLATE
syncLabel: "synk",
syncPrompt: "Synkronisér disse tiddlere",
hasChanged: "Ændret imens den var koblet fra",
hasNotChanged: "Uændret imens den var koblet fra",
syncStatusList: {
none: {text: "...", color: "gennemsigtig", display:null},
changedServer: {text: "Ændret på serveren", color: '#8080ff', display:null},
changedLocally: {text: "Ændret imens den var koblet fra", color: '#80ff80', display:null},
changedBoth: {text: "ændret imens den var koblet fra også på serveren", color: '#ff8080', display:null},
notFound: {text: "Ikke fundet på serveren", color: '#ffff80', display:null},
putToServer: {text: "Gemt update på serveren", color: '#ff80ff', display:null},
gotFromServer: {text: "Hentet update fra serveren", color: '#80ffff', display:null}
}
});
merge(config.commands.closeTiddler,{
text: "luk",
tooltip: "Luk denne tiddler"});
merge(config.commands.closeOthers,{
text: "luk andre",
tooltip: "Luk alle andre tiddlere"});
merge(config.commands.editTiddler,{
text: "redigér",
tooltip: "Redigér denne tiddler",
readOnlyText: "se",
readOnlyTooltip: "Se denne tiddlers kilde"});
merge(config.commands.saveTiddler,{
text: "færdig",
tooltip: "Gem ændringer til denne tiddler"});
merge(config.commands.cancelTiddler,{
text: "fortryd",
tooltip: "Fortryd ændringer til denne tiddler",
warning: "Er du sikker på at du vil fortryde dine ændringer til '%0'?",
readOnlyText: "færdig",
readOnlyTooltip: "Se tiddlere normalt"});
merge(config.commands.deleteTiddler,{
text: "slet",
tooltip: "Slet denne tiddler",
warning: "Er du sikker på at du vil slette '%0'?"});
merge(config.commands.permalink,{
text: "permalink",
tooltip: "Permalink til denne tiddler"});
merge(config.commands.references,{
text: "referencer",
tooltip: "Vis tiddlere som linker til denne tiddler",
popupNone: "Ingen referencer"});
merge(config.commands.jump,{
text: "spring",
tooltip: "Spring til en anden tiddler"});
merge(config.commands.syncing,{
text: "synkroniserer",
tooltip: "Kontroller synkronisering af denne tiddler med en server eller en fil",
currentlySyncing: "<div>Currently syncing via <span class='popupHighlight'>'%0'</span> to:</"+"div><div>host: <span class='popupHighlight'>%1</span></"+"div><div>workspace: <span class='popupHighlight'>%2</span></"+"div>", // Note escaping of closing <div> tag
notCurrentlySyncing: "Sykroniserer ikke lige nu",
captionUnSync: "Stop synkronisering af denne tiddler",
chooseServer: "Synkronisér denne tiddler med en anden server:",
currServerMarker: "\u25cf ",
notCurrServerMarker: " "});
merge(config.commands.fields,{
text: "felter",
tooltip: "Vis denne tiddlers udvidede felter",
emptyText: "Der er ingen udvidede felter til rådighed for denne tiddler",
listViewTemplate: {
columns: [
{name: 'Field', field: 'field', title: "Field", type: 'String'},
{name: 'Value', field: 'value', title: "Value", type: 'String'}
],
rowClasses: [
],
buttons: [
]}});
merge(config.shadowTiddlers,{
DefaultTiddlers: "[[TranslatedGettingStarted]]",
MainMenu: "[[TranslatedGettingStarted]]\n\n\n^^~TiddlyWiki version <<version>>\n© 2007 [[UnaMesa|http://www.unamesa.org/]]^^",
TranslatedGettingStarted: "For at komme i gang med denne tomme tiddlywiki, skal du ændre på de følgende tiddlere:\n* SiteTitle & SiteSubtitle: Sidens titel og undertitel, som vist øverst (efter de er gemt, vil de også vise sig i browserens titelmenu)\n* MainMenu: er hovedmenuen (er oftest placeret til venstre)\n* DefaultTiddlers: Indeholder navnene på de tiddlere du vilhave skal starte op når du åbner TiddlyWiki\nDu skal også skrive dit brugernavn for at signere dine redigeringer: <<option txtUserName>>",
SiteTitle: "Min TiddlyWiki",
SiteSubtitle: "en genbrugelig ikke-liniær personlig web notesbog",
SiteUrl: "http://www.tiddlywiki.com/",
OptionsPanel: "Disse muligheder for at ændre på TiddlyWiki bliver gemt i din browser\n\nDit brugernavn til at signere dine ændringer. Skriv det som et WikiOrd (f.eks. PerPoulsen)\n<<option txtUserName>>\n\n<<option chkSaveBackups>> Save backups\n<<option chkAutoSave>> Auto save\n<<option chkRegExpSearch>> Regexp search\n<<option chkCaseSensitiveSearch>> Case sensitive search\n<<option chkAnimate>> Enable animations\n\n----\nAlso see [[TranslatedAdvancedOptions|AdvancedOptions]]",
SideBarOptions: '<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "muligheder \u00bb" "Ændre på TiddlyWikis avancerede muligheder">>',
SideBarTabs: '<<tabs txtMainTab "Tidslinie" "Tidslinie" TabTimeline "Alle" "Alle tiddlere" TabAll "Tags" "Alle tags" TabTags "Flere" "Flere lister" TabMore>>',
TabMore: '<<tabs txtMoreTab "Manglende" "Manglende tiddlere" TabMoreMissing "Uden tilknytning" "Tiddlere" TabMoreOrphans "Skyggede" "Skyggede tiddlere" TabMoreShadowed>>'
});
merge(config.annotations,{
AdvancedOptions: "Denne skygge tiddler giver adgang til flere avancerede muligheder",
ColorPalette: "Disse værdier i denne skyggetiddler bestemmer hvilket farveskema, der bliver brugt til ~TiddlyWikis brugerflade",
DefaultTiddlers: "Tiddlere som er listede i denne skyggetiddler vil automatisk blive vist når ~TiddlyWiki starter op",
EditTemplate: "HTML skabelonen i denne skyggetiddler bestemmer hvordan tiddlere ser ud når de bliver redigerede",
GettingStarted: "Denne skyggetiddler giver instruktioner om grundlæggende anvendelse",
ImportTiddlers: "Denne skyggetiddler giver mulighed for at importere tiddlere",
MainMenu: "Denne tiddler bliver brugt til at definere indholdet af hoved menuen i venstre side af skærmen",
MarkupPreHead: "Denne tiddler bliver indsat i toppen af <head> sektionen på TiddlyWiki HTML filen",
MarkupPostHead: "Denne tiddler bliver indsat i bunden af <head> sektionen på TiddlyWiki HTML filen",
MarkupPreBody: "Denne tiddler bliver indsat i toppen af<body> sektionen på TiddlyWiki HTML filen",
MarkupPostBody: "Denne tiddler bliver indsat i slutningen af <body> sektionen på TiddlyWiki HTML filen umiddelbart efter script blokken",
OptionsPanel: "Denne skyggetiddler bliver brugt til indholdet af muligheder skydepanelet i højre side",
PageTemplate: "HTML skabelonen i denne skyggetiddler bestemmer det overordnede ~TiddlyWiki layout",
PluginManager: "Denne skyggetiddler giver adgang til udvidelsesadministrationen",
SideBarOptions: "Denne skyggetiddler bruges til indholdet af muligheder panelet i højre sidemenu",
SideBarTabs: "Denne skyggetiddler bruges til indholdet af fanebladspanelet i højre sidemenu",
SiteSubtitle: "Denne skyggetiddler bruges som anden del af sidens titel",
SiteTitle: "Denne skyggetiddler bruges som første del af sidens titel",
SiteUrl: "Denne skyggetiddler bør sættes til den fulde mål-URL til publikation",
StyleSheetColors: "Denne skyggetiddler indeholder CSS definitionerne der bestemmer farverne på side elementerne. ''REDIGÉR IKKE DENNE TIDDLER'', lav i stedet dine ændringer i StyleSheet skyggetiddleren",
StyleSheet: "Denne tiddler kan indeholde specialle CSS definitioner",
StyleSheetLayout: "Denne skyggetiddler indeholder CSS definitioner der bestemmer layoutet på side elementer. ''REDIGÉR IKKE DENNE TIDDLER'', lav i stedet dine ændringer i StyleSheet skyggetiddleren",
StyleSheetLocale: "Denne skyggetiddler indeholder CSS definitioner relateret til lokale oversættelser",
StyleSheetPrint: "Denne skyggetiddler indeholder CSS definitioner til print",
TabAll: "Denne skyggetiddler indeholder hvad der er i 'Alle' fanen i højre sidemenu",
TabMore: "Denne skyggetiddler indeholder hvad der er i 'Flere' fanen i højre sidemenu",
TabMoreMissing: "Denne skyggetiddler indeholder hvad der er i 'Mangler' fanen i højre sidemenu",
TabMoreOrphans: "Denne skyggetiddler indeholder hvad der er i 'Mangler tilknytning' fanen i højre sidemenu",
TabMoreShadowed: "Denne skyggetiddler indeholder hvad der er i 'Skyggede' fanen i højre sidemenu",
TabTags: "Denne skyggetiddler indeholder hvad der er i 'Tags' fanen i højre sidemenu",
TabTimeline: "Denne skyggetiddler indeholder hvad der er i 'Tidslinie' fanen i højre sidemenu",
ToolbarCommands: "Denne skyggetiddler bestemmer hvilke værktøjer der vises i tiddleres værktøjslinier",
ViewTemplate: "HTML skabelonen i denne skyggetiddler bestemmer hvordan tiddlere ser ud"
});
//}}}
/***
|''Name:''|DataTiddlerPlugin|
|''Version:''|1.0.6 (2006-08-26)|
|''Source:''|http://tiddlywiki.abego-software.de/#DataTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Description
Enhance your tiddlers with structured data (such as strings, booleans, numbers, or even arrays and compound objects) that can be easily accessed and modified through named fields (in JavaScript code).
Such tiddler data can be used in various applications. E.g. you may create tables that collect data from various tiddlers.
''//Example: "Table with all December Expenses"//''
{{{
<<forEachTiddler
where
'tiddler.tags.contains("expense") && tiddler.data("month") == "Dec"'
write
'"|[["+tiddler.title+"]]|"+tiddler.data("descr")+"| "+tiddler.data("amount")+"|\n"'
>>
}}}
//(This assumes that expenses are stored in tiddlers tagged with "expense".)//
<<forEachTiddler
where
'tiddler.tags.contains("expense") && tiddler.data("month") == "Dec"'
write
'"|[["+tiddler.title+"]]|"+tiddler.data("descr")+"| "+tiddler.data("amount")+"|\n"'
>>
For other examples see DataTiddlerExamples.
''Access and Modify Tiddler Data''
You can "attach" data to every tiddler by assigning a JavaScript value (such as a string, boolean, number, or even arrays and compound objects) to named fields.
These values can be accessed and modified through the following Tiddler methods:
|!Method|!Example|!Description|
|{{{data(field)}}}|{{{t.data("age")}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined {{{undefined}}} is returned.|
|{{{data(field,defaultValue)}}}|{{{t.data("isVIP",false)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined the defaultValue is returned.|
|{{{data()}}}|{{{t.data()}}}|Returns the data object of the tiddler, with a property for every field. The properties of the returned data object may only be read and not be modified. To modify the data use DataTiddler.setData(...) or the corresponding Tiddler method.|
|{{{setData(field,value)}}}|{{{t.setData("age",42)}}}|Sets the value of the given data field of the tiddler to the value. When the value is {{{undefined}}} the field is removed.|
|{{{setData(field,value,defaultValue)}}}|{{{t.setData("isVIP",flag,false)}}}|Sets the value of the given data field of the tiddler to the value. When the value is equal to the defaultValue no value is set (and the field is removed).|
Alternatively you may use the following functions to access and modify the data. In this case the tiddler argument is either a tiddler or the name of a tiddler.
|!Method|!Description|
|{{{DataTiddler.getData(tiddler,field)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined {{{undefined}}} is returned.|
|{{{DataTiddler.getData(tiddler,field,defaultValue)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined the defaultValue is returned.|
|{{{DataTiddler.getDataObject(tiddler)}}}|Returns the data object of the tiddler, with a property for every field. The properties of the returned data object may only be read and not be modified. To modify the data use DataTiddler.setData(...) or the corresponding Tiddler method.|
|{{{DataTiddler.setData(tiddler,field,value)}}}|Sets the value of the given data field of the tiddler to the value. When the value is {{{undefined}}} the field is removed.|
|{{{DataTiddler.setData(tiddler,field,value,defaultValue)}}}|Sets the value of the given data field of the tiddler to the value. When the value is equal to the defaultValue no value is set (and the field is removed).|
//(For details on the various functions see the detailed comments in the source code.)//
''Data Representation in a Tiddler''
The data of a tiddler is stored as plain text in the tiddler's content/text, inside a "data" section that is framed by a {{{<data>...</data>}}} block. Inside the data section the information is stored in the [[JSON format|http://www.crockford.com/JSON/index.html]].
//''Data Section Example:''//
{{{
<data>{"isVIP":true,"user":"John Brown","age":34}</data>
}}}
The data section is not displayed when viewing the tiddler (see also "The showData Macro").
Beside the data section a tiddler may have all kind of other content.
Typically you will not access the data section text directly but use the methods given above. Nevertheless you may retrieve the text of the data section's content through the {{{DataTiddler.getDataText(tiddler)}}} function.
''Saving Changes''
The "setData" methods respect the "ForceMinorUpdate" and "AutoSave" configuration values. I.e. when "ForceMinorUpdate" is true changing a value using setData will not affect the "modifier" and "modified" attributes. With "AutoSave" set to true every setData will directly save the changes after a setData.
''Notifications''
No notifications are sent when a tiddler's data value is changed through the "setData" methods.
''Escape Data Section''
In case that you want to use the text {{{<data>}}} or {{{</data>}}} in a tiddler text you must prefix the text with a tilde ('~'). Otherwise it may be wrongly considered as the data section. The tiddler text {{{~<data>}}} is displayed as {{{<data>}}}.
''The showData Macro''
By default the data of a tiddler (that is stored in the {{{<data>...</data>}}} section of the tiddler) is not displayed. If you want to display this data you may used the {{{<<showData ...>>}}} macro:
''Syntax:''
|>|{{{<<}}}''showData '' [''JSON''] [//tiddlerName//] {{{>>}}}|
|''JSON''|By default the data is rendered as a table with a "Name" and "Value" column. When defining ''JSON'' the data is rendered in JSON format|
|//tiddlerName//|Defines the tiddler holding the data to be displayed. When no tiddler is given the tiddler containing the showData macro is used. When the tiddler name contains spaces you must quote the name (or use the {{{[[...]]}}} syntax.)|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
!Revision history
* v1.0.6 (2006-08-26)
** Removed misleading comment
* v1.0.5 (2006-02-27) (Internal Release Only)
** Internal
*** Make "JSLint" conform
* v1.0.4 (2006-02-05)
** Bugfix: showData fails in TiddlyWiki 2.0
* v1.0.3 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.2 (2005-12-22)
** Enhancements:
*** Handle texts "<data>" or "</data>" more robust when used in a tiddler text or as a field value.
*** Improved (JSON) error messages.
** Bugs fixed:
*** References are not updated when using the DataTiddler.
*** Changes to compound objects are not always saved.
*** "~</data>" is not rendered correctly (expected "</data>")
* v1.0.1 (2005-12-13)
** Features:
*** The showData macro supports an optional "tiddlername" argument to specify the tiddler containing the data to be displayed
** Bugs fixed:
*** A script immediately following a data section is deleted when the data is changed. (Thanks to GeoffS for reporting.)
* v1.0.0 (2005-12-12)
** initial version
!Code
***/
//{{{
//============================================================================
//============================================================================
// DataTiddlerPlugin
//============================================================================
//============================================================================
// Ensure that the DataTiddler Plugin is only installed once.
//
if (!version.extensions.DataTiddlerPlugin) {
version.extensions.DataTiddlerPlugin = {
major: 1, minor: 0, revision: 6,
date: new Date(2006, 7, 26),
type: 'plugin',
source: "http://tiddlywiki.abego-software.de/#DataTiddlerPlugin"
};
// For backward compatibility with v1.2.x
//
if (!window.story) window.story=window;
if (!TiddlyWiki.prototype.getTiddler) {
TiddlyWiki.prototype.getTiddler = function(title) {
var t = this.tiddlers[title];
return (t !== undefined && t instanceof Tiddler) ? t : null;
};
}
//============================================================================
// DataTiddler Class
//============================================================================
// ---------------------------------------------------------------------------
// Configurations and constants
// ---------------------------------------------------------------------------
function DataTiddler() {
}
DataTiddler = {
// Function to stringify a JavaScript value, producing the text for the data section content.
// (Must match the implementation of DataTiddler.parse.)
//
stringify : null,
// Function to parse the text for the data section content, producing a JavaScript value.
// (Must match the implementation of DataTiddler.stringify.)
//
parse : null
};
// Ensure access for IE
window.DataTiddler = DataTiddler;
// ---------------------------------------------------------------------------
// Data Accessor and Mutator
// ---------------------------------------------------------------------------
// Returns the value of the given data field of the tiddler.
// When no such field is defined or its value is undefined
// the defaultValue is returned.
//
// @param tiddler either a tiddler name or a tiddler
//
DataTiddler.getData = function(tiddler, field, defaultValue) {
var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
if (!(t instanceof Tiddler)) {
throw "Tiddler expected. Got "+tiddler;
}
return DataTiddler.getTiddlerDataValue(t, field, defaultValue);
};
// Sets the value of the given data field of the tiddler to
// the value. When the value is equal to the defaultValue
// no value is set (and the field is removed)
//
// Changing data of a tiddler will not trigger notifications.
//
// @param tiddler either a tiddler name or a tiddler
//
DataTiddler.setData = function(tiddler, field, value, defaultValue) {
var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
if (!(t instanceof Tiddler)) {
throw "Tiddler expected. Got "+tiddler+ "("+t+")";
}
DataTiddler.setTiddlerDataValue(t, field, value, defaultValue);
};
// Returns the data object of the tiddler, with a property for every field.
//
// The properties of the returned data object may only be read and
// not be modified. To modify the data use DataTiddler.setData(...)
// or the corresponding Tiddler method.
//
// If no data section is defined a new (empty) object is returned.
//
// @param tiddler either a tiddler name or a Tiddler
//
DataTiddler.getDataObject = function(tiddler) {
var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
if (!(t instanceof Tiddler)) {
throw "Tiddler expected. Got "+tiddler;
}
return DataTiddler.getTiddlerDataObject(t);
};
// Returns the text of the content of the data section of the tiddler.
//
// When no data section is defined for the tiddler null is returned
//
// @param tiddler either a tiddler name or a Tiddler
// @return [may be null]
//
DataTiddler.getDataText = function(tiddler) {
var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
if (!(t instanceof Tiddler)) {
throw "Tiddler expected. Got "+tiddler;
}
return DataTiddler.readDataSectionText(t);
};
// ---------------------------------------------------------------------------
// Internal helper methods (must not be used by code from outside this plugin)
// ---------------------------------------------------------------------------
// Internal.
//
// The original JSONError is not very user friendly,
// especially it does not define a toString() method
// Therefore we extend it here.
//
DataTiddler.extendJSONError = function(ex) {
if (ex.name == 'JSONError') {
ex.toString = function() {
return ex.name + ": "+ex.message+" ("+ex.text+")";
};
}
return ex;
};
// Internal.
//
// @param t a Tiddler
//
DataTiddler.getTiddlerDataObject = function(t) {
if (t.dataObject === undefined) {
var data = DataTiddler.readData(t);
t.dataObject = (data) ? data : {};
}
return t.dataObject;
};
// Internal.
//
// @param tiddler a Tiddler
//
DataTiddler.getTiddlerDataValue = function(tiddler, field, defaultValue) {
var value = DataTiddler.getTiddlerDataObject(tiddler)[field];
return (value === undefined) ? defaultValue : value;
};
// Internal.
//
// @param tiddler a Tiddler
//
DataTiddler.setTiddlerDataValue = function(tiddler, field, value, defaultValue) {
var data = DataTiddler.getTiddlerDataObject(tiddler);
var oldValue = data[field];
if (value == defaultValue) {
if (oldValue !== undefined) {
delete data[field];
DataTiddler.save(tiddler);
}
return;
}
data[field] = value;
DataTiddler.save(tiddler);
};
// Internal.
//
// Reads the data section from the tiddler's content and returns its text
// (as a String).
//
// Returns null when no data is defined.
//
// @param tiddler a Tiddler
// @return [may be null]
//
DataTiddler.readDataSectionText = function(tiddler) {
var matches = DataTiddler.getDataTiddlerMatches(tiddler);
if (matches === null || !matches[2]) {
return null;
}
return matches[2];
};
// Internal.
//
// Reads the data section from the tiddler's content and returns it
// (as an internalized object).
//
// Returns null when no data is defined.
//
// @param tiddler a Tiddler
// @return [may be null]
//
DataTiddler.readData = function(tiddler) {
var text = DataTiddler.readDataSectionText(tiddler);
try {
return text ? DataTiddler.parse(text) : null;
} catch(ex) {
throw DataTiddler.extendJSONError(ex);
}
};
// Internal.
//
// Returns the serialized text of the data of the given tiddler, as it
// should be stored in the data section.
//
// @param tiddler a Tiddler
//
DataTiddler.getDataTextOfTiddler = function(tiddler) {
var data = DataTiddler.getTiddlerDataObject(tiddler);
return DataTiddler.stringify(data);
};
// Internal.
//
DataTiddler.indexOfNonEscapedText = function(s, subString, startIndex) {
var index = s.indexOf(subString, startIndex);
while ((index > 0) && (s[index-1] == '~')) {
index = s.indexOf(subString, index+1);
}
return index;
};
// Internal.
//
DataTiddler.getDataSectionInfo = function(text) {
// Special care must be taken to handle "<data>" and "</data>" texts inside
// a data section.
// Also take care not to use an escaped <data> (i.e. "~<data>") as the start
// of a data section. (Same for </data>)
// NOTE: we are explicitly searching for a data section that contains a JSON
// string, i.e. framed with braces. This way we are little bit more robust in
// case the tiddler contains unescaped texts "<data>" or "</data>". This must
// be changed when using a different stringifier.
var startTagText = "<data>{";
var endTagText = "}</data>";
var startPos = 0;
// Find the first not escaped "<data>".
var startDataTagIndex = DataTiddler.indexOfNonEscapedText(text, startTagText, 0);
if (startDataTagIndex < 0) {
return null;
}
// Find the *last* not escaped "</data>".
var endDataTagIndex = text.indexOf(endTagText, startDataTagIndex);
if (endDataTagIndex < 0) {
return null;
}
var nextEndDataTagIndex;
while ((nextEndDataTagIndex = text.indexOf(endTagText, endDataTagIndex+1)) >= 0) {
endDataTagIndex = nextEndDataTagIndex;
}
return {
prefixEnd: startDataTagIndex,
dataStart: startDataTagIndex+(startTagText.length)-1,
dataEnd: endDataTagIndex,
suffixStart: endDataTagIndex+(endTagText.length)
};
};
// Internal.
//
// Returns the "matches" of a content of a DataTiddler on the
// "data" regular expression. Return null when no data is defined
// in the tiddler content.
//
// Group 1: text before data section (prefix)
// Group 2: content of data section
// Group 3: text behind data section (suffix)
//
// @param tiddler a Tiddler
// @return [may be null] null when the tiddler contains no data section, otherwise see above.
//
DataTiddler.getDataTiddlerMatches = function(tiddler) {
var text = tiddler.text;
var info = DataTiddler.getDataSectionInfo(text);
if (!info) {
return null;
}
var prefix = text.substr(0,info.prefixEnd);
var data = text.substr(info.dataStart, info.dataEnd-info.dataStart+1);
var suffix = text.substr(info.suffixStart);
return [text, prefix, data, suffix];
};
// Internal.
//
// Saves the data in a <data> block of the given tiddler (as a minor change).
//
// The "chkAutoSave" and "chkForceMinorUpdate" options are respected.
// I.e. the TiddlyWiki *file* is only saved when AutoSave is on.
//
// Notifications are not send.
//
// This method should only be called when the data really has changed.
//
// @param tiddler
// the tiddler to be saved.
//
DataTiddler.save = function(tiddler) {
var matches = DataTiddler.getDataTiddlerMatches(tiddler);
var prefix;
var suffix;
if (matches === null) {
prefix = tiddler.text;
suffix = "";
} else {
prefix = matches[1];
suffix = matches[3];
}
var dataText = DataTiddler.getDataTextOfTiddler(tiddler);
var newText =
(dataText !== null)
? prefix + "<data>" + dataText + "</data>" + suffix
: prefix + suffix;
if (newText != tiddler.text) {
// make the change in the tiddlers text
// ... see DataTiddler.MyTiddlerChangedFunction
tiddler.isDataTiddlerChange = true;
// ... do the action change
tiddler.set(
tiddler.title,
newText,
config.options.txtUserName,
config.options.chkForceMinorUpdate? undefined : new Date(),
tiddler.tags);
// ... see DataTiddler.MyTiddlerChangedFunction
delete tiddler.isDataTiddlerChange;
// Mark the store as dirty.
store.dirty = true;
// AutoSave if option is selected
if(config.options.chkAutoSave) {
saveChanges();
}
}
};
// Internal.
//
DataTiddler.MyTiddlerChangedFunction = function() {
// Remove the data object from the tiddler when the tiddler is changed
// by code other than DataTiddler code.
//
// This is necessary since the data object is just a "cached version"
// of the data defined in the data section of the tiddler and the
// "external" change may have changed the content of the data section.
// Thus we are not sure if the data object reflects the data section
// contents.
//
// By deleting the data object we ensure that the data object is
// reconstructed the next time it is needed, with the data defined by
// the data section in the tiddler's text.
// To indicate that a change is a "DataTiddler change" a temporary
// property "isDataTiddlerChange" is added to the tiddler.
if (this.dataObject && !this.isDataTiddlerChange) {
delete this.dataObject;
}
// call the original code.
DataTiddler.originalTiddlerChangedFunction.apply(this, arguments);
};
//============================================================================
// Formatters
//============================================================================
// This formatter ensures that "~<data>" is rendered as "<data>". This is used to
// escape the "<data>" of a data section, just in case someone really wants to use
// "<data>" as a text in a tiddler and not start a data section.
//
// Same for </data>.
//
config.formatters.push( {
name: "data-escape",
match: "~<\\/?data>",
handler: function(w) {
w.outputText(w.output,w.matchStart + 1,w.nextMatch);
}
} );
// This formatter ensures that <data>...</data> sections are not rendered.
//
config.formatters.push( {
name: "data",
match: "<data>",
handler: function(w) {
var info = DataTiddler.getDataSectionInfo(w.source);
if (info && info.prefixEnd == w.matchStart) {
w.nextMatch = info.suffixStart;
} else {
w.outputText(w.output,w.matchStart,w.nextMatch);
}
}
} );
//============================================================================
// Tiddler Class Extension
//============================================================================
// "Hijack" the changed method ---------------------------------------------------
DataTiddler.originalTiddlerChangedFunction = Tiddler.prototype.changed;
Tiddler.prototype.changed = DataTiddler.MyTiddlerChangedFunction;
// Define accessor methods -------------------------------------------------------
// Returns the value of the given data field of the tiddler. When no such field
// is defined or its value is undefined the defaultValue is returned.
//
// When field is undefined (or null) the data object is returned. (See
// DataTiddler.getDataObject.)
//
// @param field [may be null, undefined]
// @param defaultValue [may be null, undefined]
// @return [may be null, undefined]
//
Tiddler.prototype.data = function(field, defaultValue) {
return (field)
? DataTiddler.getTiddlerDataValue(this, field, defaultValue)
: DataTiddler.getTiddlerDataObject(this);
};
// Sets the value of the given data field of the tiddler to the value. When the
// value is equal to the defaultValue no value is set (and the field is removed).
//
// @param value [may be null, undefined]
// @param defaultValue [may be null, undefined]
//
Tiddler.prototype.setData = function(field, value, defaultValue) {
DataTiddler.setTiddlerDataValue(this, field, value, defaultValue);
};
//============================================================================
// showData Macro
//============================================================================
config.macros.showData = {
// Standard Properties
label: "showData",
prompt: "Display the values stored in the data section of the tiddler"
};
config.macros.showData.handler = function(place,macroName,params) {
// --- Parsing ------------------------------------------
var i = 0; // index running over the params
// Parse the optional "JSON"
var showInJSONFormat = false;
if ((i < params.length) && params[i] == "JSON") {
i++;
showInJSONFormat = true;
}
var tiddlerName = story.findContainingTiddler(place).id.substr(7);
if (i < params.length) {
tiddlerName = params[i];
i++;
}
// --- Processing ------------------------------------------
try {
if (showInJSONFormat) {
this.renderDataInJSONFormat(place, tiddlerName);
} else {
this.renderDataAsTable(place, tiddlerName);
}
} catch (e) {
this.createErrorElement(place, e);
}
};
config.macros.showData.renderDataInJSONFormat = function(place,tiddlerName) {
var text = DataTiddler.getDataText(tiddlerName);
if (text) {
createTiddlyElement(place,"pre",null,null,text);
}
};
config.macros.showData.renderDataAsTable = function(place,tiddlerName) {
var text = "|!Name|!Value|\n";
var data = DataTiddler.getDataObject(tiddlerName);
if (data) {
for (var i in data) {
var value = data[i];
text += "|"+i+"|"+DataTiddler.stringify(value)+"|\n";
}
}
wikify(text, place);
};
// Internal.
//
// Creates an element that holds an error message
//
config.macros.showData.createErrorElement = function(place, exception) {
var message = (exception.description) ? exception.description : exception.toString();
return createTiddlyElement(place,"span",null,"showDataError","<<showData ...>>: "+message);
};
// ---------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// ---------------------------------------------------------------------------
//
setStylesheet(
".showDataError{color: #ffffff;background-color: #880000;}",
"showData");
} // of "install only once"
// Used Globals (for JSLint) ==============
// ... TiddlyWiki Core
/*global createTiddlyElement, saveChanges, store, story, wikify */
// ... DataTiddler
/*global DataTiddler */
// ... JSON
/*global JSON */
/***
!JSON Code, used to serialize the data
***/
/*
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
The global object JSON contains two methods.
JSON.stringify(value) takes a JavaScript value and produces a JSON text.
The value must not be cyclical.
JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
throw a 'JSONError' exception if there is an error.
*/
var JSON = {
copyright: '(c)2005 JSON.org',
license: 'http://www.crockford.com/JSON/license.html',
/*
Stringify a JavaScript value, producing a JSON text.
*/
stringify: function (v) {
var a = [];
/*
Emit a string.
*/
function e(s) {
a[a.length] = s;
}
/*
Convert a value.
*/
function g(x) {
var c, i, l, v;
switch (typeof x) {
case 'object':
if (x) {
if (x instanceof Array) {
e('[');
l = a.length;
for (i = 0; i < x.length; i += 1) {
v = x[i];
if (typeof v != 'undefined' &&
typeof v != 'function') {
if (l < a.length) {
e(',');
}
g(v);
}
}
e(']');
return;
} else if (typeof x.toString != 'undefined') {
e('{');
l = a.length;
for (i in x) {
v = x[i];
if (x.hasOwnProperty(i) &&
typeof v != 'undefined' &&
typeof v != 'function') {
if (l < a.length) {
e(',');
}
g(i);
e(':');
g(v);
}
}
return e('}');
}
}
e('null');
return;
case 'number':
e(isFinite(x) ? +x : 'null');
return;
case 'string':
l = x.length;
e('"');
for (i = 0; i < l; i += 1) {
c = x.charAt(i);
if (c >= ' ') {
if (c == '\\' || c == '"') {
e('\\');
}
e(c);
} else {
switch (c) {
case '\b':
e('\\b');
break;
case '\f':
e('\\f');
break;
case '\n':
e('\\n');
break;
case '\r':
e('\\r');
break;
case '\t':
e('\\t');
break;
default:
c = c.charCodeAt();
e('\\u00' + Math.floor(c / 16).toString(16) +
(c % 16).toString(16));
}
}
}
e('"');
return;
case 'boolean':
e(String(x));
return;
default:
e('null');
return;
}
}
g(v);
return a.join('');
},
/*
Parse a JSON text, producing a JavaScript value.
*/
parse: function (text) {
var p = /^\s*(([,:{}\[\]])|"(\\.|[^\x00-\x1f"\\])*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)\s*/,
token,
operator;
function error(m, t) {
throw {
name: 'JSONError',
message: m,
text: t || operator || token
};
}
function next(b) {
if (b && b != operator) {
error("Expected '" + b + "'");
}
if (text) {
var t = p.exec(text);
if (t) {
if (t[2]) {
token = null;
operator = t[2];
} else {
operator = null;
try {
token = eval(t[1]);
} catch (e) {
error("Bad token", t[1]);
}
}
text = text.substring(t[0].length);
} else {
error("Unrecognized token", text);
}
} else {
token = operator = undefined;
}
}
function val() {
var k, o;
switch (operator) {
case '{':
next('{');
o = {};
if (operator != '}') {
for (;;) {
if (operator || typeof token != 'string') {
error("Missing key");
}
k = token;
next();
next(':');
o[k] = val();
if (operator != ',') {
break;
}
next(',');
}
}
next('}');
return o;
case '[':
next('[');
o = [];
if (operator != ']') {
for (;;) {
o.push(val());
if (operator != ',') {
break;
}
next(',');
}
}
next(']');
return o;
default:
if (operator !== null) {
error("Missing value");
}
k = token;
next();
return k;
}
}
next();
return val();
}
};
/***
!Setup the data serialization
***/
DataTiddler.format = "JSON";
DataTiddler.stringify = JSON.stringify;
DataTiddler.parse = JSON.parse;
//}}}
/***
|''Name:''|DatePickerLibrary|
|''Description:''|DatePicker library for use with macros|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Code Repository:''|http://svn.tiddlywiki.org/Trunk/contributors/SaqImtiaz/libraries/DatePicker.js|
|''Version:''|0.9|
|''Date:''|06/04/2007|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.3.0|
***/
// /%
//!BEGIN-PLUGIN-CODE
//{{{
function $id(n) {
return document.getElementById(n);
}
DatePicker = {
days : ['S','M','T','W','T','F','S'],
cells : new Array(42),
setup : function(){
var cte = createTiddlyElement;
var table = this.table = cte(null,"table","datePickerTable");
table.style.display = 'none';
document.body.appendChild(table);
var thead = cte(table,"thead");
var hRow = cte(thead,"tr");
hRow.onclick = stopEvent;
cte(hRow,"td",null,"datePickerNav","<<").onclick = DatePicker.prevm;
cte(hRow,"td","datePickerMNS",null,null,{colSpan:"5"});
cte(hRow,"td",null,"datePickerNav",">>",{align:"right"}).onclick=DatePicker.nextm;
var tbody = cte(table,"tbody","datePickerTableBody");
var dayRow = cte(tbody,"tr",null,"datePickerDaysHeader");
for (var i=0; i<this.days.length; i++){
cte(dayRow,"td",null,null,this.days[i]);
}
},
show : function(el,dateObj,cb) {
var me = DatePicker;
var now = me.now = new Date();
if (!dateObj)
dateObj = now;
me.root = el;
if (cb)
me.root.datePickerCallback = cb;
me.scc = { m : now.getMonth(), y : now.getFullYear(), d : now.getDate() };
Popup.place(el,me.table,{x:0,y:1});
var cur = [dateObj.getDate(),dateObj.getMonth()+1,dateObj.getFullYear()];
me.cc = { m : cur[1]-1, y : cur[2] };
me.sd = { m : cur[1]-1, y : cur[2], d : cur[0] };
me.fillCalendar(cur[0],me.scc.d,cur[1]-1,cur[2]);
},
fillCalendar : function(hd,today,cm,cy) {
var me = DatePicker;
var sd = me.now.getDate();
var td = new Date(cy,cm,1)
var cd = td.getDay();
$id('datePickerMNS').innerHTML = td.formatString('MMM YYYY')
var tbody = $id('datePickerTableBody');
removeChildren(tbody);
var dowRow = createTiddlyElement(tbody,"tr",null,"datePickerDowRow");
for (var d=0;d<=7;d++) {
// dow headings
createTiddlyElement(dowRow,"td",null,null,DatePicker.days[d]);
}
var days = (new Date(cy, cm+1, 0)).getDate();
var day = 1;
for (var j=1;j<=6;j++) { //rows
var row = createTiddlyElement(tbody,"tr",null,"datePickerDayRow");
for (var t=1; t<=7; t++) { //cells
var d = 7 * (j-1) - (-t); //id key
if ( (d >= (cd -(-1))) && (d<=cd-(-(days))) ) {
var dip = ( ((d-cd < sd) && (cm == me.scc.m) && (cy == me.scc.y)) || (cm < me.scc.m && cy == me.scc.y) || (cy < me.scc.y) );
var htd = ( (hd != '') && (d-cd == hd) );
var hToday = ( (today != '') && (d-cd == today) && cy == me.scc.y && cm == me.scc.m );
if (htd)
_class = 'highlightedDate';
else if (dip)
_class = 'oldDate';
else if (hToday && ! htd)
_class = 'todayDate';
else
_class = 'defaultDate';
if (t == 1 || t == 7) {
// weekend
_class += ' weekend';
}
var cell = createTiddlyElement(row,"td","datePickerDay"+d,_class,d-cd);
cell.onmouseover = function(e){addClass(this,'tdover');};
cell.onmouseout = function(e){removeClass(this,'tdover');};
cell.onclick = me.selectDate;
me.cells[d] = new Date(cy,cm,d-cd);
}
else {
var cell = createTiddlyElement(row,"td","datePickerDay"+d,"emptyDate");
}
day++;
}
if(day > days + cd)
break;
}
},
nextm : function() {
var me = DatePicker;
me.cc.m += 1;
if (me.cc.m >= 12) {
me.cc.m = 0;
me.cc.y++;
}
me.fillCalendar(me.getDayStatus(me.cc.m,me.cc.y),me.scc.d,me.cc.m,me.cc.y);
return false;
},
prevm : function() {
var me = DatePicker;
me.cc.m -= 1;
if (me.cc.m < 0) {
me.cc.m = 11;
me.cc.y--;
}
me.fillCalendar(me.getDayStatus(me.cc.m,me.cc.y),me.scc.d,me.cc.m,me.cc.y);
return false;
},
getDayStatus : function(ccm,ccy){
return (ccy == this.sd.y && ccm == this.sd.m)? this.sd.d : '';
},
selectDate : function(ev){
var e = ev ? ev : window.event;
var me = DatePicker;
var date = me.cells[resolveTarget(e).id.substring(13,resolveTarget(e).id.length)];
if (me.root.datePickerCallback && typeof me.root.datePickerCallback == 'function')
me.root.datePickerCallback(me.root,date);
$id('datePickerTable').style.display = 'none';
return false;
},
onclick : function(ev){
$id("datePickerTable").style.display = 'none';
return false;
},
create : function(el,dateObj,cb){
el.onclick = el.onfocus = function(e){DatePicker.show(el,dateObj,cb);stopEvent(e)};
},
css: "table#datePickerTable td.datePickerNav {\n"+
" cursor:pointer;\n"+
"}\n"+
"\n"+
".datePickerDaysHeader td {\n"+
" text-align:center;\n"+
" background:#ABABAB;\n"+
" font:12px Arial;\n"+
"}\n"+
"\n"+
".datePickerDayRow td {\n"+
" width:18px;\n"+
" height:18px;\n"+
"}\n"+
"\n"+
"td#datePickerMNS, td.datePickerNav {\n"+
" font:bold 13px Arial;\n"+
"}\n"+
"\n"+
"table#datePickerTable {\n"+
" position:absolute;\n"+
" border-collapse:collapse;\n"+
" background:#FFFFFF;\n"+
" border:1px solid #ABABAB;\n"+
" display:none; \n"+
"}\n"+
"\n"+
"table#datePickerTable td{\n"+
" padding: 3px;\n"+
"}\n"+
"\n"+
"td#datePickerMNS {\n"+
" text-align: center;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td {\n"+
" background-color : #C4D3EA;\n"+
" cursor : pointer;\n"+
" border : 1px solid #6487AE;\n"+
" text-align : center;\n"+
" font : 10px Arial;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.defaultDate {\n"+
" color : #333333; \n"+
" text-decoration : none; \n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.emptyDate {\n"+
" cursor:default; \n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.oldDate {\n"+
" color : #ABABAB;\n"+
" text-decoration : line-through;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.highlightedDate {\n"+
" background : #FFF799;\n"+
" font-weight : bold;\n"+
" color : #333333;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.todayDate {\n"+
" font-weight : bold;\n"+
" color : red;\n"+
"}\n"+
"\n"+
"table#datePickerTable tr.datePickerDayRow td.tdover {\n"+
" background:#fc6;\n"+
"}",
init : function(){
this.setup();
addEvent(document,'click',DatePicker.onclick);
config.shadowTiddlers['StyleSheetDatePicker'] = this.css;
if(store)
store.addNotification('StyleSheetDatePicker',refreshStyles);
}
};
DatePicker.init();
//}}}
//!END-PLUGIN-CODE
// %/
/***
|Name|DatePlugin|
|Source|http://www.TiddlyTools.com/#DatePlugin|
|Documentation|http://www.TiddlyTools.com/#DatePluginInfo|
|Version|2.7.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|formatted dates plus popup menu with 'journal' link, changes and (optional) reminders|
There are quite a few calendar generators, reminders, to-do lists, 'dated tiddlers' journals, blog-makers and GTD-like schedule managers that have been built around TW. While they all have different purposes, and vary in format, interaction, and style, in one way or another each of these plugins displays and/or uses date-based information to make finding, accessing and managing relevant tiddlers easier. This plugin provides a general approach to embedding dates and date-based links/menus within tiddler content.
!!!!!Documentation
>see [[DatePluginInfo]]
!!!!!Configuration
<<<
<<option chkDatePopupHideCreated>> omit 'created' section from date popups
<<option chkDatePopupHideChanged>> omit 'changed' section from date popups
<<option chkDatePopupHideTagged>> omit 'tagged' section from date popups
<<option chkDatePopupHideReminders>> omit 'reminders' section from date popups
<<option chkShowJulianDate>> display Julian day number (1-365) below current date
see [[DatePluginConfig]] for additional configuration settings, for use in calendar displays, including:
*date formats
*color-coded backgrounds
*annual fixed-date holidays
*weekends
<<<
!!!!!Revisions
<<<
2008.03.08 [2.7.0] in addModifiedsToPopup(), if a tiddler was created on the specified date, don't list it in the 'changed' section of the popup. Based on a request from Kashgarinn.
|please see [[DatePluginInfo]] for additional revision details|
2005.10.30 [0.9.0] pre-release
<<<
!!!!!Code
***/
//{{{
version.extensions.DatePlugin= {major: 2, minor: 7, revision: 0, date: new Date(2008,3,8)};
config.macros.date = {
format: "YYYY.0MM.0DD", // default date display format
linkformat: "YYYY.0MM.0DD", // 'dated tiddler' link format
linkedbg: "#babb1e", // "babble"
todaybg: "#ffab1e", // "fable"
weekendbg: "#c0c0c0", // "cocoa"
holidaybg: "#ffaace", // "face"
createdbg: "#bbeeff", // "beef"
modifiedsbg: "#bbeeff", // "beef"
remindersbg: "#c0ffee", // "coffee"
holidays: [ "01/01", "07/04", "07/24", "11/24" ], // NewYearsDay, IndependenceDay(US), Eric's Birthday (hooray!), Thanksgiving(US)
weekend: [ 1,0,0,0,0,0,1 ] // [ day index values: sun=0, mon=1, tue=2, wed=3, thu=4, fri=5, sat=6 ]
};
config.macros.date.handler = function(place,macroName,params)
{
// do we want to see a link, a popup, or just a formatted date?
var mode="display";
if (params[0]=="display") { mode=params[0]; params.shift(); }
if (params[0]=="popup") { mode=params[0]; params.shift(); }
if (params[0]=="link") { mode=params[0]; params.shift(); }
// get the date
var now = new Date();
var date = now;
if (!params[0] || params[0]=="today")
{ params.shift(); }
else if (params[0]=="filedate")
{ date=new Date(document.lastModified); params.shift(); }
else if (params[0]=="tiddler")
{ date=store.getTiddler(story.findContainingTiddler(place).id.substr(7)).modified; params.shift(); }
else if (params[0].substr(0,8)=="tiddler:")
{ var t; if ((t=store.getTiddler(params[0].substr(8)))) date=t.modified; params.shift(); }
else {
var y = eval(params.shift().replace(/Y/ig,(now.getYear()<1900)?now.getYear()+1900:now.getYear()));
var m = eval(params.shift().replace(/M/ig,now.getMonth()+1));
var d = eval(params.shift().replace(/D/ig,now.getDate()+0));
date = new Date(y,m-1,d);
}
// date format with optional custom override
var format=this.format; if (params[0]) format=params.shift();
var linkformat=this.linkformat; if (params[0]) linkformat=params.shift();
showDate(place,date,mode,format,linkformat);
}
window.showDate=showDate;
function showDate(place,date,mode,format,linkformat,autostyle,weekend)
{
if (!mode) mode="display";
if (!format) format=config.macros.date.format;
if (!linkformat) linkformat=config.macros.date.linkformat;
if (!autostyle) autostyle=false;
// format the date output
var title = date.formatString(format);
var linkto = date.formatString(linkformat);
// just show the formatted output
if (mode=="display") { place.appendChild(document.createTextNode(title)); return; }
// link to a 'dated tiddler'
var link = createTiddlyLink(place, linkto, false);
link.appendChild(document.createTextNode(title));
link.title = linkto;
link.date = date;
link.format = format;
link.linkformat = linkformat;
// if using a popup menu, replace click handler for dated tiddler link
// with handler for popup and make link text non-italic (i.e., an 'existing link' look)
if (mode=="popup") {
link.onclick = onClickDatePopup;
link.style.fontStyle="normal";
}
// format the popup link to show what kind of info it contains (for use with calendar generators)
if (autostyle) setDateStyle(place,link,weekend);
}
//}}}
//{{{
// NOTE: This function provides default logic for setting the date style when displayed in a calendar
// To customize the date style logic, please see[[DatePluginConfig]]
function setDateStyle(place,link,weekend) {
// alias variable names for code readability
var date=link.date;
var fmt=link.linkformat;
var linkto=date.formatString(fmt);
var cmd=config.macros.date;
if ((weekend!==undefined?weekend:isWeekend(date))&&(cmd.weekendbg!=""))
{ place.style.background = cmd.weekendbg; }
if (hasModifieds(date)||hasCreateds(date)||hasTagged(date,fmt))
{ link.style.fontStyle="normal"; link.style.fontWeight="bold"; }
if (hasReminders(date))
{ link.style.textDecoration="underline"; }
if (isToday(date))
{ link.style.border="1px solid black"; }
if (isHoliday(date)&&(cmd.holidaybg!=""))
{ place.style.background = cmd.holidaybg; }
if (hasCreateds(date)&&(cmd.createdbg!=""))
{ place.style.background = cmd.createdbg; }
if (hasModifieds(date)&&(cmd.modifiedsbg!=""))
{ place.style.background = cmd.modifiedsbg; }
if ((hasTagged(date,fmt)||store.tiddlerExists(linkto))&&(cmd.linkedbg!=""))
{ place.style.background = cmd.linkedbg; }
if (hasReminders(date)&&(cmd.remindersbg!=""))
{ place.style.background = cmd.remindersbg; }
if (isToday(date)&&(cmd.todaybg!=""))
{ place.style.background = cmd.todaybg; }
if (config.options.chkShowJulianDate) { // optional display of Julian date numbers
var m=[0,31,59,90,120,151,181,212,243,273,304,334];
var d=date.getDate()+m[date.getMonth()];
var y=date.getFullYear();
if (date.getMonth()>1 && (y%4==0 && y%100!=0) || y%400==0)
d++; // after February in a leap year
wikify("@@font-size:80%;<br>"+d+"@@",place);
}
}
//}}}
//{{{
function isToday(date) // returns true if date is today
{ var now=new Date(); return ((now-date>=0) && (now-date<86400000)); }
function isWeekend(date) // returns true if date is a weekend
{ return (config.macros.date.weekend[date.getDay()]); }
function isHoliday(date) // returns true if date is a holiday
{
var longHoliday = date.formatString("0MM/0DD/YYYY");
var shortHoliday = date.formatString("0MM/0DD");
for(var i = 0; i < config.macros.date.holidays.length; i++) {
var holiday=config.macros.date.holidays[i];
if (holiday==longHoliday||holiday==shortHoliday) return true;
}
return false;
}
//}}}
//{{{
// Event handler for clicking on a day popup
function onClickDatePopup(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var popup = Popup.create(this);
if(popup) {
// always show dated tiddler link (or just date, if readOnly) at the top...
if (!readOnly || store.tiddlerExists(this.date.formatString(this.linkformat)))
createTiddlyLink(popup,this.date.formatString(this.linkformat),true);
else
createTiddlyText(popup,this.date.formatString(this.linkformat));
if (!config.options.chkDatePopupHideCreated)
addCreatedsToPopup(popup,this.date,this.format);
if (!config.options.chkDatePopupHideChanged)
addModifiedsToPopup(popup,this.date,this.format);
if (!config.options.chkDatePopupHideTagged)
addTaggedToPopup(popup,this.date,this.linkformat);
if (!config.options.chkDatePopupHideReminders)
addRemindersToPopup(popup,this.date,this.linkformat);
}
Popup.show(popup,false);
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
}
//}}}
//{{{
function indexCreateds() // build list of tiddlers, hash indexed by creation date
{
var createds= { };
var tiddlers = store.getTiddlers("title","excludeLists");
for (var t = 0; t < tiddlers.length; t++) {
var date = tiddlers[t].created.formatString("YYYY0MM0DD")
if (!createds[date])
createds[date]=new Array();
createds[date].push(tiddlers[t].title);
}
return createds;
}
function hasCreateds(date) // returns true if date has created tiddlers
{
if (!config.macros.date.createds) config.macros.date.createds=indexCreateds();
return (config.macros.date.createds[date.formatString("YYYY0MM0DD")]!=undefined);
}
function addCreatedsToPopup(popup,when,format)
{
var force=(store.isDirty() && when.formatString("YYYY0MM0DD")==new Date().formatString("YYYY0MM0DD"));
if (force || !config.macros.date.createds) config.macros.date.createds=indexCreateds();
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var createds = config.macros.date.createds[when.formatString("YYYY0MM0DD")];
if (createds) {
createds.sort();
var e=createTiddlyElement(popup,"div",null,null,"created ("+createds.length+")");
for(var t=0; t<createds.length; t++) {
var link=createTiddlyLink(popup,createds[t],false);
link.appendChild(document.createTextNode(indent+createds[t]));
createTiddlyElement(popup,"br",null,null,null);
}
}
}
//}}}
//{{{
function indexModifieds() // build list of tiddlers, hash indexed by modification date
{
var modifieds= { };
var tiddlers = store.getTiddlers("title","excludeLists");
for (var t = 0; t < tiddlers.length; t++) {
var date = tiddlers[t].modified.formatString("YYYY0MM0DD")
if (!modifieds[date])
modifieds[date]=new Array();
modifieds[date].push(tiddlers[t].title);
}
return modifieds;
}
function hasModifieds(date) // returns true if date has modified tiddlers
{
if (!config.macros.date.modifieds) config.macros.date.modifieds = indexModifieds();
return (config.macros.date.modifieds[date.formatString("YYYY0MM0DD")]!=undefined);
}
function addModifiedsToPopup(popup,when,format)
{
var date=when.formatString("YYYY0MM0DD");
var force=(store.isDirty() && date==new Date().formatString("YYYY0MM0DD"));
if (force || !config.macros.date.modifieds) config.macros.date.modifieds=indexModifieds();
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var mods = config.macros.date.modifieds[date];
if (mods) {
// if a tiddler was created on this date, don't list it in the 'changed' section
if (config.macros.date.createds && config.macros.date.createds[date]) {
var temp=[];
for(var t=0; t<mods.length; t++)
if (!config.macros.date.createds[date].contains(mods[t]))
temp.push(mods[t]);
mods=temp;
}
mods.sort();
var e=createTiddlyElement(popup,"div",null,null,"changed ("+mods.length+")");
for(var t=0; t<mods.length; t++) {
var link=createTiddlyLink(popup,mods[t],false);
link.appendChild(document.createTextNode(indent+mods[t]));
createTiddlyElement(popup,"br",null,null,null);
}
}
}
//}}}
//{{{
function hasTagged(date,format) // returns true if date is tagging other tiddlers
{
return store.getTaggedTiddlers(date.formatString(format)).length>0;
}
function addTaggedToPopup(popup,when,format)
{
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var tagged=store.getTaggedTiddlers(when.formatString(format));
if (tagged.length) var e=createTiddlyElement(popup,"div",null,null,"tagged ("+tagged.length+")");
for(var t=0; t<tagged.length; t++) {
var link=createTiddlyLink(popup,tagged[t].title,false);
link.appendChild(document.createTextNode(indent+tagged[t].title));
createTiddlyElement(popup,"br",null,null,null);
}
}
//}}}
//{{{
function indexReminders(date,leadtime) // build list of tiddlers with reminders, hash indexed by reminder date
{
var reminders = { };
if(window.findTiddlersWithReminders!=undefined) { // reminder plugin is installed
// DEBUG var starttime=new Date();
var t = findTiddlersWithReminders(date, [0,leadtime], null, null, 1);
for(var i=0; i<t.length; i++) reminders[t[i].matchedDate]=true;
// DEBUG var out="Found "+t.length+" reminders in "+((new Date())-starttime+1)+"ms\n";
// DEBUG out+="startdate: "+date.toLocaleDateString()+"\n"+"leadtime: "+leadtime+" days\n\n";
// DEBUG for(var i=0; i<t.length; i++) { out+=t[i].matchedDate.toLocaleDateString()+" "+t[i].params.title+"\n"; }
// DEBUG alert(out);
}
return reminders;
}
function hasReminders(date) // returns true if date has reminders
{
if (window.reminderCacheForCalendar)
return window.reminderCacheForCalendar[date]; // use calendar cache
if (!config.macros.date.reminders)
config.macros.date.reminders = indexReminders(date,90); // create a 90-day leadtime reminder cache
return (config.macros.date.reminders[date]);
}
function addRemindersToPopup(popup,when,format)
{
if(window.findTiddlersWithReminders==undefined) return; // reminder plugin not installed
var indent = String.fromCharCode(160)+String.fromCharCode(160);
var reminders=findTiddlersWithReminders(when, [0,31],null,null,1);
createTiddlyElement(popup,"div",null,null,"reminders ("+(reminders.length||"none")+")");
for(var t=0; t<reminders.length; t++) {
link = createTiddlyLink(popup,reminders[t].tiddler,false);
var diff=reminders[t].diff;
diff=(diff<1)?"Today":((diff==1)?"Tomorrow":diff+" days");
var txt=(reminders[t].params["title"])?reminders[t].params["title"]:reminders[t].tiddler;
link.appendChild(document.createTextNode(indent+diff+" - "+txt));
createTiddlyElement(popup,"br",null,null,null);
}
if (readOnly) return; // omit "new reminder..." link
var link = createTiddlyLink(popup,indent+"new reminder...",true); createTiddlyElement(popup,"br");
var title = when.formatString(format);
link.title="add a reminder to '"+title+"'";
link.onclick = function() {
// show tiddler editor
story.displayTiddler(null, title, 2, null, null, false, false);
// find body 'textarea'
var c =document.getElementById("tiddler" + title).getElementsByTagName("*");
for (var i=0; i<c.length; i++) if ((c[i].tagName.toLowerCase()=="textarea") && (c[i].getAttribute("edit")=="text")) break;
// append reminder macro to tiddler content
if (i<c.length) {
if (store.tiddlerExists(title)) c[i].value+="\n"; else c[i].value="";
c[i].value += "<<reminder";
c[i].value += " day:"+when.getDate();
c[i].value += " month:"+(when.getMonth()+1);
c[i].value += " year:"+when.getFullYear();
c[i].value += ' title:"Enter a title" >>';
}
};
}
//}}}
/***
|Name|DatePluginConfig|
|Source|http://www.TiddlyTools.com/#DatePluginConfig|
|Documentation|http://www.TiddlyTools.com/#DatePluginInfo|
|Version|2.6.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|formats, background colors and other optional settings for DatePlugin|
***/
// // Default popup content display options (can be overridden by cookies)
//{{{
if (config.options.chkDatePopupHideCreated===undefined)
config.options.chkDatePopupHideCreated=false;
if (config.options.chkDatePopupHideChanged===undefined)
config.options.chkDatePopupHideChanged=false;
if (config.options.chkDatePopupHideTagged===undefined)
config.options.chkDatePopupHideTagged=false;
if (config.options.chkDatePopupHideReminders===undefined)
config.options.chkDatePopupHideReminders=false;
//}}}
// // show Julian date number below regular date
//{{{
if (config.options.chkShowJulianDate===undefined)
config.options.chkShowJulianDate=false;
//}}}
// // fixed-date annual holidays
//{{{
config.macros.date.holidays=[
"01/01", // NewYearsDay,
"07/04", // US Independence Day
"07/24" // Eric's Birthday (hooray!)
];
//}}}
// // weekend map (1=weekend, 0=weekday)
//{{{
config.macros.date.weekend=[ 1,0,0,0,0,0,1 ]; // day index values: sun=0, mon=1, tue=2, wed=3, thu=4, fri=5, sat=6
//}}}
// // date display/link formats
//{{{
config.macros.date.format="YYYY.0MM.0DD"; // default date display format
config.macros.date.linkformat="YYYY.0MM.0DD"; // 'dated tiddler' link format
//}}}
// // When displaying a calendar (see [[CalendarPlugin]]), you can customize the colors/styles that are applied to the calendar dates by modifying the values and/or functions below:
//{{{
// default calendar colors
config.macros.date.weekendbg="#c0c0c0";
config.macros.date.holidaybg="#ffaace";
config.macros.date.createdbg="#bbeeff";
config.macros.date.modifiedsbg="#bbeeff";
config.macros.date.linkedbg="#babb1e";
config.macros.date.remindersbg="#c0ffee";
// apply calendar styles
function setDateStyle(place,link,weekend) {
// alias variable names for code readability
var date=link.date;
var fmt=link.linkformat;
var linkto=date.formatString(fmt);
var cmd=config.macros.date;
if ((weekend!==undefined?weekend:isWeekend(date))&&(cmd.weekendbg!=""))
{ place.style.background = cmd.weekendbg; }
if (hasModifieds(date)||hasCreateds(date)||hasTagged(date,fmt))
{ link.style.fontStyle="normal"; link.style.fontWeight="bold"; }
if (hasReminders(date))
{ link.style.textDecoration="underline"; }
if (isToday(date))
{ link.style.border="1px solid black"; }
if (isHoliday(date)&&(cmd.holidaybg!=""))
{ place.style.background = cmd.holidaybg; }
if (hasCreateds(date)&&(cmd.createdbg!=""))
{ place.style.background = cmd.createdbg; }
if (hasModifieds(date)&&(cmd.modifiedsbg!=""))
{ place.style.background = cmd.modifiedsbg; }
if ((hasTagged(date,fmt)||store.tiddlerExists(linkto))&&(cmd.linkedbg!=""))
{ place.style.background = cmd.linkedbg; }
if (hasReminders(date)&&(cmd.remindersbg!=""))
{ place.style.background = cmd.remindersbg; }
if (isToday(date)&&(cmd.todaybg!=""))
{ place.style.background = cmd.todaybg; }
if (config.options.chkShowJulianDate) {
var m=[0,31,59,90,120,151,181,212,243,273,304,334];
var d=date.getDate()+m[date.getMonth()];
var y=date.getFullYear();
if (date.getMonth()>1 && (y%4==0 && y%100!=0) || y%400==0) d++; // after February in a leap year
wikify("@@font-size:80%;<br>"+d+"@@",place);
}
}
//}}}
[[Kom i gang]]
[tag[opstart]]
<<mURL "http://måns.dk/weekend" "http://måns.dk/0910" "http://gdsskole.tiddlyspot.com" "http://twspot.tiddlyspot.com">>
<<miniBrowser MyTiddlySites>>
/***
|''Name''|DeprecatedFunctionsPlugin|
|''Description''|Provides support for functions removed from the TiddlyWiki core|
|''Version''|1.0.0|
|''Status''|stable|
|''Source''|http://www.tiddlywiki.com/coreplugins.html#DeprecatedFunctionsPlugin|
|''~CodeRepository:''|http://svn.tiddlywiki.org/Trunk/association/plugins/DeprecatedFunctionsPlugin/DeprecatedFunctionsPlugin.js |
|''License''|[[BSD open source license]]|
|''~CoreVersion''|2.3.0|
|''Feedback''|[[TiddlyWiki community|http://groups.google.com/group/TiddlyWiki]] |
|''Keywords''|legacySupport|
!Code
***/
//{{{
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};
//--
//-- Deprecated code
//--
// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
};
// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = 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 text = lookaheadMatch[1];
if(config.browser.isIE)
text = text.replace(/\n/g,"\r");
createTiddlyElement(w.output,"pre",null,null,text);
w.nextMatch = lookaheadRegExp.lastIndex;
}
};
// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)
{
createTiddlyElement(place,"br");
};
// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
var i = this.indexOf(item);
return i == -1 ? null : i;
};
// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
return store.getLoader().internalizeTiddler(store,this,title,divRef);
};
// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
return store.getSaver().externalizeTiddler(store,this);
};
// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
return store.allTiddlersAsHtml();
}
// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
refreshPageTemplate(title);
}
// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)
{
story.displayTiddlers(srcElement,titles,template,animate);
}
// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)
{
story.displayTiddler(srcElement,title,template,animate);
}
// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;
// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");
}
//}}}
/%
|Name|DigitalClock|
|Source|http://www.TiddlyTools.com/#DigitalClock|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|display current time with automatic LIVE update|
Usage: <<tiddler DigitalClock with: format tick>>
where 'format' is any TiddlyWiki date/time formatting string
and 'tick' is the time in seconds between display updates (default=1sec)
For example, use:
<< ... "0hh:0mm" 60>>
to show hours and minutes only, updated once per minute
%/<script>
window.DigitalClock_tick=function(id){
var e=document.getElementById(id); if (!e) return;
e.title='click to '+(e.paused?'RESUME':'PAUSE')+' clock display';
if (e.paused) return;
e.innerHTML=new Date().formatString(e.fmt);
setTimeout('window.DigitalClock_tick('+id+')',e.tick*1000);
}
var e=createTiddlyElement(place,'a',new Date().getTime()+Math.random());
e.onclick=function(){this.paused=!this.paused;window.DigitalClock_tick(this.id);}
e.style.cursor='pointer';
e.fmt=('$1'=='$'+'1')?'hh12:0mm:0ss am':'$1';
e.tick=('$2'=='$'+'2')?'1':'$2';
window.DigitalClock_tick(e.id);
</script>
/***
|''Name:''|DoBackupMacro|
|''Version:''|2.0 (9-Apr-2006)|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
Creates a button which allows you to backup your TiddlyWiki on demand.
!Usage
Add the following command to your SideBarOptions tiddler:
{{{<<doBackup>>}}}
!Revision History
* Original by [[Jack]] 9-Apr-2006
!To Do
* List non-explicit links (e.g. from tagging macro)
!Code
***/
//{{{
version.extensions.doBackup= {major: 2, minor: 0, revision: 0, date: new Date("Apr 9, 2006")};
config.macros.doBackup={label: "backup", prompt: "Backup this TiddlyWiki"}
config.macros.doBackup.handler = function(place)
{
if(!readOnly)
createTiddlyButton(place,this.label,this.prompt,function ()
{doBackup(); return false;},null,null,this.accessKey);
}
doBackup = function() {
var optSaveBackups = config.options.chkSaveBackups
config.options.chkSaveBackups = true
saveChanges()
config.options.chkSaveBackups = optSaveBackups
}
//}}}
<<forEachTiddler where 'tiddler.tags.contains("E-mails")' sortBy 'tiddler.title'>>
<script label="edit a tiddler">
var title=prompt("Enter the title of a tiddler to edit (case sensitive)");
while (title && title.length && !store.tiddlerExists(title)) {
displayMessage("The tiddler '%0' doesn't exist".format([title]));
var title=prompt("Please enter a tiddler title",title);
}
if (!title||!title.length) return; /* cancelled by user */
story.displayTiddler(null,title,2);
</script>
/***
|Name|EditFieldPlugin|
|Source|http://www.TiddlyTools.com/#EditFieldPlugin|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|extend core edit macro for use in ViewTemplates or direct embedding in tiddler content|
This plugin extends the core {{{<<edit fieldname #OfLines>>}}} macro for use in a ViewTemplate or directly embedded in tiddler content.
!!!!!Usage
<<<
Normally, when you edit a tiddler, any changes you make are saved (or discarded) when you press the "done" (or "cancel") command in the tiddler editor's toolbar. However, when in a 'view mode' context, these command items are not available, and so the TiddlyWiki core commands cannot be used to trigger the 'save/discard' handling once you have decided that your input activities are complete.
This plugin extends the core's input field handling, so that when:
{{{
<<edit fieldname numberOfLines>>
}}}
is used in tiddler content, or:
{{{
<span macro='edit fieldname numberOfLines'></span>
}}}
is used in a ViewTemplate definition, you will be automatically prompted to save/discard your changes (if any) as soon as you press ENTER or move away ('onBlur' handling) from that input field (if the content has been changed). You can also abandon your changes to input field content by pressing ESCAPE (you will be asked to confirm before discarding changes).
You can change the browser-defined default width of an input field by surrounding the edit field by using custom CSS class wrappers, defined in the StyleSheet tiddler. For example:
{{{
.stretch input { width:99%; }
.stretch textarea { width:99%; }
.onechar input { width:1em; }
.twochar input { width:2em; }
.threechar input { width:3em; }
.fourchar input { width:4em; }
.fivechar input { width:5em; }
}}}
>Note: the 'fixed' width values in the above example are only approximate. The actual width rendered by your browser will vary based on the current font-family and font-size that is applied to the field.
<<<
!!!!!Examples
<<<
*"""<<edit foobar>>"""<br> <<edit foobar>>
*"""{{threechar{<<edit foobar>>}}}"""<br> {{threechar{<<edit foobar>>}}}
*"""<<edit tags>>"""<br> <<edit tags>>
*"""{{stretch{<<edit text 10>>}}}"""<br> {{stretch{<<edit text 10>>}}}
<<<
!!!!!Revisions
<<<
2007.08.22 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.EditFieldPlugin= {major: 1, minor: 0, revision: 0, date: new Date(2007,8,22)};
config.macros.edit.editFieldPlugin_savedHandler=config.macros.edit.handler;
config.macros.edit.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
// let core create edit field
config.macros.edit.editFieldPlugin_savedHandler.apply(this,arguments);
// get edit field or textarea
var fieldType=params[0]=="text"||params[1]?'textarea':'input';
var ins=place.getElementsByTagName(fieldType);
var e=ins[ins.length-1];
if (fieldType=="textarea" && params[1]) e.style.height=params[1]+"em"; // force height for textarea field
// if viewing tiddler, add autosave handlers
var here=story.findContainingTiddler(place);
if (here && here.getAttribute("template").indexOf("ViewTemplate")!=-1) {
story.setDirty(tiddler.title,false); // clear tiddler ("dirty") flag set by core when field was created
var field=e.getAttribute("edit");
var val=store.getValue(tiddler.title,field); if (!val) val="";
e.setAttribute("currval",val); // remember starting value
e.setAttribute("tiddler",tiddler.title); // remember target tiddler
e.onkeydown=function(ev) { // ENTER key=save (for single-line edit fields only)
var event=ev?ev:window.event;
this.setAttribute("keyCode",event.keyCode); // save last keyCode for blur() handler
if (event.keyCode==13 && this.nodeName.toUpperCase()!="TEXTAREA")
this.saveField(); // save input to tiddler field
}
e.onblur=function(ev) { // accept or reject input when focus moves away from field
var event=ev?ev:window.event;
var tid=this.getAttribute("tiddler"); if (!tid || !tid.length) return;
var field=this.getAttribute("edit");
if (this.value!=this.getAttribute("currval")) { // if value has changed
if (this.getAttribute("keyCode")=="27") { // if user pressed ESC
var msg="Abandon changes to %0@%1?".format([field,tid]);
if (confirm(msg)) this.value=this.getAttribute("currval"); // reset to starting value
this.id=new Date().getTime(); // set unique ID
setTimeout("document.getElementById('"+this.id+"').focus()",1); // restore focus (after blur completes)
} else { // other focus change events
var msg="Save changes to %0@%1?".format([field,tid]);
if (confirm(msg)) this.saveField(); // save input to tiddler field, then continue blur
else this.value=this.getAttribute("currval"); // reset to starting value, then continue blur
}
}
};
e.saveField=function() { // save input value to tiddler field (create, touch or rename tiddler as needed)
var tid=this.getAttribute("tiddler"); if (!tid || !tid.length) return;
var field=this.getAttribute("edit");
var title=(field=="title")?this.value:tid;
if (!title.length) { // prevent blank tiddler title from being used
this.value=this.getAttribute("currval"); // reset to starting value
this.id=new Date().getTime(); // set unique ID
setTimeout("displayMessage('Please enter a non-blank value')",1); // notify user
setTimeout("document.getElementById('"+this.id+"').focus()",2); // set focus to continue editing
return;
}
var t=store.getTiddler(tid);
store.suspendNotifications();
var anim=config.options.chkAnimate; config.options.chkAnimate=false; // suspend animation
var who=t&&config.options.chkForceMinorUpdate?t.modifier:config.options.txtUserName;
var when=t&&config.options.chkForceMinorUpdate?t.modified:new Date();
store.saveTiddler(t?tid:title,title,t?t.text:"",who,when,t?t.tags:[],t?t.fields:null);
store.setValue(title,field,this.value); // save value in tiddler field
this.setAttribute("currval",this.value); // remember new starting value
if (tid!=title) // if title changed, display renamed tiddler in place of current one
{ story.displayTiddler(story.findContainingTiddler(this),title); story.closeTiddler(tid); }
if (field=="text") // if tiddler content changed, refresh tiddler display
{ story.refreshTiddler(title,null,true); }
config.options.chkAnimate=anim; // resume animation
store.resumeNotifications();
store.notify(title,true);
};
}
}
//}}}
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]] wikibar'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='tiddler QuickEditToolbar'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div>
<div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
/***
|Name|EditTiddlerPlugin|
|Source|http://www.TiddlyTools.com/#EditTiddlerPlugin|
|Version|1.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|embed an 'edit' link in tiddler content to invoke edit on any specified tiddler title|
!!!!!Usage:
<<<
{{{<<editTiddler TiddlerName linktext>>}}}
If no tiddler title is specified (or the special keyword "here" is used), the tiddler containing the rendered macro is assumed. You can also specify optional alternative "link text" to be displayed. The default link text is "edit".
<<<
!!!!!Revisions:
<<<
2007.03.22 1.2.0 added support for 'here' keyword and optional 2nd param to specify label text
2007.03.15 1.1.1 fixed 'get tiddler ID' logic so it actually works! D'oh!
2007.03.11 1.1.0 changed 'get tiddler ID' logic so that macro can be used outside a tiddler (i.e., in mainMenu) by specifying the ID
2006.10.04 1.0.1 invoke findContainingTiddler() as fallback when 'tiddler' param is null
2006.04.28 1.0.0 Initial release
<<<
!!!Code:
***/
//{{{
config.macros.editTiddler={
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var tid=params.shift(); // use specified tiddler ID (or "here")
if (!tid || tid=="here") {
if (tiddler)
tid=tiddler.title; // use current tiddler, fallback to find tiddler if none provided
else {
var here=story.findContainingTiddler(place);
if (!here) return; // not in a tiddler, do nothing
tid=here.getAttribute('tiddler'); // get ID from tiddler element
}
}
var label="edit"; if (params[0]) label=params.shift();
createTiddlyButton(place,label,'edit tiddler: '+tid,this.onclick).setAttribute('which',tid);
},
onclick: function(e) {
story.displayTiddler(null,this.getAttribute('which'),DEFAULT_EDIT_TEMPLATE);
}
}
//}}}
<<snapshot print label:Udskrift prompt:Udskriv id:viewer>><<fontSize>>
<<tiddler SygeUpdate>>
<<forEachTiddler
where
'tiddler.tags.contains("Syg") && tiddler.fields["k-gruppe"]'
sortBy 'tiddler.fields["title"]'
write
'(index < 200) ? "|"+(index+1)+"| [["+tiddler.title+"]] | [["+tiddler.fields["k-gruppe"]+"]] | [["+tiddler.fields["kl"]+"]] | [["+tiddler.fields["gang"]+"]] | [["+tiddler.fields["værelse"]+"]] | [img(55%,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>|>| !Syge elever på¨HU |h\n"
+"|!#|Navn| <<tag Lærere K-gruppe \>\>|Kl| <<tag GangOversigt Gang \>\>|Værelse||h\n"'
end 'count+" syge elever i k-grupper på HU\n"'
none '"Ingen syge elever på HU\n"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Bøger")'
sortBy 'tiddler.data("author")'
write
'"#{{indent{[["+tiddler.data("author")+"]].}}} {{indent{//[["+tiddler.title+"]]//}}} {{indent{[img(1em+,)["+store.getValue(tiddler,"title")+" |"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]]}}}<br>\n"'
>>
<<forEachTiddler
where 'tiddler.tags.contains("Bøger")'
sortBy 'GroupTitle = tiddler.data("primtopic")+"###"+tiddler.title'
script 'function getGroupTitle(tiddler, context) {
if (!context.lastGroup || context.lastGroup != tiddler.data("primtopic"))
{
context.lastGroup = tiddler.data("primtopic");
return "!! {{{"+(context.lastGroup?context.lastGroup:"ikke kategoriseret endnu")+"}}}\n";
} else return "";}'
write
'getGroupTitle(tiddler, context)+"** [["+tiddler.title+"]]\n"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Bøger")'
sortBy 'tiddler.title.toUpperCase()'
write
'"#{{indent{//[["+tiddler.title+"]]//}}} {{indent{[["+tiddler.data("author")+"]].}}} {{indent{[img(1em+,)["+store.getValue(tiddler,"title")+" |"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]]}}}<br>\n"'
>>
Denne tiddler har jeg blot tagget med "slide"
Koden til "slide show-knappen" i [[Hovedmenuen|MainMenu]]
ser således ud:
Koden til "slide show-knappen" i [[Hovedmenuen|MainMenu]]
ser således ud:
{{{<<slideShow tag:slide auto:6 toc:titles header:" Præsentation " footer:"Stop: Escape - eller X her »" cycle clock:'+' >>}}}
Læs om hvordan du bruger slide show funktionerne her: SlideShowPluginDoc
Elever
<<snapshot print label:Udskrift prompt:Udskriv id:viewer>>
<<forEachTiddler
where
'tiddler.tags.contains("Elev")'
sortBy 'tiddler.title'
write
'(index < 200) ? "|!"+(index+1)+"|[["+tiddler.title+"]]|\n" : ""'
begin '"|sortable|k\n|!#| Navn |h\n"'
end 'count+" elever\n"'
none '"Ingen elever\n"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Elev")'
sortBy 'tiddler.title.toUpperCase()'
script
'
function getFirstLine(s) {
var m = s.match(/\s*(.*)/);
return m != null && m.length >= 1 ? m[1] : "";
}
'
write
'(index < 200) ? "|!"+(index+1)+"|[["+tiddler.title+"]]|@@color(#cc0000):→~~//"+getFirstLine(tiddler.text)+"//~~@@|"+tiddler.tags+"|[["+tiddler.fields["k-gruppe"]+"]]|[["+tiddler.fields["gang"]+"]]|[["+tiddler.fields["kl"]+"]]|[["+tiddler.fields["vaerelse"]+"]]|[img(2em+,)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] [[Link|"+tiddler.fields["billede"] +"]]|\n" : ""'
begin '"|sortable|k\n|!#|Navn|trækning|tags|k-gruppe|gang|kl|værelse|billede|h\n"'
end 'count+" elever\n"'
none '"Ingen elever\n"'
>>
{{tuduSlider{<<slider chkFelter Felter 'Alle felter »'>>}}}
<!--{{{-->
<div class='title' macro='view title'></div>
<div class='toolbar' macro='toolbar +saveTiddler closeOthers -cancelTiddler deleteTiddler wikibar'></div>
<div style='clear:both'></div>
<div class='viewer'>
<table class='borderless' style='width:100%'><tr>
<td style='width:10%'>
<div class='small'>Gang:</div>
<div class='editor' macro='select gang rows:1 width:75% allowBlank allowOther +GangListe allowEdit'></div>
<div class='small'>K-gruppe:</div>
<div class='editor' macro='select k-gruppe rows:1 width:75% allowBlank allowOther +LærerListe allowEdit'></div>
<div class='small'>Klasse:</div>
<div class='editor' macro='select kl rows:1 width:75% allowBlank allowOther 9 10 '></div>
<div class='small'>Værelse:</div>
<div class='editor' macro='select vaerelse rows:1 width:75% allowBlank allowOther +Værelser allowEdit'></div>
</td><td style='width:20%'>
<div class='small'>ElevNavn (tiddler navn):</div>
<div class='editor' macro='edit title'></div>
<div class='small'>Email:</div>
<div class='editor' macro='select email rows:1 width:100% allowBlank allowOther +EmailListe allowEdit'></div>
<div class='small'>billede URL (jpg/gif):</div>
<div class='editor' macro='edit billede'></div>
</td></table>
<div class='small borderless'><span class='small'>Note (Besked:):</span></div>
<div class='editor' macro='edit text 10'></div>
<div class='editor' macro='edit tags'></div>
<div class='toolbar editorFooter' style='text-align:left !important;float:left !important'>
<span macro='message views.editor.tagPrompt'></span><span class macro='newHere label: sAdressebog title:{{tiddler.title+"-"}} tag: {{tiddler.title}} Adressebog text: "" ' </span>
<span macro='tagChooser'></span>
</div>
<div style='clear:both'></div>
</div><!-- viewer -->
<!--}}}-->
<<forEachTiddler where 'tiddler.tags.containsAll(["Fag",context.inTiddler.title])'
sortBy
'tiddler.title.toUpperCase()'
write '" <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"faghold\" er oprettede endnu//"'
>>
<script>
var out=[]; var fmt='[[%0]]: %1|'; var fmt2='\n|[[%0]]|';
var tids=store.sortTiddlers(store.filterTiddlers("[tag[(Elev)]]"), "modified");
for (var i=0; i<tids.length; i++) {
out.push(fmt2.format([tids[i].title]));
for (var f in tids[i].fields) out.push(fmt.format
([f,tids[i].fields [f]]));
}
return out.join('|');
</script>
<html><span class='tagged' macro='tags'></div></span>
<div <span class='menubox' style='float:center;margin:0em'<span class macro='newJournalHere label:SygDD tag:"NoteArkiv" text:"Skriv sygenotater her"' ></span><span macro="tag Syg "</span><span macro="toggleTag Syg . -"></span><span macro="tag HU"</span><span macro="toggleTag HU . -"></span>[[Hjem|Hjemme]]<span macro="checkbox hjem@""></span> </div></html>
<<slider chkElevListeKnap ElevListeKnap 'Meldinger »'>>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='viewer' style='font-style:normal'>
<div class='groupbox italic bold'>
Besvar venligst de følgende spørgsmål så godt du kan. Du skal skrive dine initialer og e-mail. Alle andre svar er valgfri, og vil hjælpe til at lave en ensartet udtalelse til alle elever.
</div>
<div class='small'>Udtalelsesnavn (tiddler navn):</div>
<div class='editor' macro='edit title'></div>
<br>
<table class='borderless' style='width:100%'><tr>
<td style='width:30%'>
<span class='editor' macro='edit navn'> Lærernavn:
<span style='color:red' title='skal udfyldes'>*</span><br>
</span>
</td><td style='width:30%'>
<span class='editor' macro='edit email'>Email:
<span style='color:red' title='skal udfyldes'>*</span><br>
</span>
</td></tr></table>
<table class='borderless' style='width:100%'><tr>
<td style='width:50%'>
<div class='editor' macro='edit indledning 6'>Indledning</div>
<span class='editor' macro='edit signalement'>Giv et signalement:<br></span>
</td></tr></table>
<br><hr><br>
<table class='borderless'><tr style='vertical-align:bottom'>
<td>Hvor mange års efaring har du med disse arbejdsområder? </td>
<td style='width:8em'><span class='editor' macro='select years_field rows:1 width:100% [[1-5]] [[6-10]] [[11 eller mere]]'></span></td>
</tr><tr style='vertical-align:bottom'>
<td>Hvor mange år har du brugt en pc til dit arbejde? </td>
<td><span class='editor' macro='select years_org rows:1 width:100% [[1-5]] [[6-10]] [[11 eller mere]]'></span></td>
</tr><tr style='vertical-align:bottom'>
<td><br></td>
</tr><tr style='vertical-align:bottom'>
<td>IT-certifikat/kursus? </td>
<td><span class='editor' macro='edit num_clients'></span></td>
</tr><tr style='vertical-align:bottom'>
<td>Hvor stor en procentdel af din tid bruges ved en pc? </td>
<td><span class='editor' macro='select time_clients rows:1 width:100% [[0%]] [[Mindre end 50%]] [[50% - 90%]] [[100%]]'></span></td>
</tr><tr style='vertical-align:bottom'>
<td><br></td>
</tr><tr style='vertical-align:bottom'>
<td>Hvor stor en procentdel af din tid er du villig til at afsætte til at dig ind i ny IT? </td>
<td><span class='editor' macro='select time_staff rows:1 width:100% [[0%]] [[Mindre end 50%]] [[50% - 90%]] [[100%]]'></span></td>
</tr></table>
<br><hr><br>
Hvordan vil du selv beskrive dit IT-niveau?
<span class='editor' macro='select tech_level rows:1 [[nybegynder]] [[midt-i-mellem]] [[meget god]] [[Jeg opfandt internettet!]]'></span>
<br>
Skriv navnene på tre af de IT-programmer/tjenester du bruger oftest:
<table class='borderless' style='width:100%'><tr>
<td style='width:33%'>
<span class='editor' macro='edit fav1'></span>
</td><td style='width:33%'>
<span class='editor' macro='edit fav2'></span>
</td><td style='width:33%'>
<span class='editor' macro='edit fav3'></span>
</td></tr></table>
<br><hr><br>
<div class='editor' macro='edit essay1 5'>Hvad ønsker du at din arbejdsplads har af værktøj til elever - til dig selv (antal pc'er - kommunikationsmuligheder mmm)? <i>(150 ord max)</i><br></div>
<div class='editor' macro='edit essay2 5'>Beskriv hvordan du gemmer og henter data på arbejdet (netværk/pc/usb/vpn mm) og noget om hvordan du oftest kommunikerer med andre kolleger - mail - telefon - møder etc. <i>(150 ord max)</i><br></div>
<span class='selected'><div class='toolbar big'>
<table class='borderless'><tr style='vertical-align:bottom'>
<td><span class='normal'>For at gemme/videresende dine svar, klik </td>
<td align='center'><span macro='toolbar saveTiddler'><span macro='email to:"@himmerlands-ungdomsskole.dk" permalink:"true"'></span></span></td>
</tr><tr style='vertical-align:bottom'>
<td><span class='normal'>For at fortryde dine svar, klik </span></td>
<td align='center'><span macro='toolbar cancelTiddler'></span></td>
</tr><tr style='vertical-align:bottom'>
<td><span class='normal'>Slet dette skema fuldstændig, klik </span></td>
<td align='center'><span macro='toolbar deleteTiddler'></span></td>
</tr></table>
</div></span>
<div style='display:block;clear:both'></div>
<div style="display:none">
<div class='editor' macro='edit signature'></div> <!-- ensures that field is created -->
<div class='editor' macro='edit tags'></div> <!-- used to set needed 'UMAForm' tag -->
</div>
</div>
<!--}}}-->
<!--{{{-->
<span macro="tiddler MoveTiddlerToTop"></span>
<span macro="tiddler ScrollToTop"></span>
<div class='toolbar' class='border' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' class='border' macro='view title'></div>
<div class='viewer' style='font-style:normal'>
<div class='groupbox'>
<b><i>læs venligst udtalelsen igennem. For at lave ændringer, klik på redigér</i></b>
<b><i>Når du er tilfreds, skriver du blot dine initialer igen nederst på skemaet.
For at maile et link til denne udtalelse til dig selv, eller andre »</i></b>
<span macro='email to:{{tiddler.fields.email}} permalink:"true"'></span>..
</div><td<span class macro='snapshot print label:print prompt:Udskriv id:story'></span></td></span>
<br>
<td style='width:30%'>
Skolens hjemmeside:<div class='border' macro='wikify [img(5%,auto)[Himmerlands Ungdomsskole på nettet|http://xn--mns-ula.dk/Billeder/images/HULOGOLILLE.png][http://h-u.dk]]'></div>
</td>
<table class='borderless' style='width:100%'><tr style='vertical-align:top'>
<td style='width:30%'>
Lærernavn:<br>
<div class='border' macro='view navn'></div>
</td><td style='width:30%'>
Email:<br>
<div class='border' macro='view email'></div>
</td></tr></table>
<table class='borderless' style='width:100%'><tr style='vertical-align:top'>
<td style='width:50%'>
Indledning:<br>
<div class='border' <span style='font-size:14pt;color:blue;font-family: Comic Sans MS;' macro='view indledning wikified'></div>
Giv et signalement:<br>
<div class='border' macro='view signalement'></div>
</td></tr></table>
<br><hr><br>
<table class='borderless'><tr style='vertical-align:bottom'>
<td>Hvor mange års efaring har du med disse arbejdsområder? </td>
<td style='width:8em'><span class='border' macro='view years_field'></span></td>
</tr><tr style='vertical-align:bottom'>
<td>Hvor mange år har du brugt en pc til dit arbejde? </td>
<td><span class='border' macro='view years_org'></span></td>
</tr><tr style='vertical-align:bottom'>
<td><br></td>
</tr><tr style='vertical-align:bottom'>
<td>IT-certifikat/kursus? </td>
<td><span class='border' macro='view num_clients'></span></td>
</tr><tr style='vertical-align:bottom'>
<td>Hvor stor en procentdel af din tid bruges ved en pc? </td>
<td><span class='border' macro='view time_clients'></span></td>
</tr><tr style='vertical-align:bottom'>
<td><br></td>
</tr><tr style='vertical-align:bottom'>
<td>Hvor stor en procentdel af din tid er du villig til at afsætte til at dig ind i ny IT? </td>
<td><span class='border' macro='view time_staff'></span></td>
</tr></table>
<br><hr><br>
Hvordan vil du selv beskrive dit IT-niveau? <span class='border' macro='view tech_level'></span>
<br>
Skriv navnene på tre af de IT-programmer/tjenester du bruger oftest:
<table class='borderless' style='width:100%'><tr style='vertical-align:top'>
<td style='width:33%'>
<div class='border' macro='view fav1'></div>
</td><td style='width:33%'>
<div class='border' macro='view fav2'></div>
</td><td style='width:33%'>
<div class='border' macro='view fav3'></div>
</td></tr></table>
<br><hr><br>
Hvad ønsker du at din arbejdsplads har af værktøj til elever - til dig selv (antal pc'er - kommunikationsmuligheder mmm)? <i>(150 ord max)</i><br>
<div class='border' macro='view essay1'></div>
Beskriv hvordan du gemmer og henter data på arbejdet (netværk/pc/usb/vpn mm) og noget om hvordan du oftest kommunikerer med andre kolleger - mail - telefon - møder etc. <i>(150 ord max)</i><br>
<div class='border' macro='view essay2'></div>
<br><hr><br>
<div class='groupbox'>
Når jeg afleverer skemaet er jeg indforstået med at:
<b><ol>
<li>informationerne bliver behandlet fortroligt og at intet bliver brugt til andet end denne behovsundersøgelse</li>
<li>Der er intet i vejen med at tilføje andre meddelelser end dem der bliver spurgt om i skemaet - Tværtimod - er der helt sikkert nogle vigtige ting, som angår netop dig og dine forventninger til et IT-mijø - som IKKE er på skemaet.</li>
<li>Skriv endelig noget mere</li>
</ol></b>
<div style='font-size:90%'>
For at godkende indholdet af dette skema skal du,
<b><u>skrive dine initialer eller navn</u></b> <i>(example: "MM")</i>
</div>
<b>Initialer/navn:</b>
<span style='color:red;' title='a response is required'>*</span>
<span class='formSignature' macro='edit signature'></span>
<input type='button' value='ok'>
</div>
<div class='selected' style='overflow:auto;padding:.5em 0;'><div class='toolbar big'>
<table class='borderless'><tr style='vertical-align:bottom'>
<td><span class='normal'>For at ændre udtalelsen, klik </td>
<td align='center'><span macro='toolbar editTiddler'></span></td>
</tr><tr style='vertical-align:bottom'>
<td><span class='normal'>For at sende et link til denne udtalelse, klik </span></td>
<td align='center'><span macro='email to:{{tiddler.fields.email}} permalink:"true"'></span>..</td>
</tr></table>
</div></div>
</div> <!-- end viewer -->
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'> </span></span><span macro='email to:"@himmerlands-ungdomsskole.dk" permalink:"true"'></span></div><div <span class='title'><span macro='view title'></span></div>
</span><span class='subtitle'><span style='white-space:nowrap' macro='view modified date [[DDD, DDe MMM YYYY]]'></span><td<span class macro='snapshot print label:print prompt:Udskriv id:story'></span></td></span> <span macro='tiddler ElevListeKnapSlider'></span>
<div class='tagClear'></div>
<div <span class='menubox' style='float:center;margin:0em'
<div class macro='wikify [img(13em+,)[%1|%0][%1-Note]] billede@here title@here'>
</span></span></span></div>
<table<span macro='tag Lærere K-gruppe:'></span><span macro='wikify "[[%0]]" k-gruppe'</span>
<span macro='tag Kl Klasse:'></span><span macro='wikify "[[%0]]" kl'></span></div>
<div <span macro='tag GangOversigt Gang:'></span><span macro='wikify "[[%0]]" gang'></span>
<span macro='tag Værelser Vær.:'></span><span macro='wikify "%0" værelse'></span></div></div>
<div <span macro='wikify "//@@bgcolor(#99ff33):Meddelelse til k-lærer:@@//"'</span><span class macro='editTiddler'></span><span macro='wikify "@@color(#cc0000): %0@@" text'</span></span></div>
<div class macro='newJournalHere label:"Fælles journal" tag:"NoteArkiv" text:{{"Tekst, der skrives her, slettes ved oprettelse af ny fællesjournal på samme dato - så skriv her til allersidst"}}' ></div>
<div <span class='menubox' style='float:center;margin:0em' macro='notes heading:"NoteArkiv" tag:"NoteArkiv" suffix:"Note"'> </span></div>
<span class <i>Fag :<i> </span>
<div class macro='formTiddler ElevFag'</div>
<span class <i>Bog :<i> </span>
<div class macro='tiddler BogElev'</div></td></tr>
<span class <i>Fælles JournalNotater :<i> </span>
<div class macro='formTiddler DagNotatElev'</div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span style='padding-right: 2em;' macro='newHere label:"*lav et underemne til dette emne*"'></span></div>
<span class='title' macro='view title'></span>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<!--}}}-->
<script>
var out=[];
var exclude=['Fag','fag','closed','opgave','projekt','mål','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Dansk','Engelsk','Tysk','Matematik','FysikKemi','ValgFag','AndreFag'];
var fmt='|[[%0]]|';
var here=story.findContainingTiddler(place); if (!here) return;
var tid=store.getTiddler(here.getAttribute('tiddler'));
if (tid.tags.length) out.push('|Elever på holdet|h\n|sortable|k');
for (var t=0; t<tid.tags.length; t++)
if (!exclude.contains(tid.tags[t]))
out.push(fmt.format([tid.tags[t]]));
return out.join('\n');
</script>
{{invisibletable{
<<tiddler [[Alle e-mails]]>>
[[BI]] [[Brynjólfur Þorvarðarson]]
brpo@himmerlands-ungdomsskole.dk
[[BK]] [[Betina Skovbo Korsbæk]]
besk@himmerlands-ungdomsskole.dk
[[DK]] [[Dorthe Kjærgaard]]
haubro@himmerlands-ungdomsskole.dk
[[DO]] [[Dan Bojer Olesen]]
dabo@himmerlands-ungdomsskole.dk
[[ET]] [[Else Thorsen Jensen]]
elth@himmerlands-ungdomsskole.dk
[[HC]] [[Henning Christensen]]
hech@himmerlands-ungdomsskole.dk
[[HM]] [[Henrik Meldgaard]]
heme@himmerlands-ungdomsskole.dk
[[JA]] [[Jacob Krüger Andersen]]
jakr@himmerlands-ungdomsskole.dk
[[JD]] [[Jesper Dalhoff]]
jeda@himmerlands-ungdomsskole.dk
[[JG]] [[Jakob Mols Græsborg]]
jape@himmerlands-ungdomsskole.dk
[[JK]] [[Jørn Knudsen]]
jokn@himmerlands-ungdomsskole.dk
[[LM]] [[Lis Madsen]]
lima@himmerlands-ungdomsskole.dk
[[LS]] [[Line Hargreaves]]
list@himmerlands-ungdomsskole.dk
[[MM]] [[Måns Mårtensson]]
mama@himmerlands-ungdomsskole.dk
[[PA]] [[Peter Andersen]]
pean@himmerlands-ungdomsskole.dk
[[PS]] [[Petra Shulz]]
pesh@himmerlands-ungdomsskole.dk
[[SB]] [[Svend Brøndum]]
svbr@himmerlands-ungdomsskole.dk
[[SM]] [[Sara Mols Græsborg]]
saje@himmerlands-ungdomsskole.dk
[[TN]] [[Thomas Nederby]]
thne@himmerlands-ungdomsskole.dk
@@color:#800;Tiddlers tagged with EmbeddedImages@@
----
{{twocolumns{
<script>
// get all tiddlers tagged with "EmbeddedImages"
var tids=store.getTaggedTiddlers("EmbeddedImages");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("EmbeddedImages")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
}}}
Skriv teksten til 'Ny Tiddler'
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span style="padding-right:0em;" macro='tagger'></span><span macro='newThere label:"lav underemne" Emne'></span></div>
<span class='title' macro='view title'></span>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<!--}}}-->
<<siteMap {{tiddler.title}} . sliders>>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span style='padding-right: 2em;' macro='newHere label:"*lav et underemne til dette emne*"'></span></div>
<span class='title' macro='tiddler EmnerSliderFrame'></span>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<!--}}}-->
/***
|''Name:''|FCKeditorPlugin|
|''Description:''|Wysiwyg editor for TiddlyWiki using FCKeditor.|
|''Version:''|1.1.1|
|''Date:''|Dec 21,2007|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.2.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demo:
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see and edit [[WysiwygDemo]].
!Installation:
#download and unzip [[FCKeditor|http://www.fckeditor.net/download]] (by default, in a wiki subfolder, such that the relative path "fckeditor/fckeditor.js" is right).
#import [[FCKeditorPlugin]] (systemConfig tagged)
#add the following text to MarkupPreHead : {{{<script type="text/javascript" src="fckeditor/fckeditor.js"></script>}}}
#customize FCKeditorPath if needed (in MarkupPreHead and in options below)
#save and reload
#use the <<toolbar editHtml>> button in the tiddler's toolbar (in default ViewTemplate) or add {{{editHtml}}} command in your own toolbar.
! Useful Addons
*[[HTMLFormattingPlugin|http://www.tiddlytools.com/#HTMLFormattingPlugin]] to embed wiki syntax in html tiddlers.<<br>>//__Tips__ : When this plugin is installed, you can use anchor syntax to link tiddlers in wysiwyg mode (example : #example). Anchors are converted back and from wiki syntax when editing.//
*[[TaggedTemplateTweak|http://www.TiddlyTools.com/#TaggedTemplateTweak]] to use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values.
!Configuration options :
|FCKeditor folder (absolute or relative)|<<option txtFCKeditorPath>> |
|FCKeditor custom configuration script path (relative or absolute)<<br>>[[Example|fckeditor/editor/custom_config.js]] : {{{ fckeditor/editor/custom_config.js}}}|<<option txtFCKCustomConfigScript>>|
|Toolbar name ("Default", "Basic" or custom)<<br>>See [[FCKeditor documentation|http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Toolbar]] for more information on custom toolbars|<<option txtFCKToolbar>>|
|FCKeditor default height (if blank = 500px)|<<option txtFCKheight>>|
|Template called by the {{{wysiwyg}}} button|EditHtmlTemplate|
!Code
***/
//{{{
config.options.txtFCKeditorPath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "fckeditor/";
config.options.txtFCKCustomConfigScript = config.options.txtFCKCustomConfigScript ? config.options.txtFCKCustomConfigScript : "";
config.options.txtFCKToolbar = config.options.txtFCKToolbar ? config.options.txtFCKToolbar : "";
config.options.txtFCKheight = config.options.txtFCKheight ? config.options.txtFCKheight : "500px";
config.macros.editHtml = {
handler : function(place,macroName,params,wikifier,paramString,tiddler) {
var field = params[0];
var height = params[1] ? params[1] : config.options.txtFCKheight;
if (typeof FCKeditor=="undefined"){
displayMessage(config.macros.editHtml.FCKeditorUnavailable);
config.macros.edit.handler(place,macroName,params,wikifier,paramString,tiddler);
}
else if (field) {
var e = createTiddlyElement(null,"div");
var fckName = "FCKeditor"+ Math.random();
if(tiddler.isReadOnly())
e.setAttribute("readOnly","readOnly");
e.setAttribute("editHtml",field);
if (height) e.setAttribute("height",height);
e.setAttribute("fckName",fckName);
place.appendChild(e);
var fck = new FCKeditor(fckName);
fck.BasePath = config.options.txtFCKeditorPath;
if (config.options.txtFCKCustomConfigScript) fck.Config["CustomConfigurationsPath"] = config.options.txtFCKCustomConfigScript ;
if (config.options.txtFCKToolbar) fck.ToolbarSet = config.options.txtFCKToolbar;
fck.Height=height;
var re = /^<html>(.*)<\/html>$/m;
var fieldValue=store.getValue(tiddler,field);
var htmlValue = re.exec(fieldValue);
var value = (htmlValue && (htmlValue.length>0)) ? htmlValue[1] : fieldValue;
value=value.replace(/\[\[([^|\]]*)\|([^\]]*)]]/g,'<a href="#$2">$1</a>');
config.macros.editHtml.FCKvalues[fckName]=value;
e.innerHTML = fck.CreateHtml();
}
},
gather : function(e) {
var name = e.getAttribute("fckName");
var oEditor = window.FCKeditorAPI ? FCKeditorAPI.GetInstance(name) : null;
if (oEditor) {
var html = oEditor.GetHTML();
if (html!=null)
return "<html>"+html.replace(/<a href="#([^>]*)">([^<]*)<\/a>/gi,"[[$2|$1]]")+"</html>";
}
},
FCKvalues : {},
FCKeditorUnavailable : "FCKeditor kunne ikke hentes. Check om du har internet og evt. også plugin konfigurationen og genopfrisk."
}
window.FCKeditor_OnComplete= function( editorInstance ) {
var name=editorInstance.Name;
var value = config.macros.editHtml.FCKvalues[name];
delete config.macros.editHtml.FCKvalues[name];
oEditor = FCKeditorAPI.GetInstance(name);
if (value) oEditor.SetHTML(value);
}
Story.prototype.previousGatherSaveEditHtml = Story.prototype.previousGatherSaveEditHtml ? Story.prototype.previousGatherSaveEditHtml : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
if(e && e.getAttribute) {
var f = e.getAttribute("editHtml");
if(f){
var newVal = config.macros.editHtml.gather(e);
if (newVal) fields[f] = newVal;
}
this.previousGatherSaveEditHtml(e, fields);
}
};
config.shadowTiddlers.EditHtmlTemplate = config.shadowTiddlers.EditTemplate.replace(/macro='edit text'/,"macro='editHtml text'");
config.commands.editHtml={
text: "wysiwyg",
tooltip: "redigér denne tiddler med en RichText editor",
readOnlyText: "",
handler : function(event,src,title) {
clearMessage();
var tiddlerElem = document.getElementById(story.idPrefix + title);
var fields = tiddlerElem.getAttribute("tiddlyFields");
story.displayTiddler(null,title,"EditHtmlTemplate",false,null,fields);
return false;
}
}
config.shadowTiddlers.ViewTemplate = config.shadowTiddlers.ViewTemplate.replace(/\+editTiddler/,"+editTiddler editHtml");
//}}}
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]] wikibar richText'></div>
<div class='title' macro='view title'></div>
<div class='small borderless'><span class='small'>Titel :</span></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div macro='tiddler QuickEditToolbar'></div>
<div macro='showWhen tiddler.tags.contains("Topics") || tiddler.title =="Enter the name for your new master topic here"'>[[TopicNote]]</div>
<div macro='showWhen tiddler.tags.contains("Note") || tiddler.title =="New Note"'>[[NoteNote]]</div>
<table class='borderless' style='width:100%'><tr>
<td style='width:20%'>
<div class='small borderless'><span class='small'>Noter (Besked i fagsiden:):</span></div>
<div class='editor' macro='edit tekst 12'></div></td><td style='width:20%'>
<div class='small borderless'><span class='small'>Holdliste (Konverteres med L2T-knappen:):</span></div>
<div class='editor' macro='edit text 12'></div></td></table>
<div class='small borderless'><span class='small'>Holdlisten (Laves automatisk med L2T-knappen. Kopiér listen ind herover - klik færdig og tryk på L2T knappen. ):</span></div>
<div class='editor' macro='edit tags 6'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
<<siteMap {{tiddler.title}} . sliders>>
|bgcolor(#eeeeee):@@white-space: nowrap;<html><span style="padding-left:0.25em;" macro='select laerer rows:1 width:20% autoSave allowBlank allowOther +LærerListe allowEdit'></span></html>@@|<<tag Lærere>>|
|bgcolor(#eeeeee):@@white-space: nowrap;<html><span style="padding-right:0.15em;" macro='monkeyTagger Elev label: "Vælg elever"'></span></html>@@||
|bgcolor(#eeeeee):@@white-space: nowrap;[[M|mandag]][_(mandag@)][[T|tirsdag]][_(tirsdag@)][[O|onsdag]][_(onsdag@)][[T|torsdag]][_(torsdag@)][[F|fredag]][_(fredag@)]@@|[[Ugeskema]]|
|bgcolor(#eeeeee):@@white-space: nowrap;<<tiddler EleverHold>>@@| <html><div class='myClassName' <span style='font-size:9pt;color:red;font-family: Comic Sans MS;' macro='view tekst wikified'></div></html> |
<script label="Opdatér">
var tag="Fag";
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}
store.resumeNotifications();
</script>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'>
<span class='newbutton' style='padding-right: 0.5em;' macro='newHere title:"Skriv navnet på fagets nye projekt her" label:"*Nyt projekt til dette fag*" tag:"projekt" text:"Skriv tekst til projektet her"'></span><span class macro='tiddler List2Tags'></span></div></div>
<span macro='tiddler FagSliderFrame'></span>
<div class="small" macro='formTiddler FagTemplate'></div>
<table class='borderless' style='width:100%'><center<tr>
<td style='width:15%'>
<div class='small borderless'><span class='small'>Noter (Besked i fagsiden:):</span></div>
<div class='editor' macro='edit tekst 4'></div></center></td><td style='width:15%'>
<div class='small borderless'><span class='small'>Holdliste (Konverteres med L2T-knappen:):</span></div>
<div class='editor' macro='edit text 4'></div></td></table>
<div class='small borderless'><span class='small'>Holdlisten (Laves automatisk med L2T-knappen. Kopiér listen ind herover - klik færdig og tryk på L2T knappen. ):</span></div></center>
<div class='tagClear'></div>
<!--}}}-->
<script label="sidst ændrede..." title="gå til den senest redigerede tiddler">
var title=store.getTiddlers("modified","excludeLists").reverse()[0].title;
story.displayTiddler(null,title); story.refreshTiddler(title,null,true);
return false;
</script>
----
<script label="åben...">
var tid=prompt("indskriv en tiddler titel"); if (!tid || !tid.length) return;
story.displayTiddler(story.findContainingTiddler(place),tid);
return false;
</script>
----
[[Velkommen]]
[[twspot]]
[[Kontakt]]
----
[[Lav din egen fra bunden|Grundlaget]]
[[SimpleNoter]]
[[SideTitel|SiteTitle]]
[[UnderTitel|SiteSubtitle]]
----
<<forEachTiddler where 'tiddler.tags.contains("fav")'>>
----
<<editTiddler FavoritTiddlere "redigér favoritter eller tag med *fav*">>
<script label="sidst ændrede..." title="gå til den senest redigerede tiddler">
var title=store.getTiddlers("modified","excludeLists").reverse()[0].title;
story.displayTiddler(null,title); story.refreshTiddler(title,null,true);
return false;
</script>
----
<script label="åben...">
var tid=prompt("indskriv en tiddler titel"); if (!tid || !tid.length) return;
story.displayTiddler(story.findContainingTiddler(place),tid);
return false;
</script>
----
[[Kom i gang]]
[[TiddlyWiki GoogleGroup|http://groups.google.com/group/TiddlyWiki]]
[[SideTitel|SiteTitle]]
[[UnderTitel|SiteSubtitle]]
----
<<forEachTiddler where 'tiddler.tags.contains("fav")'>>
----
<<editTiddler Favoritter "Redigér favoritter">>
<<newTiddler title: 'Skriv titel på ny favorittiddler her' tag: 'fav' label: ' Ny favorittiddler ' text: 'klik på redigér og tilføj indhold'>>
<script label="Felter" title="TotalFelter">
var here=story.findContainingTiddler(place);
if (!here) return;
var title=here.getAttribute("tiddler");
var tiddler=store.getTiddler(title);
var out=[]; var fmt='[[%0]]: %1|'; var fmt2='\n|[[%0]]|';
var tids=store.sortTiddlers(store.filterTiddlers("[tag[("+tiddler.title+" AND NOT Reference)]]"), "modified");
for (var i=0; i<tids.length; i++) {
out.push(fmt2.format([tids[i].title]));
for (var f in tids[i].fields) out.push(fmt.format
([f,tids[i].fields [f]]));
}
return out.join('|');
</script>
/***
|''Name:''|FieldsEditorPlugin|
|''Description:''|//create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>.|
|''Version:''|1.0.2|
|''Date:''|Dec 21,2007|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.2.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[FieldEditor example]]
!Installation:
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*save and reload
*optionnaly : add the following css text in your StyleSheet : {{{#popup tr.fieldTableRow td {padding:1px 3px 1px 3px;}}}}
!Code
***/
//{{{
config.commands.fields.handlePopup = function(popup,title) {
var tiddler = store.fetchTiddler(title);
if(!tiddler)
return;
var fields = {};
store.forEachField(tiddler,function(tiddler,fieldName,value) {fields[fieldName] = value;},true);
var items = [];
for(var t in fields) {
var editCommand = "<<untiddledCall editFieldDialog "+escape(title)+" "+escape(t)+">>";
var deleteCommand = "<<untiddledCall deleteField "+escape(title)+" "+escape(t)+">>";
var renameCommand = "<<untiddledCall renameField "+escape(title)+" "+escape(t)+">>";
items.push({field: t,value: fields[t], actions: editCommand+renameCommand+deleteCommand});
}
items.sort(function(a,b) {return a.field < b.field ? -1 : (a.field == b.field ? 0 : +1);});
var createNewCommand = "<<untiddledCall createField "+escape(title)+">>";
items.push({field : "", value : "", actions:createNewCommand });
if(items.length > 0)
ListView.create(popup,items,this.listViewTemplate);
else
createTiddlyElement(popup,"div",null,null,this.emptyText);
}
config.commands.fields.listViewTemplate = {
columns: [
{name: 'Field', field: 'field', title: "Field", type: 'String'},
{name: 'Actions', field: 'actions', title: "Actions", type: 'WikiText'},
{name: 'Value', field: 'value', title: "Value", type: 'WikiText'}
],
rowClasses: [
{className: 'fieldTableRow', field: 'actions'}
],
buttons: [ //can't use button for selected then delete, because click on checkbox will hide the popup
]
}
config.macros.untiddledCall = { // when called from listview, tiddler is unset, so we need to pass tiddler as parameter
handler : function(place,macroName,params,wikifier,paramString) {
var macroName = params.shift();
if (macroName) var macro = config.macros[macroName];
var title = params.shift();
if (title) var tiddler = store.getTiddler(unescape(title));
if (macro) macro.handler(place,macroName,params,wikifier,paramString,tiddler);
}
}
config.macros.deleteField = {
handler : function(place,macroName,params,wikifier,paramString,tiddler) {
if(!readOnly && params[0]) {
fieldName = unescape(params[0]);
var btn = createTiddlyButton(place,"delete", "delete "+fieldName,this.onClickDeleteField);
btn.setAttribute("title",tiddler.title);
btn.setAttribute("fieldName", fieldName);
}
},
onClickDeleteField : function() {
var title=this.getAttribute("title");
var fieldName=this.getAttribute("fieldName");
var tiddler = store.getTiddler(title);
if (tiddler && fieldName && confirm("delete field " + fieldName+" from " + title +" tiddler ?")) {
delete tiddler.fields[fieldName];
store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
story.refreshTiddler(title,"ViewTemplate",true);
}
return false;
}
}
config.macros.createField = {
handler : function(place,macroName,params,wikifier,paramString,tiddler) {
if(!readOnly) {
var btn = createTiddlyButton(place,"create new", "create a new field",this.onClickCreateField);
btn.setAttribute("title",tiddler.title);
}
},
onClickCreateField : function() {
var title=this.getAttribute("title");
var tiddler = store.getTiddler(title);
if (tiddler) {
var fieldName = prompt("Field name","");
if (store.getValue(tiddler,fieldName)) {
window.alert("This field already exists.");
}
else if (fieldName) {
var v = prompt("Field value","");
tiddler.fields[fieldName]=v;
store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
story.refreshTiddler(title,"ViewTemplate",true);
}
}
return false;
}
}
config.macros.editFieldDialog = {
handler : function(place,macroName,params,wikifier,paramString,tiddler) {
if(!readOnly && params[0]) {
fieldName = unescape(params[0]);
var btn = createTiddlyButton(place,"edit", "edit this field",this.onClickEditFieldDialog);
btn.setAttribute("title",tiddler.title);
btn.setAttribute("fieldName", fieldName);
}
},
onClickEditFieldDialog : function() {
var title=this.getAttribute("title");
var tiddler = store.getTiddler(title);
var fieldName=this.getAttribute("fieldName");
if (tiddler && fieldName) {
var value = tiddler.fields[fieldName];
value = value ? value : "";
var lines = value.match(/n/mg);
lines = lines ? true : false;
if (!lines || confirm("This field contains more than one line. Only the first line will be kept if you edit it here. Proceed ?")) {
var v = prompt("Field value",value);
tiddler.fields[fieldName]=v;
store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
story.refreshTiddler(title,"ViewTemplate",true);
}
}
return false;
}
}
config.macros.renameField = {
handler : function(place,macroName,params,wikifier,paramString,tiddler) {
if(!readOnly && params[0]) {
fieldName = unescape(params[0]);
var btn = createTiddlyButton(place,"rename", "rename "+fieldName,this.onClickRenameField);
btn.setAttribute("title",tiddler.title);
btn.setAttribute("fieldName", fieldName);
}
},
onClickRenameField : function() {
var title=this.getAttribute("title");
var fieldName=this.getAttribute("fieldName");
var tiddler = store.getTiddler(title);
if (tiddler && fieldName) {
var newName = prompt("Rename " + fieldName + " as ?", fieldName);
if (newName) {
tiddler.fields[newName]=tiddler.fields[fieldName];
delete tiddler.fields[fieldName];
store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields);
story.refreshTiddler(title,"ViewTemplate",true);
}
}
return false;
}
}
config.shadowTiddlers.StyleSheetFieldsEditor = "/*{{{*/n";
config.shadowTiddlers.StyleSheetFieldsEditor += ".fieldTableRow td {padding : 1px 3px}n";
config.shadowTiddlers.StyleSheetFieldsEditor += ".fieldTableRow .button {border:0; padding : 0 0.2em}n";
config.shadowTiddlers.StyleSheetFieldsEditor +="/*}}}*/";
store.addNotification("StyleSheetFieldsEditor", refreshStyles);
//}}}
Vælg indstillinger for søgning. Hold vil gemme resultaterne over flere søgninger ved at tilføje resultaterne indtil fluebenet fjernes igen.
----
|>|<<search>>|
|<<option chkSearchTitles>> Titler <<option chkSearchText>> Tekst <<option chkSearchTags>>Tags<<option chkHoldSearches>> Hold |
|borderlessL|k
<<tiddler MakeTiddlers>>
<<newJournal "DD MMM YYYY" "simpel journal">>
<<newJournal "0DD.0MM.YYYY kl 0hh:0mm:0ss""journal t m s">>
<<newTiddler label:"Ny bog/artikel" tag:"Bøger">>
<<tiddler NytFag>>
<<clickify newTiddler title: 'Skriv navnet på det nye fag her' tag: 'Fag' label: 'Nyt faghold' field:{{"laerer:'"+prompt("Skriv initialer","")+"'"}} text:"">>
<<newTiddler title: 'Skriv initialer på ny lærer her' tag: 'Lærere' label: ' Ny lærer ' text: 'klik på redigér og tilføj oplysninger på kortets bagside'>>
<<newTiddler title: 'Indskriv navnet på en ny elev her' tag: 'Elev' label: ' Ny elev ' text: 'klik på redigér og tilføj oplysninger på kortets bagside'>>
<<newTiddler title: 'Ny IFrame - udskift XXXX herunder med den hjemmeside du vil bruge' text: '<html><div align="center"><iframe src="http://XXXX" frameborder="0" width="100%" height="600"></iframe></div></html>' tag: 'iframe' label:'ny IFrame'>>
/***
|Name|FoldHeadingsPlugin|
|Source|http://www.TiddlyTools.com/#FoldHeadingsPlugin|
|Version|1.1.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|automatically turn headings into slider-like panels that can be folded/unfolded with a single click|
This plugin defines a macro that automatically converts heading-formatted content into sliders that let you expand/collapse their content by clicking on individual headings.
!!!!!Usage
<<<
{{{
<<foldHeadings opened|closed tag tag tag...>>
}}}
where: ''opened'' or ''closed'' is a keyword indicating the initial state of the sections (default: opened), and ''tag tag tag...'' is an optional list of tags to match, so that the foldable effect is only applied to tiddlers that contain one (or more) of the indicated tags.
When you place the macro in a tiddler, any heading-formatted content (i.e, "!" through "!!!!!") in that tiddler will automatically become //'fold-able'//, allowing you to expand/collapse the content that follows each heading simply by clicking on that heading. Each content section begins with the first element following a heading, and continues until either another heading is found or the end of the tiddler is reached. For example:
{{{
<<foldHeadings closed>>
}}}
is embedded in ''this'' tiddler in order to make all the headings it contains 'fold-able'. Note that the macro has been placed at the //end// of the tiddler because it only operates on *rendered* content. Thus, only headings that //precede// it in the same tiddler will become fold-able, as any headings that //follow// it are not actually rendered until //after// the macro has been processed.
You can further limit the effect of the macro within the tiddler by surrounding several headings in a "CSS class wrapper" ("""{{classname{...}}}""") or other containing DOM element (e.g., """@@display:inline;...@@""") and then embedding the {{{<<foldHeadings>>}}} macro inside that container (at the end)... only those headings that are also within that container will be made fold-able, instead of converting ''all'' the headings in that tiddler.
Conversely, if you want the fold-able ability to apply to the headings in //all// tiddlers, ''without having to alter //any// of those individual tiddlers'', you can add the macro to the end of your [[ViewTemplate]], so that it will be invoked after the content in each tiddler has been rendered, causing all headings they contain to automatically become fold-able. For example:
{{{
<span macro="foldHeadings closed"></span>
}}}
You can also limit this effect to selected tiddlers by specifying one or more tags as additional macro parameters. For example:
{{{
<span macro="foldHeadings closed systemConfig"></span>
}}}
is only applied to headings contained in //plugin tiddlers// (i.e., tiddlers tagged with <<tag systemConfig>>), while headings in other tiddlers remain unaffected by the macro, even though it is embedded in the common [[ViewTemplate]] definition.
<<<
!!!!!Revisions
<<<
2009.01.06 [1.1.1] removed hijack of scrollToSection() (see [[SectionLinksPlugin]] for equivalent code)
2008.11.17 [1.1.0] added hijack of 'scrollToSection()' function (see [[CoreTweaks]] and http://trac.tiddlywiki.org/ticket/784)
2007.12.06 [1.0.2] fix handling for empty sections when checking for sliderPanel/floatingPanel
2007.12.02 [1.0.1] fix handling when content following a heading is already a sliderPanel/floatingPanel
2007.12.01 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.FoldHeadingsPlugin= {major: 1, minor: 1, revision: 1, date: new Date(2009,1,6)};
config.macros.foldHeadings = {
guideText: "opened|closed className",
showtip: "click to show '%0'",
hidetip: "click to hide '%0'",
showlabel: "more...",
hidelabel: "[x]",
html: "<span style='float:right;text-weight:normal;font-size:80%;' class='TiddlyLinkExisting'>%0 </span>",
handler: function(place,macroName,params) {
var show=params[0] && params.shift().toLowerCase()!="closed";
if (params.length) { // if filtering by tag(s)
var here=story.findContainingTiddler(place);
if (here) var tid=store.getTiddler(here.getAttribute("tiddler"));
if (!tid || !tid.tags.containsAny(params)) return; // in a tiddler and not tagged... do nothing...
}
var elems=place.parentNode.getElementsByTagName("*");
var heads=[]; for (var i=0; i<elems.length; i++) { // get non-foldable heading elements
var n=elems[i].nodeName; var foldable=hasClass(elems[i],"foldable");
if ((n=="H1"||n=="H2"||n=="H3"||n=="H4"||n=="H5")&&!foldable)
heads.push(elems[i]);
}
for (var i=0; i<heads.length; i++) { var h=heads[i]; // for each heading element...
// find start/end of section content (up to next heading or end of content)
var start=end=h.nextSibling; while (end && end.nextSibling) {
var n=end.nextSibling.nodeName.toUpperCase();
if (n=="H1"||n=="H2"||n=="H3"||n=="H4"||n=="H5") break;
end=end.nextSibling;
}
if (start && hasClass(start,"sliderPanel")||hasClass(start,"floatingPanel")) continue; // heading is already a slider!
var span=createTiddlyElement(null,"span",null,"sliderPanel"); // create container
span.style.display=show?"inline":"none"; // set initial display state
h.parentNode.insertBefore(span,start); // and insert it following the heading element
// move section elements into container...
var e=start; while (e) { var next=e.nextSibling; span.insertBefore(e,null); if (e==end) break; e=next; }
// set heading label/tip/cursor...
h.title=(show?this.hidetip:this.showtip).format([h.textContent])
h.innerHTML=this.html.format([show?this.hidelabel:this.showlabel])+h.innerHTML;
h.style.cursor='pointer';
addClass(h,"foldable"); // so we know it been done (and to add extra styles)
h.onclick=function() {
var panel=this.nextSibling; var show=panel.style.display=="none";
// update panel display state
if (config.options.chkAnimate) anim.startAnimating(new Slider(panel,show));
else panel.style.display = show?"inline":"none";
// update heading label/tip
this.removeChild(this.firstChild); // remove existing label
var fh=config.macros.foldHeadings; // abbreviation for readability...
this.title=(show?fh.hidetip:fh.showtip).format([this.textContent])
this.innerHTML=fh.html.format([show?fh.hidelabel:fh.showlabel])+this.innerHTML;
}
}
}
}
if (story.scrollToSection) {
Story.prototype.foldheadings_scrollToSection=Story.prototype.scrollToSection;
Story.prototype.scrollToSection=function(title,section) {
var e=this.foldheadings_scrollToSection.apply(this,arguments);
// if scrolling to a folded section heading, click to expand it
if (e && hasClass(e,'foldable') && e.nextSibling.style.display=='none') e.onclick();
}
}
//}}}
// //<<foldHeadings closed>>
config.macros.foldHeadings.showlabel = '[+]';
config.macros.foldHeadings.hidelabel = '[-]';
/***
|''Name:''|ForEachTiddlerPlugin|
|''Version:''|1.0.8 (2007-04-12)|
|''Source:''|http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin|
|''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-2007 [[abego Software|http://www.abego-software.de]]|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
!Description
Create customizable lists, tables etc. for your selections of tiddlers. Specify the tiddlers to include and their order through a powerful language.
''Syntax:''
|>|{{{<<}}}''forEachTiddler'' [''in'' //tiddlyWikiPath//] [''where'' //whereCondition//] [''sortBy'' //sortExpression// [''ascending'' //or// ''descending'']] [''script'' //scriptText//] [//action// [//actionParameters//]]{{{>>}}}|
|//tiddlyWikiPath//|The filepath to the TiddlyWiki the macro should work on. When missing the current TiddlyWiki is used.|
|//whereCondition//|(quoted) JavaScript boolean expression. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//sortExpression//|(quoted) JavaScript expression returning "comparable" objects (using '{{{<}}}','{{{>}}}','{{{==}}}'. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//scriptText//|(quoted) JavaScript text. Typically defines JavaScript functions that are called by the various JavaScript expressions (whereClause, sortClause, action arguments,...)|
|//action//|The action that should be performed on every selected tiddler, in the given order. By default the actions [[addToList|AddToListAction]] and [[write|WriteAction]] are supported. When no action is specified [[addToList|AddToListAction]] is used.|
|//actionParameters//|(action specific) parameters the action may refer while processing the tiddlers (see action descriptions for details). <<tiddler [[JavaScript in actionParameters]]>>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
See details see [[ForEachTiddlerMacro]] and [[ForEachTiddlerExamples]].
!Revision history
* v1.0.8 (2007-04-12)
** Adapted to latest TiddlyWiki 2.2 Beta importTiddlyWiki API (introduced with changeset 2004). TiddlyWiki 2.2 Beta builds prior to changeset 2004 are no longer supported (but TiddlyWiki 2.1 and earlier, of cause)
* v1.0.7 (2007-03-28)
** Also support "pre" formatted TiddlyWikis (introduced with TW 2.2) (when using "in" clause to work on external tiddlers)
* v1.0.6 (2006-09-16)
** Context provides "viewerTiddler", i.e. the tiddler used to view the macro. Most times this is equal to the "inTiddler", but when using the "tiddler" macro both may be different.
** Support "begin", "end" and "none" expressions in "write" action
* v1.0.5 (2006-02-05)
** Pass tiddler containing the macro with wikify, context object also holds reference to tiddler containing the macro ("inTiddler"). Thanks to SimonBaird.
** Support Firefox 1.5.0.1
** Internal
*** Make "JSLint" conform
*** "Only install once"
* v1.0.4 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.3 (2005-12-22)
** Features:
*** Write output to a file supports multi-byte environments (Thanks to Bram Chen)
*** Provide API to access the forEachTiddler functionality directly through JavaScript (see getTiddlers and performMacro)
** Enhancements:
*** Improved error messages on InternetExplorer.
* v1.0.2 (2005-12-10)
** Features:
*** context object also holds reference to store (TiddlyWiki)
** Fixed Bugs:
*** ForEachTiddler 1.0.1 has broken support on win32 Opera 8.51 (Thanks to BrunoSabin for reporting)
* v1.0.1 (2005-12-08)
** Features:
*** Access tiddlers stored in separated TiddlyWikis through the "in" option. I.e. you are no longer limited to only work on the "current TiddlyWiki".
*** Write output to an external file using the "toFile" option of the "write" action. With this option you may write your customized tiddler exports.
*** Use the "script" section to define "helper" JavaScript functions etc. to be used in the various JavaScript expressions (whereClause, sortClause, action arguments,...).
*** Access and store context information for the current forEachTiddler invocation (through the build-in "context" object) .
*** Improved script evaluation (for where/sort clause and write scripts).
* v1.0.0 (2005-11-20)
** initial version
!Code
***/
//{{{
//============================================================================
//============================================================================
// ForEachTiddlerPlugin
//============================================================================
//============================================================================
// Only install once
if (!version.extensions.ForEachTiddlerPlugin) {
if (!window.abego) window.abego = {};
version.extensions.ForEachTiddlerPlugin = {
major: 1, minor: 0, revision: 8,
date: new Date(2007,3,12),
source: "http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin",
licence: "[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]",
copyright: "Copyright (c) abego Software GmbH, 2005-2007 (www.abego-software.de)"
};
// For backward compatibility with TW 1.2.x
//
if (!TiddlyWiki.prototype.forEachTiddler) {
TiddlyWiki.prototype.forEachTiddler = function(callback) {
for(var t in this.tiddlers) {
callback.call(this,t,this.tiddlers[t]);
}
};
}
//============================================================================
// forEachTiddler Macro
//============================================================================
version.extensions.forEachTiddler = {
major: 1, minor: 0, revision: 8, date: new Date(2007,3,12), provider: "http://tiddlywiki.abego-software.de"};
// ---------------------------------------------------------------------------
// Configurations and constants
// ---------------------------------------------------------------------------
config.macros.forEachTiddler = {
// Standard Properties
label: "forEachTiddler",
prompt: "Perform actions on a (sorted) selection of tiddlers",
// actions
actions: {
addToList: {},
write: {}
}
};
// ---------------------------------------------------------------------------
// The forEachTiddler Macro Handler
// ---------------------------------------------------------------------------
config.macros.forEachTiddler.getContainingTiddler = function(e) {
while(e && !hasClass(e,"tiddler"))
e = e.parentNode;
var title = e ? e.getAttribute("tiddler") : null;
return title ? store.getTiddler(title) : null;
};
config.macros.forEachTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
// config.macros.forEachTiddler.traceMacroCall(place,macroName,params,wikifier,paramString,tiddler);
if (!tiddler) tiddler = config.macros.forEachTiddler.getContainingTiddler(place);
// --- Parsing ------------------------------------------
var i = 0; // index running over the params
// Parse the "in" clause
var tiddlyWikiPath = undefined;
if ((i < params.length) && params[i] == "in") {
i++;
if (i >= params.length) {
this.handleError(place, "TiddlyWiki path expected behind 'in'.");
return;
}
tiddlyWikiPath = this.paramEncode((i < params.length) ? params[i] : "");
i++;
}
// Parse the where clause
var whereClause ="true";
if ((i < params.length) && params[i] == "where") {
i++;
whereClause = this.paramEncode((i < params.length) ? params[i] : "");
i++;
}
// Parse the sort stuff
var sortClause = null;
var sortAscending = true;
if ((i < params.length) && params[i] == "sortBy") {
i++;
if (i >= params.length) {
this.handleError(place, "sortClause missing behind 'sortBy'.");
return;
}
sortClause = this.paramEncode(params[i]);
i++;
if ((i < params.length) && (params[i] == "ascending" || params[i] == "descending")) {
sortAscending = params[i] == "ascending";
i++;
}
}
// Parse the script
var scriptText = null;
if ((i < params.length) && params[i] == "script") {
i++;
scriptText = this.paramEncode((i < params.length) ? params[i] : "");
i++;
}
// Parse the action.
// When we are already at the end use the default action
var actionName = "addToList";
if (i < params.length) {
if (!config.macros.forEachTiddler.actions[params[i]]) {
this.handleError(place, "Unknown action '"+params[i]+"'.");
return;
} else {
actionName = params[i];
i++;
}
}
// Get the action parameter
// (the parsing is done inside the individual action implementation.)
var actionParameter = params.slice(i);
// --- Processing ------------------------------------------
try {
this.performMacro({
place: place,
inTiddler: tiddler,
whereClause: whereClause,
sortClause: sortClause,
sortAscending: sortAscending,
actionName: actionName,
actionParameter: actionParameter,
scriptText: scriptText,
tiddlyWikiPath: tiddlyWikiPath});
} catch (e) {
this.handleError(place, e);
}
};
// Returns an object with properties "tiddlers" and "context".
// tiddlers holds the (sorted) tiddlers selected by the parameter,
// context the context of the execution of the macro.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlersAndContext = function(parameter) {
var context = config.macros.forEachTiddler.createContext(parameter.place, parameter.whereClause, parameter.sortClause, parameter.sortAscending, parameter.actionName, parameter.actionParameter, parameter.scriptText, parameter.tiddlyWikiPath, parameter.inTiddler);
var tiddlyWiki = parameter.tiddlyWikiPath ? this.loadTiddlyWiki(parameter.tiddlyWikiPath) : store;
context["tiddlyWiki"] = tiddlyWiki;
// Get the tiddlers, as defined by the whereClause
var tiddlers = this.findTiddlers(parameter.whereClause, context, tiddlyWiki);
context["tiddlers"] = tiddlers;
// Sort the tiddlers, when sorting is required.
if (parameter.sortClause) {
this.sortTiddlers(tiddlers, parameter.sortClause, parameter.sortAscending, context);
}
return {tiddlers: tiddlers, context: context};
};
// Returns the (sorted) tiddlers selected by the parameter.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlers = function(parameter) {
return this.getTiddlersAndContext(parameter).tiddlers;
};
// Performs the macros with the given parameter.
//
// @param parameter holds the parameter of the macro as separate properties.
// The following properties are supported:
//
// place
// whereClause
// sortClause
// sortAscending
// actionName
// actionParameter
// scriptText
// tiddlyWikiPath
//
// All properties are optional.
// For most actions the place property must be defined.
//
config.macros.forEachTiddler.performMacro = function(parameter) {
var tiddlersAndContext = this.getTiddlersAndContext(parameter);
// Perform the action
var actionName = parameter.actionName ? parameter.actionName : "addToList";
var action = config.macros.forEachTiddler.actions[actionName];
if (!action) {
this.handleError(parameter.place, "Unknown action '"+actionName+"'.");
return;
}
var actionHandler = action.handler;
actionHandler(parameter.place, tiddlersAndContext.tiddlers, parameter.actionParameter, tiddlersAndContext.context);
};
// ---------------------------------------------------------------------------
// The actions
// ---------------------------------------------------------------------------
// Internal.
//
// --- The addToList Action -----------------------------------------------
//
config.macros.forEachTiddler.actions.addToList.handler = function(place, tiddlers, parameter, context) {
// Parse the parameter
var p = 0;
// Check for extra parameters
if (parameter.length > p) {
config.macros.forEachTiddler.createExtraParameterErrorElement(place, "addToList", parameter, p);
return;
}
// Perform the action.
var list = document.createElement("ul");
place.appendChild(list);
for (var i = 0; i < tiddlers.length; i++) {
var tiddler = tiddlers[i];
var listItem = document.createElement("li");
list.appendChild(listItem);
createTiddlyLink(listItem, tiddler.title, true);
}
};
abego.parseNamedParameter = function(name, parameter, i) {
var beginExpression = null;
if ((i < parameter.length) && parameter[i] == name) {
i++;
if (i >= parameter.length) {
throw "Missing text behind '%0'".format([name]);
}
return config.macros.forEachTiddler.paramEncode(parameter[i]);
}
return null;
}
// Internal.
//
// --- The write Action ---------------------------------------------------
//
config.macros.forEachTiddler.actions.write.handler = function(place, tiddlers, parameter, context) {
// Parse the parameter
var p = 0;
if (p >= parameter.length) {
this.handleError(place, "Missing expression behind 'write'.");
return;
}
var textExpression = config.macros.forEachTiddler.paramEncode(parameter[p]);
p++;
// Parse the "begin" option
var beginExpression = abego.parseNamedParameter("begin", parameter, p);
if (beginExpression !== null)
p += 2;
var endExpression = abego.parseNamedParameter("end", parameter, p);
if (endExpression !== null)
p += 2;
var noneExpression = abego.parseNamedParameter("none", parameter, p);
if (noneExpression !== null)
p += 2;
// Parse the "toFile" option
var filename = null;
var lineSeparator = undefined;
if ((p < parameter.length) && parameter[p] == "toFile") {
p++;
if (p >= parameter.length) {
this.handleError(place, "Filename expected behind 'toFile' of 'write' action.");
return;
}
filename = config.macros.forEachTiddler.getLocalPath(config.macros.forEachTiddler.paramEncode(parameter[p]));
p++;
if ((p < parameter.length) && parameter[p] == "withLineSeparator") {
p++;
if (p >= parameter.length) {
this.handleError(place, "Line separator text expected behind 'withLineSeparator' of 'write' action.");
return;
}
lineSeparator = config.macros.forEachTiddler.paramEncode(parameter[p]);
p++;
}
}
// Check for extra parameters
if (parameter.length > p) {
config.macros.forEachTiddler.createExtraParameterErrorElement(place, "write", parameter, p);
return;
}
// Perform the action.
var func = config.macros.forEachTiddler.getEvalTiddlerFunction(textExpression, context);
var count = tiddlers.length;
var text = "";
if (count > 0 && beginExpression)
text += config.macros.forEachTiddler.getEvalTiddlerFunction(beginExpression, context)(undefined, context, count, undefined);
for (var i = 0; i < count; i++) {
var tiddler = tiddlers[i];
text += func(tiddler, context, count, i);
}
if (count > 0 && endExpression)
text += config.macros.forEachTiddler.getEvalTiddlerFunction(endExpression, context)(undefined, context, count, undefined);
if (count == 0 && noneExpression)
text += config.macros.forEachTiddler.getEvalTiddlerFunction(noneExpression, context)(undefined, context, count, undefined);
if (filename) {
if (lineSeparator !== undefined) {
lineSeparator = lineSeparator.replace(/\\n/mg, "\n").replace(/\\r/mg, "\r");
text = text.replace(/\n/mg,lineSeparator);
}
saveFile(filename, convertUnicodeToUTF8(text));
} else {
var wrapper = createTiddlyElement(place, "span");
wikify(text, wrapper, null/* highlightRegExp */, context.inTiddler);
}
};
// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------
// Internal.
//
config.macros.forEachTiddler.createContext = function(placeParam, whereClauseParam, sortClauseParam, sortAscendingParam, actionNameParam, actionParameterParam, scriptText, tiddlyWikiPathParam, inTiddlerParam) {
return {
place : placeParam,
whereClause : whereClauseParam,
sortClause : sortClauseParam,
sortAscending : sortAscendingParam,
script : scriptText,
actionName : actionNameParam,
actionParameter : actionParameterParam,
tiddlyWikiPath : tiddlyWikiPathParam,
inTiddler : inTiddlerParam, // the tiddler containing the <<forEachTiddler ...>> macro call.
viewerTiddler : config.macros.forEachTiddler.getContainingTiddler(placeParam) // the tiddler showing the forEachTiddler result
};
};
// Internal.
//
// Returns a TiddlyWiki with the tiddlers loaded from the TiddlyWiki of
// the given path.
//
config.macros.forEachTiddler.loadTiddlyWiki = function(path, idPrefix) {
if (!idPrefix) {
idPrefix = "store";
}
var lenPrefix = idPrefix.length;
// Read the content of the given file
var content = loadFile(this.getLocalPath(path));
if(content === null) {
throw "TiddlyWiki '"+path+"' not found.";
}
var tiddlyWiki = new TiddlyWiki();
// Starting with TW 2.2 there is a helper function to import the tiddlers
if (tiddlyWiki.importTiddlyWiki) {
if (!tiddlyWiki.importTiddlyWiki(content))
throw "File '"+path+"' is not a TiddlyWiki.";
tiddlyWiki.dirty = false;
return tiddlyWiki;
}
// The legacy code, for TW < 2.2
// Locate the storeArea div's
var posOpeningDiv = content.indexOf(startSaveArea);
var posClosingDiv = content.lastIndexOf(endSaveArea);
if((posOpeningDiv == -1) || (posClosingDiv == -1)) {
throw "File '"+path+"' is not a TiddlyWiki.";
}
var storageText = content.substr(posOpeningDiv + startSaveArea.length, posClosingDiv);
// Create a "div" element that contains the storage text
var myStorageDiv = document.createElement("div");
myStorageDiv.innerHTML = storageText;
myStorageDiv.normalize();
// Create all tiddlers in a new TiddlyWiki
// (following code is modified copy of TiddlyWiki.prototype.loadFromDiv)
var store = myStorageDiv.childNodes;
for(var t = 0; t < store.length; t++) {
var e = store[t];
var title = null;
if(e.getAttribute)
title = e.getAttribute("tiddler");
if(!title && e.id && e.id.substr(0,lenPrefix) == idPrefix)
title = e.id.substr(lenPrefix);
if(title && title !== "") {
var tiddler = tiddlyWiki.createTiddler(title);
tiddler.loadFromDiv(e,title);
}
}
tiddlyWiki.dirty = false;
return tiddlyWiki;
};
// Internal.
//
// Returns a function that has a function body returning the given javaScriptExpression.
// The function has the parameters:
//
// (tiddler, context, count, index)
//
config.macros.forEachTiddler.getEvalTiddlerFunction = function (javaScriptExpression, context) {
var script = context["script"];
var functionText = "var theFunction = function(tiddler, context, count, index) { return "+javaScriptExpression+"}";
var fullText = (script ? script+";" : "")+functionText+";theFunction;";
return eval(fullText);
};
// Internal.
//
config.macros.forEachTiddler.findTiddlers = function(whereClause, context, tiddlyWiki) {
var result = [];
var func = config.macros.forEachTiddler.getEvalTiddlerFunction(whereClause, context);
tiddlyWiki.forEachTiddler(function(title,tiddler) {
if (func(tiddler, context, undefined, undefined)) {
result.push(tiddler);
}
});
return result;
};
// Internal.
//
config.macros.forEachTiddler.createExtraParameterErrorElement = function(place, actionName, parameter, firstUnusedIndex) {
var message = "Extra parameter behind '"+actionName+"':";
for (var i = firstUnusedIndex; i < parameter.length; i++) {
message += " "+parameter[i];
}
this.handleError(place, message);
};
// Internal.
//
config.macros.forEachTiddler.sortAscending = function(tiddlerA, tiddlerB) {
var result =
(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue)
? 0
: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
? -1
: +1;
return result;
};
// Internal.
//
config.macros.forEachTiddler.sortDescending = function(tiddlerA, tiddlerB) {
var result =
(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue)
? 0
: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
? +1
: -1;
return result;
};
// Internal.
//
config.macros.forEachTiddler.sortTiddlers = function(tiddlers, sortClause, ascending, context) {
// To avoid evaluating the sortClause whenever two items are compared
// we pre-calculate the sortValue for every item in the array and store it in a
// temporary property ("forEachTiddlerSortValue") of the tiddlers.
var func = config.macros.forEachTiddler.getEvalTiddlerFunction(sortClause, context);
var count = tiddlers.length;
var i;
for (i = 0; i < count; i++) {
var tiddler = tiddlers[i];
tiddler.forEachTiddlerSortValue = func(tiddler,context, undefined, undefined);
}
// Do the sorting
tiddlers.sort(ascending ? this.sortAscending : this.sortDescending);
// Delete the temporary property that holds the sortValue.
for (i = 0; i < tiddlers.length; i++) {
delete tiddlers[i].forEachTiddlerSortValue;
}
};
// Internal.
//
config.macros.forEachTiddler.trace = function(message) {
displayMessage(message);
};
// Internal.
//
config.macros.forEachTiddler.traceMacroCall = function(place,macroName,params) {
var message ="<<"+macroName;
for (var i = 0; i < params.length; i++) {
message += " "+params[i];
}
message += ">>";
displayMessage(message);
};
// Internal.
//
// Creates an element that holds an error message
//
config.macros.forEachTiddler.createErrorElement = function(place, exception) {
var message = (exception.description) ? exception.description : exception.toString();
return createTiddlyElement(place,"span",null,"forEachTiddlerError","<<forEachTiddler ...>>: "+message);
};
// Internal.
//
// @param place [may be null]
//
config.macros.forEachTiddler.handleError = function(place, exception) {
if (place) {
this.createErrorElement(place, exception);
} else {
throw exception;
}
};
// Internal.
//
// Encodes the given string.
//
// Replaces
// "$))" to ">>"
// "$)" to ">"
//
config.macros.forEachTiddler.paramEncode = function(s) {
var reGTGT = new RegExp("\\$\\)\\)","mg");
var reGT = new RegExp("\\$\\)","mg");
return s.replace(reGTGT, ">>").replace(reGT, ">");
};
// Internal.
//
// Returns the given original path (that is a file path, starting with "file:")
// as a path to a local file, in the systems native file format.
//
// Location information in the originalPath (i.e. the "#" and stuff following)
// is stripped.
//
config.macros.forEachTiddler.getLocalPath = function(originalPath) {
// Remove any location part of the URL
var hashPos = originalPath.indexOf("#");
if(hashPos != -1)
originalPath = originalPath.substr(0,hashPos);
// Convert to a native file format assuming
// "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
// "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
// "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
// "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
var localPath;
if(originalPath.charAt(9) == ":") // pc local file
localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
else if(originalPath.indexOf("file://///") === 0) // FireFox pc network file
localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
else if(originalPath.indexOf("file:///") === 0) // mac/unix local file
localPath = unescape(originalPath.substr(7));
else if(originalPath.indexOf("file:/") === 0) // mac/unix local file
localPath = unescape(originalPath.substr(5));
else // pc network file
localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");
return localPath;
};
// ---------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// ---------------------------------------------------------------------------
//
setStylesheet(
".forEachTiddlerError{color: #ffffff;background-color: #880000;}",
"forEachTiddler");
//============================================================================
// End of forEachTiddler Macro
//============================================================================
//============================================================================
// String.startsWith Function
//============================================================================
//
// Returns true if the string starts with the given prefix, false otherwise.
//
version.extensions["String.startsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.startsWith = function(prefix) {
var n = prefix.length;
return (this.length >= n) && (this.slice(0, n) == prefix);
};
//============================================================================
// String.endsWith Function
//============================================================================
//
// Returns true if the string ends with the given suffix, false otherwise.
//
version.extensions["String.endsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.endsWith = function(suffix) {
var n = suffix.length;
return (this.length >= n) && (this.right(n) == suffix);
};
//============================================================================
// String.contains Function
//============================================================================
//
// Returns true when the string contains the given substring, false otherwise.
//
version.extensions["String.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.contains = function(substring) {
return this.indexOf(substring) >= 0;
};
//============================================================================
// Array.indexOf Function
//============================================================================
//
// Returns the index of the first occurance of the given item in the array or
// -1 when no such item exists.
//
// @param item [may be null]
//
version.extensions["Array.indexOf"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.indexOf = function(item) {
for (var i = 0; i < this.length; i++) {
if (this[i] == item) {
return i;
}
}
return -1;
};
//============================================================================
// Array.contains Function
//============================================================================
//
// Returns true when the array contains the given item, otherwise false.
//
// @param item [may be null]
//
version.extensions["Array.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.contains = function(item) {
return (this.indexOf(item) >= 0);
};
//============================================================================
// Array.containsAny Function
//============================================================================
//
// Returns true when the array contains at least one of the elements
// of the item. Otherwise (or when items contains no elements) false is returned.
//
version.extensions["Array.containsAny"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAny = function(items) {
for(var i = 0; i < items.length; i++) {
if (this.contains(items[i])) {
return true;
}
}
return false;
};
//============================================================================
// Array.containsAll Function
//============================================================================
//
// Returns true when the array contains all the items, otherwise false.
//
// When items is null false is returned (even if the array contains a null).
//
// @param items [may be null]
//
version.extensions["Array.containsAll"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAll = function(items) {
for(var i = 0; i < items.length; i++) {
if (!this.contains(items[i])) {
return false;
}
}
return true;
};
} // of "install only once"
// Used Globals (for JSLint) ==============
// ... DOM
/*global document */
// ... TiddlyWiki Core
/*global convertUnicodeToUTF8, createTiddlyElement, createTiddlyLink,
displayMessage, endSaveArea, hasClass, loadFile, saveFile,
startSaveArea, store, wikify */
//}}}
/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005 ([[www.abego-software.de|http://www.abego-software.de]])
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/
The {{{<<formTiddler ...>>}}} macro defined by the FormTiddlerPlugin.
When a tiddler T1 references the (FormTemplate) tiddler T2 in the FormTiddlerMacro, the data of T1 can be edited through the INPUT elements defined by T2.
/***
<<checkForDataTiddlerPlugin>>
|''Name:''|FormTiddlerPlugin|
|''Version:''|1.0.6 (2007-06-24)|
|''Source:''|http://tiddlywiki.abego-software.de/#FormTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''Macros:''|formTiddler, checkForDataTiddlerPlugin, newTiddlerWithForm|
|''Requires:''|DataTiddlerPlugin|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Description
Use form-based tiddlers to enter your tiddler data using text fields, listboxes, checkboxes etc. (All standard HTML Form input elements supported).
''Syntax:''
|>|{{{<<}}}''formTiddler'' //tiddlerName//{{{>>}}}|
|//tiddlerName//|The name of the FormTemplate tiddler to be used to edit the data of the tiddler containing the macro.|
|>|{{{<<}}}''newTiddlerWithForm'' //formTemplateName// //buttonLabel// [//titleExpression// [''askUser'']] {{{>>}}}|
|//formTemplateName//|The name of the tiddler that defines the form the new tiddler should use.|
|//buttonLabel//|The label of the button|
|//titleExpression//|A (quoted) JavaScript String expression that defines the title (/name) of the new tiddler.|
|''askUser''|Typically the user is not asked for the title when a title is specified (and not yet used). When ''askUser'' is given the user will be asked in any case. This may be used when the calculated title is just a suggestion that must be confirmed by the user|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
For details and how to use the macros see the [[introduction|FormTiddler Introduction]] and the [[examples|FormTiddler Examples]].
!Revision history
* v1.0.6 (2007-06-24)
** Fixed problem when using SELECT component in Internet Explorer (thanks to MaikBoenig for reporting)
* v1.0.5 (2006-02-24)
** Removed "debugger;" instruction
* v1.0.4 (2006-02-07)
** Bug: On IE no data is written to data section when field values changed (thanks to KenGirard for reporting)
* v1.0.3 (2006-02-05)
** Bug: {{{"No form template specified in <<formTiddler>>"}}} when using formTiddler macro on InternetExplorer (thanks to KenGirard for reporting)
* v1.0.2 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.1 (2005-12-22)
** Features:
*** Support InternetExplorer
*** Added newTiddlerWithForm Macro
* v1.0.0 (2005-12-14)
** initial version
!Code
***/
//{{{
//============================================================================
//============================================================================
// FormTiddlerPlugin
//============================================================================
//============================================================================
if (!window.abego) window.abego = {};
abego.getOptionsValue = function(element,i) {
var v = element.options[i].value;
if (!v && element.options[i].text)
v = element.options[i].text;
return v;
};
version.extensions.FormTiddlerPlugin = {
major: 1, minor: 0, revision: 5,
date: new Date(2006, 2, 24),
type: 'plugin',
source: "http://tiddlywiki.abego-software.de/#FormTiddlerPlugin"
};
// For backward compatibility with v1.2.x
//
if (!window.story) window.story=window;
if (!TiddlyWiki.prototype.getTiddler) TiddlyWiki.prototype.getTiddler = function(title) { return t = this.tiddlers[title]; return (t != undefined && t instanceof Tiddler) ? t : null; }
//============================================================================
// formTiddler Macro
//============================================================================
// -------------------------------------------------------------------------------
// Configurations and constants
// -------------------------------------------------------------------------------
config.macros.formTiddler = {
// Standard Properties
label: "formTiddler",
version: {major: 1, minor: 0, revision: 4, date: new Date(2006, 2, 7)},
prompt: "Edit tiddler data using forms",
// Define the "setters" that set the values of INPUT elements of a given type
// (must match the corresponding "getter")
setter: {
button: function(e, value) {/*contains no data */ },
checkbox: function(e, value) {e.checked = value;},
file: function(e, value) {try {e.value = value;} catch(e) {/* ignore, possibly security error*/}},
hidden: function(e, value) {e.value = value;},
password: function(e, value) {e.value = value;},
radio: function(e, value) {e.checked = (e.value == value);},
reset: function(e, value) {/*contains no data */ },
"select-one": function(e, value) {config.macros.formTiddler.setSelectOneValue(e,value);},
"select-multiple": function(e, value) {config.macros.formTiddler.setSelectMultipleValue(e,value);},
submit: function(e, value) {/*contains no data */},
text: function(e, value) {e.value = value;},
textarea: function(e, value) {e.value = value;}
},
// Define the "getters" that return the value of INPUT elements of a given type
// Return undefined to not store any data.
getter: {
button: function(e, value) {return undefined;},
checkbox: function(e, value) {return e.checked;},
file: function(e, value) {return e.value;},
hidden: function(e, value) {return e.value;},
password: function(e, value) {return e.value;},
radio: function(e, value) {return e.checked ? e.value : undefined;},
reset: function(e, value) {return undefined;},
"select-one": function(e, value) {return config.macros.formTiddler.getSelectOneValue(e);},
"select-multiple": function(e, value) {return config.macros.formTiddler.getSelectMultipleValue(e);},
submit: function(e, value) {return undefined;},
text: function(e, value) {return e.value;},
textarea: function(e, value) {return e.value;}
}
};
// -------------------------------------------------------------------------------
// The formTiddler Macro Handler
// -------------------------------------------------------------------------------
config.macros.formTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
if (!config.macros.formTiddler.checkForExtensions(place, macroName)) {
return;
}
// --- Parsing ------------------------------------------
var i = 0; // index running over the params
// get the name of the form template tiddler
var formTemplateName = undefined;
if (i < params.length) {
formTemplateName = params[i];
i++;
}
if (!formTemplateName) {
config.macros.formTiddler.createErrorElement(place, "No form template specified in <<" + macroName + ">>.");
return;
}
// --- Processing ------------------------------------------
// Get the form template text.
// (This contains the INPUT elements for the form.)
var formTemplateTiddler = store.getTiddler(formTemplateName);
if (!formTemplateTiddler) {
config.macros.formTiddler.createErrorElement(place, "Form template '" + formTemplateName + "' not found.");
return;
}
var templateText = formTemplateTiddler.text;
if(!templateText) {
// Shortcut: when template text is empty we do nothing.
return;
}
// Get the name of the tiddler containing this "formTiddler" macro
// (i.e. the tiddler, that will be edited and that contains the data)
var tiddlerName = config.macros.formTiddler.getContainingTiddlerName(place);
// Append a "form" element.
var formName = "form"+formTemplateName+"__"+tiddlerName;
var e = document.createElement("form");
e.setAttribute("name", formName);
place.appendChild(e);
// "Embed" the elements defined by the templateText (i.e. the INPUT elements)
// into the "form" element we just created
wikify(templateText, e);
// Initialize the INPUT elements.
config.macros.formTiddler.initValuesAndHandlersInFormElements(formName, DataTiddler.getDataObject(tiddlerName));
}
// -------------------------------------------------------------------------------
// Form Data Access
// -------------------------------------------------------------------------------
// Internal.
//
// Initialize the INPUT elements of the form with the values of their "matching"
// data fields in the tiddler. Also setup the onChange handler to ensure that
// changes in the INPUT elements are stored in the tiddler's data.
//
config.macros.formTiddler.initValuesAndHandlersInFormElements = function(formName, data) {
// config.macros.formTiddler.trace("initValuesAndHandlersInFormElements(formName="+formName+", data="+data+")");
// find the form
var form = config.macros.formTiddler.findForm(formName);
if (!form) {
return;
}
try {
var elems = form.elements;
for (var i = 0; i < elems.length; i++) {
var c = elems[i];
var setter = config.macros.formTiddler.setter[c.type];
if (setter) {
var value = data[c.name];
if (value != null) {
setter(c, value);
}
c.onchange = onFormTiddlerChange;
} else {
config.macros.formTiddler.displayFormTiddlerError("No setter defined for INPUT element of type '"+c.type+"'. (Element '"+c.name+"' in form '"+formName+"')");
}
}
} catch(e) {
config.macros.formTiddler.displayFormTiddlerError("Error when updating elements with new formData. "+e);
}
}
// Internal.
//
// @return [may be null]
//
config.macros.formTiddler.findForm = function(formName) {
// We must manually iterate through the document's forms, since
// IE does not support the "document[formName]" approach
var forms = window.document.forms;
for (var i = 0; i < forms.length; i++) {
var form = forms[i];
if (form.name == formName) {
return form;
}
}
return null;
}
// Internal.
//
config.macros.formTiddler.setSelectOneValue = function(element,value) {
var n = element.options.length;
for (var i = 0; i < n; i++) {
element.options[i].selected = abego.getOptionsValue(element,i) == value;
}
}
// Internal.
//
config.macros.formTiddler.setSelectMultipleValue = function(element,value) {
var values = {};
for (var i = 0; i < value.length; i++) {
values[value[i]] = true;
}
var n = element.length;
for (var i = 0; i < n; i++) {
element.options[i].selected = !(!values[abego.getOptionsValue(element,i)]);
}
}
// Internal.
//
config.macros.formTiddler.getSelectOneValue = function(element) {
var i = element.selectedIndex;
return (i >= 0) ? abego.getOptionsValue(element,i) : null;
}
// Internal.
//
config.macros.formTiddler.getSelectMultipleValue = function(element) {
var values = [];
var n = element.length;
for (var i = 0; i < n; i++) {
if (element.options[i].selected) {
values.push(abego.getOptionsValue(element,i));
}
}
return values;
}
// -------------------------------------------------------------------------------
// Helpers
// -------------------------------------------------------------------------------
// Internal.
//
config.macros.formTiddler.checkForExtensions = function(place,macroName) {
if (!version.extensions.DataTiddlerPlugin) {
config.macros.formTiddler.createErrorElement(place, "<<" + macroName + ">> requires the DataTiddlerPlugin. (You can get it from http://tiddlywiki.abego-software.de/#DataTiddlerPlugin)");
return false;
}
return true;
}
// Internal.
//
// Displays a trace message in the "TiddlyWiki" message pane.
// (used for debugging)
//
config.macros.formTiddler.trace = function(s) {
displayMessage("Trace: "+s);
}
// Internal.
//
// Display some error message in the "TiddlyWiki" message pane.
//
config.macros.formTiddler.displayFormTiddlerError = function(s) {
alert("FormTiddlerPlugin Error: "+s);
}
// Internal.
//
// Creates an element that holds an error message
//
config.macros.formTiddler.createErrorElement = function(place, message) {
return createTiddlyElement(place,"span",null,"formTiddlerError",message);
}
// Internal.
//
// Returns the name of the tiddler containing the given element.
//
config.macros.formTiddler.getContainingTiddlerName = function(element) {
return story.findContainingTiddler(element).id.substr(7);
}
// -------------------------------------------------------------------------------
// Event Handlers
// -------------------------------------------------------------------------------
// This function must be called by the INPUT elements whenever their
// data changes. Typically this is done through an "onChange" handler.
//
function onFormTiddlerChange (e) {
// config.macros.formTiddler.trace("onFormTiddlerChange "+e);
if (!e) var e = window.event;
var target = resolveTarget(e);
var tiddlerName = config.macros.formTiddler.getContainingTiddlerName(target);
var getter = config.macros.formTiddler.getter[target.type];
if (getter) {
var value = getter(target);
DataTiddler.setData(tiddlerName, target.name, value);
} else {
config.macros.formTiddler.displayFormTiddlerError("No getter defined for INPUT element of type '"+target.type+"'. (Element '"+target.name+"' used in tiddler '"+tiddlerName+"')");
}
}
// ensure that the function can be used in HTML event handler
window.onFormTiddlerChange = onFormTiddlerChange;
// -------------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// -------------------------------------------------------------------------------
setStylesheet(
".formTiddlerError{color: #ffffff;background-color: #880000;}",
"formTiddler");
//============================================================================
// checkForDataTiddlerPlugin Macro
//============================================================================
config.macros.checkForDataTiddlerPlugin = {
// Standard Properties
label: "checkForDataTiddlerPlugin",
version: {major: 1, minor: 0, revision: 0, date: new Date(2005, 12, 14)},
prompt: "Check if the DataTiddlerPlugin exists"
}
config.macros.checkForDataTiddlerPlugin.handler = function(place,macroName,params) {
config.macros.formTiddler.checkForExtensions(place, config.macros.formTiddler.label);
}
//============================================================================
// newTiddlerWithForm Macro
//============================================================================
config.macros.newTiddlerWithForm = {
// Standard Properties
label: "newTiddlerWithForm",
version: {major: 1, minor: 0, revision: 1, date: new Date(2006, 1, 6)},
prompt: "Creates a new Tiddler with a <<formTiddler ...>> macro"
}
config.macros.newTiddlerWithForm.handler = function(place,macroName,params) {
// --- Parsing ------------------------------------------
var i = 0; // index running over the params
// get the name of the form template tiddler
var formTemplateName = undefined;
if (i < params.length) {
formTemplateName = params[i];
i++;
}
if (!formTemplateName) {
config.macros.formTiddler.createErrorElement(place, "No form template specified in <<" + macroName + ">>.");
return;
}
// get the button label
var buttonLabel = undefined;
if (i < params.length) {
buttonLabel = params[i];
i++;
}
if (!buttonLabel) {
config.macros.formTiddler.createErrorElement(place, "No button label specified in <<" + macroName + ">>.");
return;
}
// get the (optional) tiddlerName script and "askUser"
var tiddlerNameScript = undefined;
var askUser = false;
if (i < params.length) {
tiddlerNameScript = params[i];
i++;
if (i < params.length && params[i] == "askUser") {
askUser = true;
i++;
}
}
// --- Processing ------------------------------------------
if(!readOnly) {
var onClick = function() {
var tiddlerName;
if (tiddlerNameScript) {
try {
tiddlerName = eval(tiddlerNameScript);
} catch (ex) {
}
}
if (!tiddlerName || askUser) {
tiddlerName = prompt("Please specify a tiddler name.", askUser ? tiddlerName : "");
}
while (tiddlerName && store.getTiddler(tiddlerName)) {
tiddlerName = prompt("A tiddler named '"+tiddlerName+"' already exists.\n\n"+"Please specify a tiddler name.", tiddlerName);
}
// tiddlerName is either null (user canceled) or a name that is not yet in the store.
if (tiddlerName) {
var body = "<<formTiddler [["+formTemplateName+"]]>>";
var tags = [];
store.saveTiddler(tiddlerName,tiddlerName,body,config.options.txtUserName,new Date(),tags);
story.displayTiddler(null,tiddlerName,1);
}
}
createTiddlyButton(place,buttonLabel,buttonLabel,onClick);
}
}
//}}}
/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005 ([[www.abego-software.de|http://www.abego-software.de]])
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/
/***
|Name|FramedLinksPlugin|
|Source|http://www.TiddlyTools.com/#FramedLinksPlugin|
|Version|1.1.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|createExternalLink|
|Options|##Configuration|
|Description|clicking an external link opens an IFRAME following the link instead of opening a new tab/window|
This plugin causes clicks on external links to be rendered into inline frames (~IFRAMEs) instead of opening them in new browser tabs/windows.
!!!!!Usage
<<<
Just place an external link into your tiddler content using standard TiddlyWiki syntax. When the {{{chkFramedLinks}}} checkbox is enabled or a tiddler is tagged with 'framedLinks' (see Configuration section, below), an IFRAME will be created dynamically whenever you click the external link. Clicking on the link again removes the IFRAME. You can hold down a modifier key (shift, control, or alt) while clicking a specific link to ''temporarily'' bypass the plugin-enhanced IFRAME handling and use the standard link handling behavior for that link.
<<<
!!!!!Configuration
<<<
<<option chkFramedLinks>> display inline frames for all external links
{{{usage: <<option chkFramedLinks>>}}}
<<option chkFramedLinksTag>> display inline frames for external links in tiddlers tagged with: <<option txtFramedLinksTag>>
{{{usage: <<option chkFramedLinksTag>> and <<option txtFramedLinksTag>>}}}
IFRAME size (CSS units: %, em, px, cm, in) - width: <<option txtFrameWidth>> height: <<option txtFrameHeight>>
{{{usage: <<option txtFrameWidth>> <<option txtFrameHeight>>}}}
<<<
!!!!!Examples
<<<
Try these links:
*http://www.TiddlyWiki.com
*http://www.TiddlyTools.com
*http://groups.google.com/group/TiddlyWiki/topics
<<<
!!!!!Revisions
<<<
2008.09.13 [1.1.0] added support to selectively enable embedded IFRAMEs if the containing tiddler is tagged with 'framedLinks'
2007.11.29 [1.0.5] added slider animation and improved CSS handling for IFRAME height/width to maximize display area
2007.11.29 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.FramedLinksPlugin= {major: 1, minor: 1, revision: 0, date: new Date(2008,9,13)};
var co=config.options; // abbreviation
if (co.chkFramedLinks==undefined) co.chkFramedLinks=false;
if (co.chkFramedLinksTag==undefined) co.chkFramedLinksTag=true;
if (co.txtFramedLinksTag==undefined) co.txtFramedLinksTag="framedLinks";
if (co.txtFrameWidth==undefined) co.txtFrameWidth="100%";
if (co.txtFrameHeight==undefined) co.txtFrameHeight="80%";
window.framedLinks_createExternalLink=createExternalLink;
window.createExternalLink=function(place,url)
{
var link=this.framedLinks_createExternalLink.apply(this,arguments);
link.onclick=function(ev) { var e=ev?ev:window.event;
var co=config.options; // abbreviation
var here=story.findContainingTiddler(this);
var enabled=co.chkFramedLinks || co.chkFramedLinksTag && here
&& store.getTiddler(here.getAttribute("tiddler")).isTagged(co.txtFramedLinksTag);
if (!enabled || e.ctrlKey || e.shiftKey || e.altKey) return; // BYPASS
var p=this.parentNode;
var f=this.nextSibling?this.nextSibling.firstChild:null; // get the IFRAME... maybe...
var w=co.txtFrameWidth; if (!w || !w.length) w="100%";
var h=co.txtFrameHeight; if (!h || !h.length) h="80%";
if (h.indexOf("%")) h=(findWindowHeight()*h.replace(/%/,"")/100)+"px"; // calc height as % of window
var showing=f && f.nodeName.toUpperCase()=="IFRAME"; // does IFRAME really exist?
var stretchCell=p.nodeName.toUpperCase()=="TD" && w.indexOf("%")!=-1 && w.replace(/%/,"")>=100;
if (!showing) { // create an iframe
link.style.display="block"; // force IFRAME onto line following link
if (stretchCell) { p.setAttribute("savedWidth",p.style.width); p.style.width="100%"; } // adjust TD so IFRAME stretches
var wrapper=createTiddlyElement(null,"span"); // wrapper for slider animation
wrapper.setAttribute("url",this.href); // for async loading of frame after animation completes
var f=createTiddlyElement(wrapper,"iframe"); // create IFRAME
f.style.backgroundColor="#fff"; f.style.width=w; f.style.height=h;
p.insertBefore(wrapper,this.nextSibling);
function loadURL(wrapper) { var f=wrapper.firstChild; var url=wrapper.getAttribute("url");
var d=f.contentDocument?f.contentDocument:(f.contentWindow?f.contentWindow.document:f.document);
d.open(); d.writeln("<html>connecting to "+url+"</html>"); d.close();
try { f.src=url; } // if the iframe can't handle the href
catch(e) { alert(e.description?e.description:e.toString()); } // ... then report the error
window.scrollTo(0,ensureVisible(wrapper));
}
if (!co.chkAnimate) loadURL(wrapper);
else {
var morph=new Slider(wrapper,true);
morph.callback=loadURL;
morph.properties.push({style: 'width', start: 0, end: 100, template: '%0%'});
anim.startAnimating(morph);
}
} else { // remove iframe
link.style.display="inline"; // restore link style
if (stretchCell) p.style.width=p.getAttribute("savedWidth"); // restore previous width of TD
if (!co.chkAnimate) p.removeChild(f.parentNode);
else {
var morph=new Slider(f.parentNode,false,false,"all");
morph.properties.push({style: 'width', start: 100, end: 0, template: '%0%'});
anim.startAnimating(morph);
}
}
e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); return false;
}
return link;
}
//}}}
/***
|Name|FullScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FullScreenPlugin|
|Version|1.1|
|Requires|~TW2.x|
!Description:
Toggle between viewing tiddlers fullscreen and normally. Very handy for when you need more viewing space.
!Demo:
Click the ↕ button in the toolbar for this tiddler. Click it again to turn off fullscreen.
!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Edit the ViewTemplate to add the fullscreen command to the toolbar.
!History:
*25-07-06: ver 1.1
*20-07-06: ver 1.0
!Code
***/
//{{{
var lewcidFullScreen = false;
config.commands.fullscreen =
{
text:" ↕ ",
tooltip:"Fullscreen mode"
};
config.commands.fullscreen.handler = function (event,src,title)
{
if (lewcidFullScreen == false)
{
lewcidFullScreen = true;
setStylesheet('#sidebar, .header, #mainMenu{display:none;} #displayArea{margin:0em 0 0 0 !important;}',"lewcidFullScreenStyle");
}
else
{
lewcidFullScreen = false;
setStylesheet(' ',"lewcidFullScreenStyle");
}
}
config.macros.fullscreen={};
config.macros.fullscreen.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
var label = params[0]||" ↕ ";
var tooltip = params[1]||"Fullscreen mode";
createTiddlyButton(place,label,tooltip,config.commands.fullscreen.handler);
}
var lewcid_fullscreen_closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler =function(title,animate,slowly)
{
lewcid_fullscreen_closeTiddler.apply(this,arguments);
if (story.isEmpty() && lewcidFullScreen == true)
config.commands.fullscreen.handler();
}
Slider.prototype.lewcidStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{
this.lewcidStop();
if (story.isEmpty() && lewcidFullScreen == true)
config.commands.fullscreen.handler();
}
//}}}
<<tagglyTagging GangOversigt>>
<<forEachTiddler where 'tiddler.tags.contains("Elev") && tiddler.fields["gang"]&& tiddler.fields["kl"] && tiddler.fields["gang"].contains(context.viewerTiddler.title)'
sortBy 'tiddler.fields["title"]'
write
'(index < 30)? "|"+(index+1)+"|[["+tiddler.title+"]] | "+tiddler.fields["kl"] +" | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | "+(tiddler.tags.contains("HU")?"Week √":"")+" | "+(tiddler.tags.contains("Hjem")?"Hjem √":"")+" | "+(tiddler.tags.contains("Syg")?"Syg √":"")+" |[img(3em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | "+tiddler.fields["værelse"]+" |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>| !Elever på <<tag GangOversigt gangen \>\> || | | ||h\n"
+"|!#| <<tag Elev Navn \>\> | KL | <<tag Lærere K-gr \>\> | <<tag HU Week\>\> | <<tag Hjem Hjemme\>\> |<<tag Syg \>\> || Værelse |h\n"'
end 'count+" stk elever på gangen\n"' none '"Ingen elever på gangen\n"'>>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'> </span><span macro='email to:"@himmerlands-ungdomsskole.dk" permalink:"true"'></span><span macro='snapshot print label:print prompt:Udskriv id:story'></span></div></div></div>
<div macro="hideWhenTaggedAny noTitle iframe GangOversigt">
<div class='title' macro='view title'></div>
</div>
<div class='viewer' macro='view text wikified'></div>
<div macro="showWhenTagged [[systemList]]">
<div class='viewer' macro="listByTag '' modified ''"></div>
</div>
<div class='tagClear'></div>
<span class macro='tiddler GangOversigtTabel'></span>
<div <span class='menubox' style='float:center;margin:0em' macro='notes heading:"NoteArkiv" tag:"NoteArkiv" suffix:"Note"'> </span></div>
<!--}}}-->
@@font-size:10pt;<script label="genopfrisk">
story.forEachTiddler(function(t,e)
{story.refreshTiddler(t,null,true)});
refreshDisplay();
return false;
</script>@@
/***
|Name|GotoPlugin|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Documentation|http://www.TiddlyTools.com/#GotoPluginInfo|
|Version|1.7.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|view any tiddler by entering it's title - displays list of possible matches|
''View a tiddler by typing its title and pressing //enter//.'' As you type, a list of possible matches is displayed. You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press //escape// to close the listbox to resume typing. When the listbox is ''//not//'' being displayed, press //escape// to clear the current text input and start over.
!!!!!Documentation
>see [[GotoPluginInfo]]
!!!!!Revisions
<<<
2008.10.16 [1.7.0] in macro handler(), changed to use //named// params instead of positional params, and added optional "filter:" param for tag filtering. Removed 'insert' handling (now provided by [[QuickEditPlugin]]).
|please see [[GotoPluginInfo]] for additional revision details|
2006.05.05 [0.0.0] started
<<<
!!!!!Code
***/
//{{{
version.extensions.GotoPlugin= {major: 1, minor: 7, revision: 0, date: new Date(2008,10,16)};
// automatically tweak shadow SideBarOptions to add <<gotoTiddler>> macro above <<search>>
config.shadowTiddlers.SideBarOptions=config.shadowTiddlers.SideBarOptions.replace(/<<search>>/,"{{button{goto}}}\n<<gotoTiddler>><<search>>");
config.macros.gotoTiddler= {
listMaxSize: 10,
listHeading: 'Found %0 matching title%1...',
searchItem: "Search for '%0'...",
handler:
function(place,macroName,params,wikifier,paramString,tiddler) {
var quiet =params.contains("quiet");
var search =params.contains("search");
params = paramString.parseParams("anon",null,true,false,false);
var instyle =getParam(params,"inputstyle","");
var liststyle =getParam(params,"liststyle","");
var filter =getParam(params,"filter","");
var html=this.html;
var keyevent=window.event?"onkeydown":"onkeypress"; // IE event fixup for ESC handling
html=html.replace(/%keyevent%/g,keyevent);
html=html.replace(/%search%/g,search);
html=html.replace(/%quiet%/g,quiet);
html=html.replace(/%instyle%/g,instyle);
html=html.replace(/%liststyle%/g,liststyle);
html=html.replace(/%filter%/g,filter);
if (config.browser.isIE) html=this.IEtableFixup.format([html]);
createTiddlyElement(place,"span").innerHTML=html;
},
html:
'<form onsubmit="return false" style="display:inline;margin:0;padding:0">\
<input name=gotoTiddler type=text autocomplete="off" accesskey="G" style="%instyle%"\
title="enter a tiddler title"\
onclick="this.form.list.style.display=\'none\';"\
onfocus="this.select(); this.setAttribute(\'accesskey\',\'G\');"\
%keyevent%="return config.macros.gotoTiddler.inputEscKeyHandler(event,this,this.form.list);"\
onkeyup="return config.macros.gotoTiddler.inputKeyHandler(event,this,%quiet%,%search%);">\
<select name=list style="%liststyle%;display:none;position:absolute"\
onchange="if (!this.selectedIndex) this.selectedIndex=1;"\
onblur="this.style.display=\'none\';"\
%keyevent%="return config.macros.gotoTiddler.selectKeyHandler(event,this,this.form.gotoTiddler);"\
onclick="return config.macros.gotoTiddler.processItem(this.value,this.form.gotoTiddler,this);">\
</select><input name="filter" type="hidden" value="%filter%">\
</form>',
IEtableFixup:
"<table style='width:100%;display:inline;padding:0;margin:0;border:0;'>\
<tr style='padding:0;margin:0;border:0;'><td style='padding:0;margin:0;border:0;'>\
%0</td></tr></table>",
getItems:
function(val,filter) {
if (!this.items.length || val.length<2) { // starting new search, refresh cached list of tiddlers/shadows/tags
this.items=new Array();
if (filter.length) {
var fn=store.getMatchingTiddlers||store.getTaggedTiddlers;
var tiddlers=store.sortTiddlers(fn.apply(store,[filter]),'title');
} else
var tiddlers=store.getTiddlers("title","excludeLists");
for(var t=0; t<tiddlers.length; t++) this.items.push(tiddlers[t].title);
if (!filter.length) {
for (var t in config.shadowTiddlers) this.items.pushUnique(t);
var tags=store.getTags();
for(var t=0; t<tags.length; t++) this.items.pushUnique(tags[t][0]);
}
}
var found = [];
var match=val.toLowerCase();
for(var i=0; i<this.items.length; i++)
if (this.items[i].toLowerCase().indexOf(match)!=-1) found.push(this.items[i]);
return found;
},
items: [], // cached list of tiddlers/shadows/tags
getItemSuffix:
function(t) {
if (store.tiddlerExists(t)) return ""; // tiddler
if (store.isShadowTiddler(t)) return " (shadow)"; // shadow
return " (tag)"; // tag
},
keyProcessed:
function(ev) { // utility function: exits handler and prevents browser from processing the keystroke
ev.cancelBubble=true; // IE4+
try{event.keyCode=0;}catch(e){}; // IE5
if (window.event) ev.returnValue=false; // IE6
if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
if (ev.stopPropagation) ev.stopPropagation(); // all
return false;
},
inputEscKeyHandler:
function(event,here,list) {
var key=event.keyCode;
// escape... hide list (2nd esc=clears input)
if (key==27) {
if (list.style.display=="none")
here.value=here.defaultValue;
list.style.display="none";
return this.keyProcessed(event);
}
return true; // key bubbles up
},
inputKeyHandler:
function(event,here,quiet,search) {
var key=event.keyCode;
var list=here.form.list;
var filter=here.form.filter;
// non-printing chars... bubble up, except: backspace=8, enter=13, space=32, down=40, delete=46
if (key<48) switch(key) { case 8: case 13: case 32: case 40: case 46: break; default: return true; }
// blank input... if down/enter... fall through (list all)... else, and hide list
if (!here.value.length && !(key==40 || key==13)) { list.style.display="none"; return this.keyProcessed(event); }
// make sure list is shown (unless quiet option)
list.style.display=!quiet?"block":"none";
// non-blank input... enter key... show/create tiddler
if (key==13) return this.processItem(here.value,here,list);
// down key... shows/moves to list...
if (key==40) { list.style.display="block"; list.focus(); }
// if list is showing, fill it with found results...
if (list.style.display!="none") {
var indent='\xa0\xa0\xa0';
var found = this.getItems(here.value,filter.value); // find matching items...
found.sort(); // alpha by title
while (list.length > 0) list.options[0]=null; // clear list
var hdr=this.listHeading.format([found.length,found.length==1?"":"s"]);
list.options[0]=new Option(hdr,"",false,false);
for (var t=0; t<found.length; t++) list.options[list.length]=
new Option(indent+found[t]+this.getItemSuffix(found[t]),found[t],false,false);
if (search)
list.options[list.length]=new Option(this.searchItem.format([here.value]),"*",false,false);
list.size=(list.length<this.listMaxSize?list.length:this.listMaxSize); // resize list...
list.selectedIndex=(key==40 || key==13)?1:0;
}
return true; // key bubbles up
},
selectKeyHandler:
function(event,list,editfield) {
if (event.keyCode==27) // escape... hide list, move to edit field
{ editfield.focus(); list.style.display="none"; return this.keyProcessed(event); }
if (event.keyCode==13 && list.value.length) // enter... view selected item
{ this.processItem(list.value,editfield,list); return this.keyProcessed(event); }
return true; // key bubbles up
},
processItem:
function(title,here,list) {
if (!title.length) return;
list.style.display='none';
if (title=="*") { story.search(here.value); return false; } // do full-text search
here.value=title;
story.displayTiddler(null,title); // show selected tiddler
return false;
}
}
//}}}
.tabSelected {
padding: 1px;
cursor: default;
color: #700;
background-color: #000;
border-left:0px solid #000;
border-top:0px solid #000;
border-right:0px solid #000;
font-size:.95em;
font-weight:bold;
padding: 2px 4px;
}
.viewer .tabSelected {
padding: 1px;
cursor: default;
color: #700;
background-color: #000;
border-left:0px solid #000;
border-top:0px solid #000;
border-right:0px solid #000;
font-size:.95em;
font-weight:bold;
padding: 2px 4px;
}
.tabUnselected {
padding: 1px;
color: #070;
background-color: #666;
font-size:.95em;
padding: 2px 4px;
}
.viewer .tabUnselected {
padding: 1px;
color: #070;
background-color: #666;
font-size:.95em;font-weight:bold;
padding: 2px 4px;
}
Du kan:
#Ændre titelen ved at klikke på [[SideTitel|SiteTitle]] og skriv en ny titel.
#Ændre eller fjerne undertitlen ved at klikke på [[UnderTitel|SiteSubtitle]] og gør hvad du vil med den.
#Bestemme hvad der viser sig når du åbner Simple Noter ved at åbne DefaultTiddlers og udskifte {{{[[Instruktioner]]}}} med en notetitel omkranset af dobblete firkantede paranteser.
#Når du er sikker på at du ikke længere har brug for dem, kan du slette [[Eksempel emne]], [[Eksempel underemne]] og [[Eksempel note]], [[Avanceret tilpasning]], og denne note, [[Grundlæggende tilpasning]].
/***
|Name|HTMLFormattingPlugin|
|Source|http://www.TiddlyTools.com/#HTMLFormattingPlugin|
|Documentation|http://www.TiddlyTools.com/#HTMLFormattingPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|'HTML' formatter|
|Description|embed wiki syntax formatting inside of HTML content|
The ~HTMLFormatting plugin allows you to ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.
!!!!!Documentation
>see [[HTMLFormattingPluginInfo]]
!!!!!Revisions
<<<
2009.01.05 [2.4.0] in wikifyTextNodes(), pass w.highlightRegExp and w.tiddler to wikify() so that search term highlighting and tiddler-relative macro processing will work
| see [[HTMLFormattingPluginInfo]] for additional revision details |
2005.06.26 [1.0.0] Initial Release (as code adaptation - pre-dates TiddlyWiki plugin architecture!!)
<<<
!!!!!Code
***/
//{{{
version.extensions.HTMLFormattingPlugin= {major: 2, minor: 4, revision: 0, date: new Date(2009,1,5)};
// find the formatter for HTML and replace the handler
initHTMLFormatter();
function initHTMLFormatter()
{
for (var i=0; i<config.formatters.length && config.formatters[i].name!="html"; i++);
if (i<config.formatters.length) config.formatters[i].handler=function(w) {
if (!this.lookaheadRegExp) // fixup for TW2.0.x
this.lookaheadRegExp = new RegExp(this.lookahead,"mg");
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var html=lookaheadMatch[1];
// if <nowiki> is present, just let browser handle it!
if (html.indexOf('<nowiki>')!=-1)
createTiddlyElement(w.output,"span").innerHTML=html;
else {
// if <hide linebreaks> is present, suppress wiki-style literal handling of newlines
if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(/\n/g,' ');
// remove all \r's added by IE textarea and mask newlines and macro brackets
html=html.replace(/\r/g,'').replace(/\n/g,'\\n').replace(/<</g,'%%(').replace(/>>/g,')%%');
// create span, let browser parse HTML
var e=createTiddlyElement(w.output,"span"); e.innerHTML=html;
// then re-render text nodes as wiki-formatted content
wikifyTextNodes(e,w);
}
w.nextMatch = this.lookaheadRegExp.lastIndex; // continue parsing
}
}
}
// wikify #text nodes that remain after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode,w)
{
function unmask(s) { return s.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(/\\n/g,'\n'); }
switch (theNode.nodeName.toLowerCase()) {
case 'style': case 'option': case 'select':
theNode.innerHTML=unmask(theNode.innerHTML);
break;
case 'textarea':
theNode.value=unmask(theNode.value);
break;
case '#text':
var txt=unmask(theNode.nodeValue);
var newNode=createTiddlyElement(null,"span");
theNode.parentNode.replaceChild(newNode,theNode);
wikify(txt,newNode,highlightHack,w.tiddler);
break;
default:
for (var i=0;i<theNode.childNodes.length;i++)
wikifyTextNodes(theNode.childNodes.item(i),w); // recursion
break;
}
}
//}}}
/***
|Name:|HideWhenPlugin|
|Description:|Allows conditional inclusion/exclusion in templates|
|Version:|3.1 ($Rev: 3919 $)|
|Date:|$Date: 2008-03-13 02:03:12 +1000 (Thu, 13 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#HideWhenPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
For use in ViewTemplate and EditTemplate. Example usage:
{{{<div macro="showWhenTagged Task">[[TaskToolbar]]</div>}}}
{{{<div macro="showWhen tiddler.modifier == 'BartSimpson'"><img src="bart.gif"/></div>}}}
***/
//{{{
window.hideWhenLastTest = false;
window.removeElementWhen = function(test,place) {
window.hideWhenLastTest = test;
if (test) {
removeChildren(place);
place.parentNode.removeChild(place);
}
};
merge(config.macros,{
hideWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( eval(paramString), place);
}},
showWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !eval(paramString), place);
}},
hideWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.tags.containsAll(params), place);
}},
showWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !tiddler.tags.containsAll(params), place);
}},
hideWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.tags.containsAny(params), place);
}},
showWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !tiddler.tags.containsAny(params), place);
}},
hideWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.tags.containsAll(params), place);
}},
showWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !tiddler.tags.containsAll(params), place);
}},
hideWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0]), place);
}},
showWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !(store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0])), place);
}},
hideWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.title == params[0], place);
}},
showWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.title != params[0], place);
}},
'else': { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !window.hideWhenLastTest, place);
}}
});
//}}}
<html><a href="javascript:void(0)" onclick="story.closeAllTiddlers();story.displayTiddlers(null,store.filterTiddlers(store.getTiddlerText('DefaultTiddlers'))) "
><span title="Luk alle tiddlere og åben velkomstsiden" style="cursor:pointer">''Hjem''</span></a></li></html>
<<forEachTiddler
where
'tiddler.tags.contains("Elev")&& tiddler.fields["hjem"]=="true" '
sortBy 'tiddler.title.toUpperCase()'
script
'
function getFirstLine(s) {
var m = s.match(/\s*(.*)/);
return m != null && m.length >= 1 ? m[1] : "";
}
'
write
'(index < 100) ? "| !"+(index+1)+" |[["+tiddler.title+"]] | <<tag [["+tiddler.fields["k-gruppe"]+"]] \>\> | <<tag [["+tiddler.fields["gang"]+"]] \>\> | [img(2em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | [["+tiddler.fields["vaerelse"]+"]] | <<editTiddler [["+tiddler.title+"]]$)) |@@color(#cc0000):→~~//"+getFirstLine(tiddler.text)+"//~~@@ |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>| @@padding-left: 20px;[[Hjemme]]@@@@padding-left: 20px; <<tiddler [[ResetHjem]] \>\>@@ |>|>| <<snapshot print label:print prompt:Udskriv id:viewer \>\>|h\n"
+"|!#| <<tag Elev \>\> | <<tag Lærere K-gruppe \>\> | <<tag GangOversigt Gang \>\> | <<tag Syg Syge \>\> | <<tag Værelser \>\> | <<tag HU Weekend \>\> | Meddelelser |h\n"'
end 'count+" elever hjemme\n"'
none '"Ingen elever hjemme\n"'
>>
!<<siteMap {{tiddler.title}} . sliders>>
Dit brugernavn til signering af dine redigeringer.
Skriv som et WikiOrd (f.eks. JensHansen)
<<option txtUserName>>
<script>
var out=[]; var who='';
var tids=store.getTiddlers('modifier');
for (i=0; i<tids.length; i++) { var t=tids[i];
if (who!=t.modifier) {
who=t.modifier;
out.push('by '+who+':');
}
out.push('*[['+t.title+']]');
}
return out.join('\n');
</script>
/***
|Name|ImageSizePlugin|
|Source|http://www.TiddlyTools.com/#ImageSizePlugin|
|Version|1.2.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin,formatter|
|Requires||
|Overrides|'image' formatter|
|Description|adds support for resizing images|
This plugin adds optional syntax to scale an image to a specified width and height and/or interactively resize the image with the mouse.
!!!!!Usage
<<<
The extended image syntax is:
{{{
[img(w+,h+)[...][...]]
}}}
where ''(w,h)'' indicates the desired width and height (in CSS units, e.g., px, em, cm, in, or %). Use ''auto'' (or a blank value) for either dimension to scale that dimension proportionally (i.e., maintain the aspect ratio). You can also calculate a CSS value 'on-the-fly' by using a //javascript expression// enclosed between """{{""" and """}}""". Appending a plus sign (+) to a dimension enables interactive resizing in that dimension (by dragging the mouse inside the image). Use ~SHIFT-click to show the full-sized (un-scaled) image. Use ~CTRL-click to restore the starting size (either scaled or full-sized).
<<<
!!!!!Examples
<<<
{{{
[img(100px+,75px+)[images/meow2.jpg]]
}}}
[img(100px+,75px+)[images/meow2.jpg]]
{{{
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img( 1%+,+)[images/meow.gif]]
}}}
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img( 1%+,+)[images/meow.gif]]
{{tagClear{
}}}
<<<
!!!!!Revisions
<<<
2009.02.24 [1.2.1] cleanup width/height regexp, use '+' suffix for resizing
2009.02.22 [1.2.0] added stretchable images
2008.01.19 [1.1.0] added evaluated width/height values
2008.01.18 [1.0.1] regexp for "(width,height)" now passes all CSS values to browser for validation
2008.01.17 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageSizePlugin= {major: 1, minor: 2, revision: 1, date: new Date(2009,2,24)};
//}}}
//{{{
var f=config.formatters[config.formatters.findByField("name","image")];
f.match="\\[[<>]?[Ii][Mm][Gg](?:\\([^,]*,[^\\)]*\\))?\\[";
f.lookaheadRegExp=/\[([<]?)(>?)[Ii][Mm][Gg](?:\(([^,]*),([^\)]*)\))?\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg;
f.handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var floatLeft=lookaheadMatch[1];
var floatRight=lookaheadMatch[2];
var width=lookaheadMatch[3];
var height=lookaheadMatch[4];
var tooltip=lookaheadMatch[5];
var src=lookaheadMatch[6];
var link=lookaheadMatch[7];
// Simple bracketted link
var e = w.output;
if(link) { // LINKED IMAGE
if (config.formatterHelpers.isExternalLink(link)) {
if (config.macros.attach && config.macros.attach.isAttachment(link)) {
// see [[AttachFilePluginFormatters]]
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title = config.macros.attach.linkTooltip + link;
} else
e = createExternalLink(w.output,link);
} else
e = createTiddlyLink(w.output,link,false,null,w.isStatic);
addClass(e,"imageLink");
}
var img = createTiddlyElement(e,"img");
if(floatLeft) img.align="left"; else if(floatRight) img.align="right";
if(width||height) {
var x=width.trim(); var y=height.trim();
var stretchW=(x.substr(x.length-1,1)=='+'); if (stretchW) x=x.substr(0,x.length-1);
var stretchH=(y.substr(y.length-1,1)=='+'); if (stretchH) y=y.substr(0,y.length-1);
if (x.substr(0,2)=="{{")
{ try{x=eval(x.substr(2,x.length-4))} catch(e){displayMessage(e.description||e.toString())} }
if (y.substr(0,2)=="{{")
{ try{y=eval(y.substr(2,y.length-4))} catch(e){displayMessage(e.description||e.toString())} }
img.style.width=x.trim(); img.style.height=y.trim();
config.formatterHelpers.addStretchHandlers(img,stretchW,stretchH);
}
if(tooltip) img.title = tooltip;
// GET IMAGE SOURCE
if (config.macros.attach && config.macros.attach.isAttachment(src))
src=config.macros.attach.getAttachment(src); // see [[AttachFilePluginFormatters]]
else if (config.formatterHelpers.resolvePath) { // see [[ImagePathPlugin]]
if (config.browser.isIE || config.browser.isSafari) {
img.onerror=(function(){
this.src=config.formatterHelpers.resolvePath(this.src,false);
return false;
});
} else
src=config.formatterHelpers.resolvePath(src,true);
}
img.src=src;
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
config.formatterHelpers.addStretchHandlers=function(e,stretchW,stretchH) {
e.title=((stretchW||stretchH)?'DRAG=stretch/shrink, ':'')
+'SHIFT-CLICK=show full size, CTRL-CLICK=restore initial size';
e.statusMsg='width=%0, height=%1';
e.style.cursor='move';
e.originalW=e.style.width;
e.originalH=e.style.height;
e.minW=Math.max(e.offsetWidth/20,10);
e.minH=Math.max(e.offsetHeight/20,10);
e.stretchW=stretchW;
e.stretchH=stretchH;
e.onmousedown=function(ev) { var ev=ev||window.event;
this.sizing=true;
this.startX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
this.startY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
this.startW=this.offsetWidth;
this.startH=this.offsetHeight;
return false;
};
e.onmousemove=function(ev) { var ev=ev||window.event;
if (this.sizing) {
var s=this.style;
var currX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
var currY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
var newW=(currX-this.offsetLeft)/(this.startX-this.offsetLeft)*this.startW;
var newH=(currY-this.offsetTop )/(this.startY-this.offsetTop )*this.startH;
if (this.stretchW) s.width =Math.floor(Math.max(newW,this.minW))+'px';
if (this.stretchH) s.height=Math.floor(Math.max(newH,this.minH))+'px';
clearMessage(); displayMessage(this.statusMsg.format([s.width,s.height]));
}
return false;
};
e.onmouseup=function(ev) { var ev=ev||window.event;
if (ev.shiftKey) { this.style.width=this.style.height=''; }
if (ev.ctrlKey) { this.style.width=this.originalW; this.style.height=this.originalH; }
this.sizing=false;
clearMessage();
return false;
};
e.onmouseout=function(ev) { var ev=ev||window.event;
this.sizing=false;
clearMessage();
return false;
};
}
//}}}
On 9. juni 2009 10:36:56, DitNavn imported 1 tiddler from
[[http://måns.dk/weekend|http://måns.dk/weekend]]:
<<<
#[[St]] - added
#[[Syd]] - skipped after asking
<<<
----
On 9. juni 2009 10:26:17, DitNavn imported 144 tiddlers from
[[http://måns.dk/weekend|http://måns.dk/weekend]]:
<<<
#[[Alex Petersen]] - replaces Alex Petersen - 6/9/2009 09:17:00 by DitNavn
#[[Alice Asp]] - replaces Alice Asp - 6/9/2009 09:17:00 by DitNavn
#[[Allan Bo Jensen]] - replaces Allan Bo Jensen - 6/9/2009 09:17:00 by DitNavn
#[[Anders Agerlund]] - replaces Anders Agerlund - 6/9/2009 09:17:00 by DitNavn
#[[Anders Rahbek Hansen]] - replaces Anders Rahbek Hansen - 6/9/2009 09:17:00 by DitNavn
#[[Anders Roskjær Olesen]] - replaces Anders Roskjær Olesen - 6/9/2009 09:17:00 by DitNavn
#[[Andreas Hyttel Schrøder]] - replaces Andreas Hyttel Schrøder - 6/9/2009 09:17:00 by DitNavn
#[[Andreas Voigt-Larsen]] - replaces Andreas Voigt-Larsen - 6/9/2009 09:18:00 by DitNavn
#[[Anna Agger Rasmussen]] - replaces Anna Agger Rasmussen - 6/9/2009 09:18:00 by DitNavn
#[[Anna Gjesing]] - replaces Anna Gjesing - 6/9/2009 09:18:00 by DitNavn
#[[Anne Bach Sørensen]] - replaces Anne Bach Sørensen - 6/9/2009 09:18:00 by DitNavn
#[[Anne Borup Hejlesen]] - replaces Anne Borup Hejlesen - 6/9/2009 09:18:00 by DitNavn
#[[Anne Eline Rolighed Iversen]] - replaces Anne Eline Rolighed Iversen - 6/9/2009 09:18:00 by DitNavn
#[[Anne Fogh Rasmussen]] - replaces Anne Fogh Rasmussen - 6/9/2009 09:19:00 by DitNavn
#[[Anne Katrine Boserup]] - replaces Anne Katrine Boserup - 6/9/2009 09:19:00 by DitNavn
#[[Anne Pedersen]] - replaces Anne Pedersen - 6/9/2009 09:19:00 by DitNavn
#[[Anne Sofie Palm Hansen]] - replaces Anne Sofie Palm Hansen - 6/9/2009 09:19:00 by DitNavn
#[[Astrid Birgitte Lund]] - replaces Astrid Birgitte Lund - 6/9/2009 09:19:00 by DitNavn
#[[Aviaaja Malle Hansen]] - replaces Aviaaja Malle Hansen - 6/9/2009 09:19:00 by DitNavn
#[[Boanna Stig Frølund]] - replaces Boanna Stig Frølund - 6/9/2009 09:19:00 by DitNavn
#[[Camilla Graff]] - replaces Camilla Graff - 6/9/2009 09:19:00 by DitNavn
#[[Camilla Vigel Olsen]] - replaces Camilla Vigel Olsen - 6/9/2009 09:19:00 by DitNavn
#[[Cathrine Bjørndal Tornlund Nielsen]] - replaces Cathrine Bjørndal Tornlund Nielsen - 6/9/2009 09:20:00 by DitNavn
#[[Cecilia Borup Kristensen]] - replaces Cecilia Borup Kristensen - 6/9/2009 09:20:00 by DitNavn
#[[Cecilie Andersen]] - replaces Cecilie Andersen - 6/9/2009 09:20:00 by DitNavn
#[[Cecilie Bæk Nielsen]] - replaces Cecilie Bæk Nielsen - 6/9/2009 09:20:00 by DitNavn
#[[Cecilie Claumarch]] - replaces Cecilie Claumarch - 6/9/2009 09:20:00 by DitNavn
#[[Cecilie Kalstrup]] - replaces Cecilie Kalstrup - 6/9/2009 09:20:00 by DitNavn
#[[Cecilie Stamhus]] - replaces Cecilie Stamhus - 6/9/2009 09:20:00 by DitNavn
#[[Charlotte Alber Kjeldsen]] - replaces Charlotte Alber Kjeldsen - 6/9/2009 09:20:00 by DitNavn
#[[Charlotte Maria O. Schmidt]] - replaces Charlotte Maria O. Schmidt - 6/9/2009 09:21:00 by DitNavn
#[[Christian Asp]] - replaces Christian Asp - 6/9/2009 09:21:00 by DitNavn
#[[Christian Sørensen]] - replaces Christian Sørensen - 6/9/2009 09:21:00 by DitNavn
#[[Christoffer Bønsdorff Munkholm]] - replaces Christoffer Bønsdorff Munkholm - 6/9/2009 09:21:00 by DitNavn
#[[Coco Christensen]] - replaces Coco Christensen - 6/9/2009 09:21:00 by DitNavn
#[[Cæcilie Sloth Vesterby]] - replaces Cæcilie Sloth Vesterby - 6/9/2009 09:21:00 by DitNavn
#[[Dennis Fogth Pedersen]] - replaces Dennis Fogth Pedersen - 6/9/2009 09:22:00 by DitNavn
#[[Diana Møllebjerg]] - replaces Diana Møllebjerg - 6/9/2009 09:22:00 by DitNavn
#[[Ditte Skov Høglund]] - replaces Ditte Skov Høglund - 6/9/2009 09:22:00 by DitNavn
#[[Ea Sørensen]] - replaces Ea Sørensen - 6/9/2009 09:22:00 by DitNavn
#[[Eline Kvorning Sørensen]] - replaces Eline Kvorning Sørensen - 6/9/2009 09:22:00 by DitNavn
#[[Ellen Øvig Jørgensen]] - replaces Ellen Øvig Jørgensen - 6/9/2009 09:22:00 by DitNavn
#[[Emma Moesgaard]] - replaces Emma Moesgaard - 6/9/2009 09:23:00 by DitNavn
#[[Finn Khunplad Gerlach]] - replaces Finn Khunplad Gerlach - 6/9/2009 09:23:00 by DitNavn
#[[Heidi Holmeå Christiansen]] - replaces Heidi Holmeå Christiansen - 6/9/2009 09:23:00 by DitNavn
#[[Helena Thougaard Petersen]] - replaces Helena Thougaard Petersen - 6/9/2009 09:24:00 by DitNavn
#[[Henriette Skjødt Jakobsen]] - replaces Henriette Skjødt Jakobsen - 6/9/2009 09:24:00 by DitNavn
#[[Ida Maria Schmücker]] - replaces Ida Maria Schmücker - 6/9/2009 09:24:00 by DitNavn
#[[Ida Mølgaard]] - replaces Ida Mølgaard - 6/9/2009 09:24:00 by DitNavn
#[[Ingrid Nymo Møller]] - replaces Ingrid Nymo Møller - 6/9/2009 09:24:00 by DitNavn
#[[Jacob Lund Sørensen]] - replaces Jacob Lund Sørensen - 6/9/2009 09:25:00 by DitNavn
#[[Jacob Thordal-Christensen]] - replaces Jacob Thordal-Christensen - 6/9/2009 09:25:00 by DitNavn
#[[Jacob Wind]] - replaces Jacob Wind - 6/9/2009 09:25:00 by DitNavn
#[[Jannek Alexander Westerhof Bossen]] - replaces Jannek Alexander Westerhof Bossen - 6/9/2009 09:25:00 by DitNavn
#[[Janni Enghave Andersen]] - replaces Janni Enghave Andersen - 6/9/2009 09:26:00 by DitNavn
#[[Janni Kjær Hansen]] - replaces Janni Kjær Hansen - 6/9/2009 09:26:00 by DitNavn
#[[Jeanette Bach Andreasen]] - replaces Jeanette Bach Andreasen - 6/9/2009 09:26:00 by DitNavn
#[[Jens Asbøl Pedersen]] - replaces Jens Asbøl Pedersen - 6/9/2009 09:26:00 by DitNavn
#[[Jeppe Bech Albrektsen]] - replaces Jeppe Bech Albrektsen - 6/9/2009 09:26:00 by DitNavn
#[[Jeppe Dürr Sørensen]] - replaces Jeppe Dürr Sørensen - 6/9/2009 09:27:00 by DitNavn
#[[Jeppe Kroghøj Hyldgård]] - replaces Jeppe Kroghøj Hyldgård - 6/9/2009 09:27:00 by DitNavn
#[[Jesper Lyngby Andersen]] - replaces Jesper Lyngby Andersen - 6/9/2009 09:27:00 by DitNavn
#[[Johan Sondrup Pedersen]] - replaces Johan Sondrup Pedersen - 6/9/2009 09:27:00 by DitNavn
#[[Jonathan Wigh Simonsen]] - replaces Jonathan Wigh Simonsen - 6/9/2009 09:27:00 by DitNavn
#[[Kasper Hasselkvist]] - replaces Kasper Hasselkvist - 6/9/2009 09:28:00 by DitNavn
#[[Kathrine Friis Goul]] - replaces Kathrine Friis Goul - 6/9/2009 09:28:00 by DitNavn
#[[Kathrine Østergaard Petersen]] - replaces Kathrine Østergaard Petersen - 6/9/2009 09:28:00 by DitNavn
#[[Katja Catharina Slej Severinsen]] - replaces Katja Catharina Slej Severinsen - 6/9/2009 09:28:00 by DitNavn
#[[Kirstine Christensen]] - replaces Kirstine Christensen - 6/9/2009 09:29:00 by DitNavn
#[[Kirstine Salomonsen]] - replaces Kirstine Salomonsen - 6/9/2009 09:29:00 by DitNavn
#[[Kit Engedal Kristensen]] - replaces Kit Engedal Kristensen - 6/9/2009 09:29:00 by DitNavn
#[[Kristina Blockx]] - replaces Kristina Blockx - 6/9/2009 09:29:00 by DitNavn
#[[Lau Rødbro Johannsen]] - replaces Lau Rødbro Johannsen - 6/9/2009 09:29:00 by DitNavn
#[[Lauge Korsholm]] - replaces Lauge Korsholm - 6/9/2009 09:29:00 by DitNavn
#[[Laura Pagter]] - replaces Laura Pagter - 6/9/2009 09:30:00 by DitNavn
#[[Lena Reinholdt]] - replaces Lena Reinholdt - 6/9/2009 09:30:00 by DitNavn
#[[Linda Madsen]] - replaces Linda Madsen - 6/9/2009 09:30:00 by DitNavn
#[[Line Carøe]] - replaces Line Carøe - 6/9/2009 09:30:00 by DitNavn
#[[Line Domino]] - replaces Line Domino - 6/9/2009 09:30:00 by DitNavn
#[[Line Frellsen]] - replaces Line Frellsen - 6/9/2009 09:30:00 by DitNavn
#[[Linea Valentin Haderslev]] - replaces Linea Valentin Haderslev - 6/9/2009 09:31:00 by DitNavn
#[[Lisa Rydahl Bøystrup]] - replaces Lisa Rydahl Bøystrup - 6/9/2009 09:31:00 by DitNavn
#[[Lise Margrethe Ditlev Pedersen]] - replaces Lise Margrethe Ditlev Pedersen - 6/9/2009 09:31:00 by DitNavn
#[[Louise Bundgaard]] - replaces Louise Bundgaard - 6/9/2009 09:31:00 by DitNavn
#[[Louise H. Jensen]] - replaces Louise H. Jensen - 6/9/2009 09:31:00 by DitNavn
#[[Louise Marie Sørensen]] - replaces Louise Marie Sørensen - 6/9/2009 09:32:00 by DitNavn
#[[Mads Boye Brogaard Hansen]] - replaces Mads Boye Brogaard Hansen - 6/9/2009 09:32:00 by DitNavn
#[[Mads Nørskov]] - replaces Mads Nørskov - 6/9/2009 09:32:00 by DitNavn
#[[Maj Højriis Kristensen]] - replaces Maj Højriis Kristensen - 6/9/2009 09:32:00 by DitNavn
#[[Maja Pindstrup]] - replaces Maja Pindstrup - 6/9/2009 09:32:00 by DitNavn
#[[Malene Klokkerholm Møller]] - replaces Malene Klokkerholm Møller - 6/9/2009 09:32:00 by DitNavn
#[[Marcus Borum Holm]] - replaces Marcus Borum Holm - 6/9/2009 09:33:00 by DitNavn
#[[Maria Nielsen]] - replaces Maria Nielsen - 6/9/2009 09:33:00 by DitNavn
#[[Maria Vieland Andersen]] - replaces Maria Vieland Andersen - 6/9/2009 09:33:00 by DitNavn
#[[Martin Garenfeld]] - replaces Martin Garenfeld - 6/9/2009 09:33:00 by DitNavn
#[[Martin Kaae Riis]] - replaces Martin Kaae Riis - 6/9/2009 09:33:00 by DitNavn
#[[Mathias Bülow Kastbjerg]] - replaces Mathias Bülow Kastbjerg - 6/9/2009 09:33:00 by DitNavn
#[[Mathias Damgaard-Iversen]] - replaces Mathias Damgaard-Iversen - 6/9/2009 09:34:00 by DitNavn
#[[Matias Holch Christensen]] - replaces Matias Holch Christensen - 6/9/2009 09:37:00 by DitNavn
#[[Mette Bjerring]] - replaces Mette Bjerring - 6/9/2009 09:38:00 by DitNavn
#[[Mette Hartmann]] - replaces Mette Hartmann - 6/9/2009 09:38:00 by DitNavn
#[[Mette Ravnmose Kristensen]] - replaces Mette Ravnmose Kristensen - 6/9/2009 09:38:00 by DitNavn
#[[Mette Zaar Gregersen]] - replaces Mette Zaar Gregersen - 6/9/2009 09:38:00 by DitNavn
#[[Mia Stefan Kamper]] - replaces Mia Stefan Kamper - 6/9/2009 09:39:00 by DitNavn
#[[Michael Bundgaard Knudsen]] - replaces Michael Bundgaard Knudsen - 6/9/2009 09:39:00 by DitNavn
#[[Mie Møller Frederiksen]] - replaces Mie Møller Frederiksen - 6/9/2009 09:39:00 by DitNavn
#[[Mikkel Baastrup Hovgaard]] - replaces Mikkel Baastrup Hovgaard - 6/9/2009 09:39:00 by DitNavn
#[[Mikkel Dahlstrøm]] - replaces Mikkel Dahlstrøm - 6/9/2009 09:39:00 by DitNavn
#[[Mikkel Maagaard Nielsen]] - replaces Mikkel Maagaard Nielsen - 6/9/2009 09:39:00 by DitNavn
#[[Mikkel Riiskjær Johannsen]] - replaces Mikkel Riiskjær Johannsen - 6/9/2009 09:40:00 by DitNavn
#[[Mikkel Thorhauge Jensen]] - replaces Mikkel Thorhauge Jensen - 6/9/2009 09:40:00 by DitNavn
#[[Morten Paamejer Kristoffersen]] - replaces Morten Paamejer Kristoffersen - 6/9/2009 09:40:00 by DitNavn
#[[Nanna Loumand Faddersbøll]] - replaces Nanna Loumand Faddersbøll - 6/9/2009 09:40:00 by DitNavn
#[[Nicholaj Hejsel Vejlgaard]] - replaces Nicholaj Hejsel Vejlgaard - 6/9/2009 09:40:00 by DitNavn
#[[Nicolai Kalland Isaksen]] - replaces Nicolai Kalland Isaksen - 6/9/2009 09:41:00 by DitNavn
#[[Niels Bach Jensen]] - replaces Niels Bach Jensen - 6/9/2009 09:41:00 by DitNavn
#[[Niels Christian Thyrrestrup Thomasen]] - replaces Niels Christian Thyrrestrup Thomasen - 6/9/2009 09:41:00 by DitNavn
#[[Nynne Vittrup Grauslund]] - replaces Nynne Vittrup Grauslund - 6/9/2009 09:41:00 by DitNavn
#[[Patrick B. Pedersen]] - replaces Patrick B. Pedersen - 6/9/2009 09:41:00 by DitNavn
#[[Patrick Rolff]] - replaces Patrick Rolff - 6/9/2009 09:41:00 by DitNavn
#[[Peter Kahira]] - replaces Peter Kahira - 6/9/2009 09:42:00 by DitNavn
#[[Rasmus Jensen]] - replaces Rasmus Jensen - 6/9/2009 09:42:00 by DitNavn
#[[Rasmus Krogh Larsen]] - replaces Rasmus Krogh Larsen - 6/9/2009 09:42:00 by DitNavn
#[[Rasmus Molbech Pedersen]] - replaces Rasmus Molbech Pedersen - 6/9/2009 09:42:00 by DitNavn
#[[Rebecca Vibæk]] - replaces Rebecca Vibæk - 6/9/2009 09:43:00 by DitNavn
#[[Rikke Schrum Jensen]] - replaces Rikke Schrum Jensen - 6/9/2009 09:43:00 by DitNavn
#[[Rikke Skov Hoffmann]] - replaces Rikke Skov Hoffmann - 6/9/2009 09:43:00 by DitNavn
#[[Rikke Stensig Ballegaard]] - replaces Rikke Stensig Ballegaard - 6/9/2009 09:43:00 by DitNavn
#[[Sandie L. Grønhøj]] - replaces Sandie L. Grønhøj - 6/9/2009 09:43:00 by DitNavn
#[[Sara Godt Christensen]] - replaces Sara Godt Christensen - 6/9/2009 09:44:00 by DitNavn
#[[Sarah Maren Jensen Brüning]] - replaces Sarah Maren Jensen Brüning - 6/9/2009 09:44:00 by DitNavn
#[[Signe Deichmann Nielsen]] - replaces Signe Deichmann Nielsen - 6/9/2009 09:44:00 by DitNavn
#[[Simon Skyum]] - added
#[[Simon Staun]] - replaces Simon Staun - 6/9/2009 09:44:00 by DitNavn
#[[Simon Staunsbæk]] - replaces Simon Staunsbæk - 6/9/2009 09:44:00 by DitNavn
#[[Simone Madsen]] - replaces Simone Madsen - 6/9/2009 09:45:00 by DitNavn
#[[Simone Pedersen]] - replaces Simone Pedersen - 6/9/2009 09:45:00 by DitNavn
#[[Stefan Vinther Jeppesen]] - replaces Stefan Vinther Jeppesen - 6/9/2009 09:45:00 by DitNavn
#[[Steffen Heebøll Nygaard]] - replaces Steffen Heebøll Nygaard - 6/9/2009 09:45:00 by DitNavn
#[[Stine Gade Jørgensen]] - replaces Stine Gade Jørgensen - 6/9/2009 09:46:00 by DitNavn
#[[Stine Schmidth Christiansen]] - replaces Stine Schmidth Christiansen - 6/9/2009 09:46:00 by DitNavn
#[[Stine Svenninggaard]] - replaces Stine Svenninggaard - 6/9/2009 09:46:00 by DitNavn
#[[Thomas Søgård]] - replaces Thomas Søgård - 6/9/2009 09:46:00 by DitNavn
#[[Trine Lund]] - replaces Trine Lund - 6/9/2009 09:47:00 by DitNavn
<<<
----
On 9. juni 2009 10:24:44, DitNavn imported 19 tiddlers from
[[http://måns.dk/weekend|http://måns.dk/weekend]]:
<<<
#[[BI]] - replaces BI - 5/31/2009 20:37:00 by DitNavn
#[[BK]] - replaces BK - 5/31/2009 20:55:00 by DitNavn
#[[DK]] - replaces DK - 5/31/2009 20:56:00 by DitNavn
#[[DO]] - replaces DO - 5/31/2009 20:57:00 by DitNavn
#[[ET]] - replaces ET - 5/31/2009 21:04:00 by DitNavn
#[[HC]] - replaces HC - 5/31/2009 21:10:00 by DitNavn
#[[HM]] - replaces HM - 5/31/2009 21:10:00 by DitNavn
#[[JA]] - replaces JA - 5/31/2009 21:09:00 by DitNavn
#[[JD]] - replaces JD - 5/31/2009 21:09:00 by DitNavn
#[[JG]] - replaces JG - 5/31/2009 21:09:00 by DitNavn
#[[JK]] - replaces JK - 5/31/2009 21:08:00 by DitNavn
#[[LM]] - replaces LM - 5/31/2009 21:08:00 by DitNavn
#[[LS]] - replaces LS - 5/31/2009 21:08:00 by DitNavn
#[[MM]] - replaces MM - 5/31/2009 21:31:00 by DitNavn
#[[PA]] - replaces PA - 5/31/2009 21:07:00 by DitNavn
#[[PS]] - replaces PS - 5/31/2009 21:07:00 by DitNavn
#[[SB]] - replaces SB - 5/31/2009 21:06:00 by DitNavn
#[[SM]] - replaces SM - 5/31/2009 21:06:00 by DitNavn
#[[TN]] - replaces TN - 5/31/2009 21:06:00 by DitNavn
<<<
----
On 9. juni 2009 10:19:34, DitNavn imported 19 tiddlers from
[[http://gdsskole.tiddlyspot.com|http://gdsskole.tiddlyspot.com]]:
<<<
#[[BI]] - added
#[[BK]] - added
#[[DK]] - added
#[[DO]] - added
#[[ET]] - added
#[[HC]] - added
#[[HM]] - added
#[[JA]] - added
#[[JD]] - added
#[[JG]] - added
#[[JK]] - added
#[[LM]] - replaces LM - 4/4/2009 22:08:00 by DitNavn
#[[LS]] - replaces LS - 4/4/2009 22:08:00 by DitNavn
#[[MM]] - replaces MM - 6/8/2009 07:20:00 by mama
#[[PA]] - replaces PA - 4/4/2009 22:08:00 by DitNavn
#[[PS]] - replaces PS - 4/4/2009 22:07:00 by DitNavn
#[[SB]] - replaces SB - 4/4/2009 22:01:00 by DitNavn
#[[SM]] - replaces SM - 6/8/2009 04:00:00 by mama
#[[TN]] - replaces TN - 4/4/2009 22:06:00 by DitNavn
<<<
----
On 9. juni 2009 10:17:52, DitNavn imported 48 tiddlers from
[[http://gdsskole.tiddlyspot.com|http://gdsskole.tiddlyspot.com]]:
<<<
#[[AndreFag]] - added
#[[DanA1]] - added
#[[DanA2]] - added
#[[DanA3]] - replaces DanA3 - 6/8/2009 17:52:00 by mama
#[[DanA4]] - added
#[[DanB1]] - added
#[[DanB2]] - added
#[[DanB3]] - added
#[[DanB4]] - added
#[[Dansk]] - replaces Dansk - 6/8/2009 19:13:00 by mama
#[[Engelsk]] - added
#[[FysA1]] - added
#[[FysA3]] - added
#[[FysB1]] - added
#[[FysB3]] - added
#[[FysC1]] - added
#[[FysC3]] - added
#[[FysikKemi]] - added
#[[Geo2]] - added
#[[Geo3]] - added
#[[Guitar Efterår]] - added
#[[Kris3]] - added
#[[MatA1]] - added
#[[MatA2]] - added
#[[MatA3]] - added
#[[MatA4]] - added
#[[MatB1]] - added
#[[MatB2]] - added
#[[MatB3]] - added
#[[MatB4]] - added
#[[Matematik]] - added
#[[Tegning Efterår]] - added
#[[TysA1]] - added
#[[TysA3]] - added
#[[TysB1]] - added
#[[TysB3]] - added
#[[TysC1]] - added
#[[TysC3]] - added
#[[Tysk]] - replaces Tysk - 6/8/2009 19:12:00 by mama
#[[ValgFag]] - added
#[[engA1]] - added
#[[engA2]] - added
#[[engA3]] - added
#[[engA4]] - added
#[[engB1]] - added
#[[engB2]] - added
#[[engB3]] - added
#[[engB4]] - added
<<<
----
On Wednesday, 3 June 2009 6:35:34 AM, YourName imported 1 tiddler from
[[F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm|F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm]]:
<<<
#[[SwitchThemePlugin]] - added
<<<
----
On Tuesday, 2 June 2009 6:59:57 PM, YourName imported 1 tiddler from
[[F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm|F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm]]:
<<<
#[[UnsavedChangesPlugin]] - added
<<<
----
On Tuesday, 2 June 2009 9:32:16 AM, YourName imported 18 tiddlers from
[[F:\TiddlyWiki\TWExperiments\jQuery\twt-notes-trreeview-experimental.html|F:\TiddlyWiki\TWExperiments\jQuery\twt-notes-trreeview-experimental.html]]:
<<<
#[[1:Basic]] - added
#[[1:Note-taking]] - added
#[[2:Advanced]] - added
#[[2:Navigating]] - added
#[[3:How to download]] - added
#[[Customization]] - added
#[[MathEquations]] - added
#[[Menus]] - added
#[[Plugins]] - replaces Plugins - 6/2/2009 00:27:00 by YourName
#[[Printing]] - added
#[[SetUp]] - added
#[[SetupMainMenu]] - added
#[[SetupTreeview]] - added
#[[Styling]] - added
#[[System]] - replaces System - 6/2/2009 00:23:00 by YourName
#[[TWT-Notes]] - replaces TWT-Notes - 5/30/2009 23:12:00 by YourName
#[[Templates]] - replaces Templates - 6/2/2009 00:24:00 by YourName
#[[Tools]] - replaces Tools - 6/2/2009 03:29:00 by YourName
<<<
----
On Tuesday, 2 June 2009 3:27:25 AM, YourName imported 2 tiddlers from
[[F:\TiddlyWiki\TWExperiments\jQuery\twt-notes-trreeview-experimental.html|F:\TiddlyWiki\TWExperiments\jQuery\twt-notes-trreeview-experimental.html]]:
<<<
#[[TiddlerTweaker]] - added
#[[TiddlerTweakerPlugin]] - added
<<<
----
On Tuesday, 2 June 2009 2:56:26 AM, YourName imported 2 tiddlers from
[[F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm|F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm]]:
<<<
#[[TaggedTemplateTweak]] - added
#[[TaggedTemplateTweakInfo]] - added
<<<
----
On Tuesday, 2 June 2009 2:37:58 AM, YourName imported 1 tiddler from
[[F:\TiddlyWiki\TW Help\twhelp.html|F:\TiddlyWiki\TW Help\twhelp.html]]:
<<<
#[[FullScreenPlugin]] - added
<<<
----
On Monday, 1 June 2009 2:46:52 PM, YourName imported 3 tiddlers from
[[F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm|F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm]]:
<<<
#[[AttachFilePackage]] - added
#[[AttachFilePlugin]] - added
#[[AttachFilePluginFormatters]] - skipped after asking
#[[AttachFilePluginInfo]] - added
<<<
----
On Monday, 1 June 2009 4:24:01 AM, YourName imported 1 tiddler from
[[F:\TiddlyWiki\TWExperiments\jQuery\twt-notes-trreeview-experimental.html|F:\TiddlyWiki\TWExperiments\jQuery\twt-notes-trreeview-experimental.html]]:
<<<
#[[TiddlerNotesPlugin]] - added
<<<
----
On Monday, 1 June 2009 3:28:48 AM, YourName imported 114 tiddlers from
[[F:\TiddlyWiki\TW Treeview\twtreeview.html|F:\TiddlyWiki\TW Treeview\twtreeview.html]]:
<<<
#[[A Test Topic]] - added
#[[ANewTreeviewMenu]] - added
#[[AnotherTest]] - added
#[[AttachFilePluginFormatters]] - added
#[[BuildingAMenu]] - added
#[[ConfigTweaks]] - added
#[[Cookie plugin]] - added
#[[DefaultTiddlers]] - added
#[[DeprecatedFunctionsPlugin]] - added
#[[DoBackupMacro]] - added
#[[EditATiddler]] - added
#[[EditTemplate]] - added
#[[EmbeddedImages]] - added
#[[Find]] - added
#[[ForEachTiddlerPlugin]] - added
#[[GotoPlugin]] - added
#[[HTMLFormattingPlugin]] - added
#[[InlineJavascriptPlugin]] - added
#[[JqueryTreeviewCSS]] - added
#[[Level2]] - added
#[[LoadRemoteFileThroughProxy]] - skipped after asking
#[[MainMenu]] - added
#[[MakeTiddlers]] - added
#[[MarkupPostBody]] - added
#[[NavButtons]] - added
#[[NestedSlidersPlugin]] - added
#[[New Tabs]] - added
#[[NewHTMLFromTemplate]] - added
#[[NewHerePlugin]] - added
#[[NewIframeFromTemplate]] - added
#[[NewJournalFromTemplate]] - added
#[[NewObjectFromTemplate]] - added
#[[NewScriptTiddler]] - added
#[[NewSliderFromTemplate]] - added
#[[NewSystemConfigTiddler]] - added
#[[NewTableFromTemplate]] - added
#[[NewTabsFromTemplate]] - added
#[[NewTiddler]] - added
#[[Overview]] - added
#[[PageTemplate]] - added
#[[PasswordOptionsPlugin]] - skipped after asking
#[[Plugins]] - added
#[[QuickEditPackage]] - added
#[[QuickEditPlugin]] - added
#[[QuickEditToolbar]] - added
#[[QuickEdit_align]] - added
#[[QuickEdit_color]] - added
#[[QuickEdit_convert]] - added
#[[QuickEdit_custom]] - added
#[[QuickEdit_customList]] - added
#[[QuickEdit_font]] - added
#[[QuickEdit_fontList]] - added
#[[QuickEdit_format]] - added
#[[QuickEdit_image]] - added
#[[QuickEdit_insert]] - added
#[[QuickEdit_link]] - added
#[[QuickEdit_macro]] - added
#[[QuickEdit_replace]] - added
#[[QuickEdit_sort]] - added
#[[QuickEdit_split]] - added
#[[RefreshTiddler]] - added
#[[SaveAsPlugin]] - added
#[[SaveCloseTiddlerPlugin]] - added
#[[SearchOptionsPlugin]] - added
#[[SetupTreeview]] - added
#[[SideBarOptions]] - added
#[[SideBarTabs]] - added
#[[SimonsNiceTable]] - added
#[[SiteTitle]] - added
#[[StyleSheet]] - added
#[[StyleSheetShortcuts]] - added
#[[StyleSheetTiddlersBar]] - added
#[[TWHelp-SearchResults]] - added
#[[TWT-Notes]] - added
#[[TWT-Treeview-Implementation]] - added
#[[TWTStyleSheetX]] - added
#[[TaggerPlugin]] - added
#[[Templates]] - added
#[[TiddlerMakeFile]] - added
#[[TiddlerbarToggled]] - added
#[[TiddlersBarPluginMG]] - added
#[[ToggleLeftSidebar]] - added
#[[ToggleRightSidebar]] - added
#[[ToggleTabs]] - added
#[[ToggleTiddlersBar]] - added
#[[ToolbarCommands]] - added
#[[TopMenu]] - added
#[[TopMenuStyle]] - added
#[[TreeviewPluginPlugin.24]] - added
#[[TspotSetupPlugin]] - skipped after asking
#[[TwHelpSearchPlugin]] - added
#[[UploadLog]] - added
#[[UploadPlugin]] - skipped after asking
#[[Usage]] - added
#[[ViewTemplate]] - added
#[[book.gif]] - added
#[[editA]] - added
#[[file.gif]] - added
#[[folder-closed.gif]] - added
#[[folder.gif]] - added
#[[leftbackdo6.gif]] - added
#[[mainmenugray7ef.gif]] - added
#[[minus.gif]] - added
#[[navbargrayhw1.gif]] - added
#[[navbargrayhw1.png]] - added
#[[navbarred.gif]] - added
#[[openbook.gif]] - added
#[[treeview-black-line.gif]] - added
#[[treeview-black.gif]] - added
#[[treeview-default-line.gif]] - added
#[[treeview-default.gif]] - added
#[[treeview-famfamfam-line.gif]] - added
#[[treeview-famfamfam.gif]] - added
#[[treeview-gray-line.gif]] - added
#[[treeview-gray.gif]] - added
#[[treeview-red-line.gif]] - added
#[[treeview-red.gif]] - added
#[[whatsThis]] - added
<<<
{{left{
{{wrap{
{{mmheading{[[Info & Blog|Info&Blog]]}}}
<<treeview2 "info" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Info-ID"' >><<treeview2 "Blog" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Blog-ID"' >>
/***
|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 <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!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(/^#/,'')); } }
//}}}
~EfterskoleLister er et enkelt html dokument og kan hentes ned til ens egen pc.
!Hvordan bruger man ~EfterSkoleLister?:
<<slideShow>>
/%
[[Kom i gang]]
[[Instruktioner]]
[[Grundlæggende tilpasning]]
[[Opret en hjemmeside på TiddlySpot]]
%/
#''Søgning i ESL'': Der er tre forskellige søgefunktioner. YourSearch, GoTo og en tredie, der kan gemme søgeresultaterne.
##''Meldinger:'' Sygemeldinger, weekendtilmelding og listen over elever som er hjemme, føres ganske enkelt med "flueben".
##''Lister'': Der skrives automatisk lister og tabeller. De kan alle sorteres og skrives ud
#''Navigation i ESL'': Der er fire måder at navigere i ESL:
##Søg efter en note gennem søgevinduet.
##Se dine mapper igennem via fillistesystemnet til venstre.
##Gennemse fanerne for dine åbne tiddlere.
##Åben sidepanelet for at se lister over tiddlere efter titel, dato ændret og efter tags.
#''Formatering i ESL''
##Når en note eller et emne er i edit-mode, kan du bruge knapper til at formater valgt tekst eller tilføje links og billeder.
#Hvis du bruger en anden browser end Firefox, vil du få brug for [[TiddlerSaver.jar|http://www.tiddlywiki.com/TiddlySaver.jar]], gem ~TiddlySaver filen, og læg den //samme sted// som din ~EL-fil. ~TiddlySaver er en Java applet som giver dig mulighed for at gemme ændringer i forskellige browsere som ikke understøtter at man kan gemme ændringer til lokale filer.
!Andre instruktioner
*[[Kom i gang]]
*[[Grundlæggende tilpasning]]
*[[Opret en hjemmeside på TiddlySpot]]
For at se hvordan man formaterer tekst i ~TiddlyWiki, kan du læse "Special formatting" sektionen af [[denne tutorial|http://www.giffmex.org/twfortherestofus.html]].
(Red.(MM)) Udover [[HurtigEdit|QuickEditToolbar]] som er indbygget i denne udgave af ~TiddlyWiki, fra starten, har jeg b.a. tilføjet wikibar og wysiwyg. For at kunne bruge wysiwyg lokalt - dvs. efter du har downloadet filen til din pc, - skal du downloade [[denne zipfil|http://maans.newp.dk/fckeditor.zip]], pakke mappen ud og lægge mappen (ikke indholdet, men hele mappen) samme sted som du har din tiddlywiki-fil.
/***
|''Name:''|IntelliTaggerPlugin|
|''Version:''|1.0.2 (2007-07-25)|
|''Type:''|plugin|
|''Source:''|http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin|
|''Author:''|Udo Borkowski (ub [at] abego-software [dot] de)|
|''Documentation:''|[[IntelliTaggerPlugin Documentation]]|
|''~SourceCode:''|[[IntelliTaggerPlugin SourceCode]]|
|''Licence:''|[[BSD open source license (abego Software)]]|
|''~CoreVersion:''|2.0.8|
|''Browser:''|Firefox 1.5.0.2 or better|
***/
/***
!Version History
* 1.0.2 (2007-07-25):
** Feature: "Return" key may be used to accept first tag suggestion (beside "Alt-1")
** Bugfix: Keyboard shortcuts (Alt+3 etc.) shifted
* 1.0.1 (2007-05-18): Improvement: Speedup when using TiddlyWikis with many tags
* 1.0.0 (2006-04-26): Initial release
***/
// /%
if(!version.extensions.IntelliTaggerPlugin){if(!window.abego){window.abego={};}if(!abego.internal){abego.internal={};}abego.alertAndThrow=function(s){alert(s);throw s;};if(version.major<2){abego.alertAndThrow("Use TiddlyWiki 2.0.8 or better to run the IntelliTagger Plugin.");}version.extensions.IntelliTaggerPlugin={major:1,minor:0,revision:2,date:new Date(2007,6,25),type:"plugin",source:"http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin",documentation:"[[IntelliTaggerPlugin Documentation]]",sourcecode:"[[IntelliTaggerPlugin SourceCode]]",author:"Udo Borkowski (ub [at] abego-software [dot] de)",licence:"[[BSD open source license (abego Software)]]",tiddlywiki:"Version 2.0.8 or better",browser:"Firefox 1.5.0.2 or better"};abego.createEllipsis=function(_2){var e=createTiddlyElement(_2,"span");e.innerHTML="…";};abego.isPopupOpen=function(_4){return _4&&_4.parentNode==document.body;};abego.openAsPopup=function(_5){if(_5.parentNode!=document.body){document.body.appendChild(_5);}};abego.closePopup=function(_6){if(abego.isPopupOpen(_6)){document.body.removeChild(_6);}};abego.getWindowRect=function(){return {left:findScrollX(),top:findScrollY(),height:findWindowHeight(),width:findWindowWidth()};};abego.moveElement=function(_7,_8,_9){_7.style.left=_8+"px";_7.style.top=_9+"px";};abego.centerOnWindow=function(_a){if(_a.style.position!="absolute"){throw "abego.centerOnWindow: element must have absolute position";}var _b=abego.getWindowRect();abego.moveElement(_a,_b.left+(_b.width-_a.offsetWidth)/2,_b.top+(_b.height-_a.offsetHeight)/2);};abego.isDescendantOrSelf=function(_c,e){while(e){if(_c==e){return true;}e=e.parentNode;}return false;};abego.toSet=function(_e){var _f={};for(var i=0;i<_e.length;i++){_f[_e[i]]=true;}return _f;};abego.filterStrings=function(_11,_12,_13){var _14=[];for(var i=0;i<_11.length&&(_13===undefined||_14.length<_13);i++){var s=_11[i];if(s.match(_12)){_14.push(s);}}return _14;};abego.arraysAreEqual=function(a,b){if(!a){return !b;}if(!b){return false;}var n=a.length;if(n!=b.length){return false;}for(var i=0;i<n;i++){if(a[i]!=b[i]){return false;}}return true;};abego.moveBelowAndClip=function(_1b,_1c){if(!_1c){return;}var _1d=findPosX(_1c);var _1e=findPosY(_1c);var _1f=_1c.offsetHeight;var _20=_1d;var _21=_1e+_1f;var _22=findWindowWidth();if(_22<_1b.offsetWidth){_1b.style.width=(_22-100)+"px";}var _23=_1b.offsetWidth;if(_20+_23>_22){_20=_22-_23-30;}if(_20<0){_20=0;}_1b.style.left=_20+"px";_1b.style.top=_21+"px";_1b.style.display="block";};abego.compareStrings=function(a,b){return (a==b)?0:(a<b)?-1:1;};abego.sortIgnoreCase=function(arr){var _27=[];var n=arr.length;for(var i=0;i<n;i++){var s=arr[i];_27.push([s.toString().toLowerCase(),s]);}_27.sort(function(a,b){return (a[0]==b[0])?0:(a[0]<b[0])?-1:1;});for(i=0;i<n;i++){arr[i]=_27[i][1];}};abego.getTiddlerField=function(_2d,_2e,_2f){var _30=document.getElementById(_2d.idPrefix+_2e);var e=null;if(_30!=null){var _32=_30.getElementsByTagName("*");for(var t=0;t<_32.length;t++){var c=_32[t];if(c.tagName.toLowerCase()=="input"||c.tagName.toLowerCase()=="textarea"){if(!e){e=c;}if(c.getAttribute("edit")==_2f){e=c;}}}}return e;};abego.setRange=function(_35,_36,end){if(_35.setSelectionRange){_35.setSelectionRange(_36,end);var max=0+_35.scrollHeight;var len=_35.textLength;var top=max*_36/len,bot=max*end/len;_35.scrollTop=Math.min(top,(bot+top-_35.clientHeight)/2);}else{if(_35.createTextRange!=undefined){var _3b=_35.createTextRange();_3b.collapse();_3b.moveEnd("character",end);_3b.moveStart("character",_36);_3b.select();}else{_35.select();}}};abego.internal.TagManager=function(){var _3c=null;var _3d=function(){if(_3c){return;}_3c={};store.forEachTiddler(function(_3e,_3f){for(var i=0;i<_3f.tags.length;i++){var tag=_3f.tags[i];var _42=_3c[tag];if(!_42){_42=_3c[tag]={count:0,tiddlers:{}};}_42.tiddlers[_3f.title]=true;_42.count+=1;}});};var _43=TiddlyWiki.prototype.saveTiddler;TiddlyWiki.prototype.saveTiddler=function(_44,_45,_46,_47,_48,_49){var _4a=this.fetchTiddler(_44);var _4b=_4a?_4a.tags:[];var _4c=(typeof _49=="string")?_49.readBracketedList():_49;_43.apply(this,arguments);if(!abego.arraysAreEqual(_4b,_4c)){abego.internal.getTagManager().reset();}};var _4d=TiddlyWiki.prototype.removeTiddler;TiddlyWiki.prototype.removeTiddler=function(_4e){var _4f=this.fetchTiddler(_4e);var _50=_4f&&_4f.tags.length>0;_4d.apply(this,arguments);if(_50){abego.internal.getTagManager().reset();}};this.reset=function(){_3c=null;};this.getTiddlersWithTag=function(tag){_3d();var _52=_3c[tag];return _52?_52.tiddlers:null;};this.getAllTags=function(_53){_3d();var _54=[];for(var i in _3c){_54.push(i);}for(i=0;_53&&i<_53.length;i++){_54.pushUnique(_53[i],true);}abego.sortIgnoreCase(_54);return _54;};this.getTagInfos=function(){_3d();var _56=[];for(var _57 in _3c){_56.push([_57,_3c[_57]]);}return _56;};var _58=function(a,b){var a1=a[1];var b1=b[1];var d=b[1].count-a[1].count;return d!=0?d:abego.compareStrings(a[0].toLowerCase(),b[0].toLowerCase());};this.getSortedTagInfos=function(){_3d();var _5e=this.getTagInfos();_5e.sort(_58);return _5e;};this.getPartnerRankedTags=function(_5f){var _60={};for(var i=0;i<_5f.length;i++){var _62=this.getTiddlersWithTag(_5f[i]);for(var _63 in _62){var _64=store.getTiddler(_63);if(!(_64 instanceof Tiddler)){continue;}for(var j=0;j<_64.tags.length;j++){var tag=_64.tags[j];var c=_60[tag];_60[tag]=c?c+1:1;}}}var _68=abego.toSet(_5f);var _69=[];for(var n in _60){if(!_68[n]){_69.push(n);}}_69.sort(function(a,b){var d=_60[b]-_60[a];return d!=0?d:abego.compareStrings(a.toLowerCase(),b.toLowerCase());});return _69;};};abego.internal.getTagManager=function(){if(!abego.internal.gTagManager){abego.internal.gTagManager=new abego.internal.TagManager();}return abego.internal.gTagManager;};(function(){var _6e=2;var _6f=1;var _70=30;var _71;var _72;var _73;var _74;var _75;var _76;if(!abego.IntelliTagger){abego.IntelliTagger={};}var _77=function(){return _72;};var _78=function(tag){return _75[tag];};var _7a=function(s){var i=s.lastIndexOf(" ");return (i>=0)?s.substr(0,i):"";};var _7d=function(_7e){var s=_7e.value;var len=s.length;return (len>0&&s[len-1]!=" ");};var _81=function(_82){var s=_82.value;var len=s.length;if(len>0&&s[len-1]!=" "){_82.value+=" ";}};var _85=function(tag,_87,_88){if(_7d(_87)){_87.value=_7a(_87.value);}story.setTiddlerTag(_88.title,tag,0);_81(_87);abego.IntelliTagger.assistTagging(_87,_88);};var _89=function(n){if(_76&&_76.length>n){return _76[n];}return (_74&&_74.length>n)?_74[n]:null;};var _8b=function(n,_8d,_8e){var _8f=_89(n);if(_8f){_85(_8f,_8d,_8e);}};var _90=function(_91){var pos=_91.value.lastIndexOf(" ");var _93=(pos>=0)?_91.value.substr(++pos,_91.value.length):_91.value;return new RegExp(_93.escapeRegExp(),"i");};var _94=function(_95,_96){var _97=0;for(var i=0;i<_95.length;i++){if(_96[_95[i]]){_97++;}}return _97;};var _99=function(_9a,_9b,_9c){var _9d=1;var c=_9a[_9b];for(var i=_9b+1;i<_9a.length;i++){if(_9a[i][1].count==c){if(_9a[i][0].match(_9c)){_9d++;}}else{break;}}return _9d;};var _a0=function(_a1,_a2){var _a3=abego.internal.getTagManager().getSortedTagInfos();var _a4=[];var _a5=0;for(var i=0;i<_a3.length;i++){var c=_a3[i][1].count;if(c!=_a5){if(_a2&&(_a4.length+_99(_a3,i,_a1)>_a2)){break;}_a5=c;}if(c==1){break;}var s=_a3[i][0];if(s.match(_a1)){_a4.push(s);}}return _a4;};var _a9=function(_aa,_ab){return abego.filterStrings(abego.internal.getTagManager().getAllTags(_ab),_aa);};var _ac=function(){if(!_71){return;}var _ad=store.getTiddlerText("IntelliTaggerMainTemplate");if(!_ad){_ad="<b>Tiddler IntelliTaggerMainTemplate not found</b>";}_71.innerHTML=_ad;applyHtmlMacros(_71,null);refreshElements(_71,null);};var _ae=function(e){if(!e){var e=window.event;}var tag=this.getAttribute("tag");if(_73){_73.call(this,tag,e);}return false;};var _b2=function(_b3){createTiddlyElement(_b3,"span",null,"tagSeparator"," | ");};var _b4=function(_b5,_b6,_b7,_b8,_b9){if(!_b6){return;}var _ba=_b8?abego.toSet(_b8):{};var n=_b6.length;var c=0;for(var i=0;i<n;i++){var tag=_b6[i];if(_ba[tag]){continue;}if(c>0){_b2(_b5);}if(_b9&&c>=_b9){abego.createEllipsis(_b5);break;}c++;var _bf="";var _c0=_b5;if(_b7<10){_c0=createTiddlyElement(_b5,"span",null,"numberedSuggestion");_b7++;var key=_b7<10?""+(_b7):"0";createTiddlyElement(_c0,"span",null,"suggestionNumber",key+") ");var _c2=_b7==1?"Return or ":"";_bf=" (Shortcut: %1Alt-%0)".format([key,_c2]);}var _c3=config.views.wikified.tag.tooltip.format([tag]);var _c4=(_78(tag)?"Remove tag '%0'%1":"Add tag '%0'%1").format([tag,_bf]);var _c5="%0; Shift-Click: %1".format([_c4,_c3]);var btn=createTiddlyButton(_c0,tag,_c5,_ae,_78(tag)?"currentTag":null);btn.setAttribute("tag",tag);}};var _c7=function(){if(_71){window.scrollTo(0,ensureVisible(_71));}if(_77()){window.scrollTo(0,ensureVisible(_77()));}};var _c8=function(e){if(!e){var e=window.event;}if(!_71){return;}var _cb=resolveTarget(e);if(_cb==_77()){return;}if(abego.isDescendantOrSelf(_71,_cb)){return;}abego.IntelliTagger.close();};addEvent(document,"click",_c8);var _cc=Story.prototype.gatherSaveFields;Story.prototype.gatherSaveFields=function(e,_ce){_cc.apply(this,arguments);var _cf=_ce.tags;if(_cf){_ce.tags=_cf.trim();}};var _d0=function(_d1){story.focusTiddler(_d1,"tags");var _d2=abego.getTiddlerField(story,_d1,"tags");if(_d2){var len=_d2.value.length;abego.setRange(_d2,len,len);window.scrollTo(0,ensureVisible(_d2));}};var _d4=config.macros.edit.handler;config.macros.edit.handler=function(_d5,_d6,_d7,_d8,_d9,_da){_d4.apply(this,arguments);var _db=_d7[0];if((_da instanceof Tiddler)&&_db=="tags"){var _dc=_d5.lastChild;_dc.onfocus=function(e){abego.IntelliTagger.assistTagging(_dc,_da);setTimeout(function(){_d0(_da.title);},100);};_dc.onkeyup=function(e){if(!e){var e=window.event;}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&(e.keyCode>=48&&e.keyCode<=57)){_8b(e.keyCode==48?9:e.keyCode-49,_dc,_da);}else{if(e.ctrlKey&&e.keyCode==32){_8b(0,_dc,_da);}}if(!e.ctrlKey&&(e.keyCode==13||e.keyCode==10)){_8b(0,_dc,_da);}setTimeout(function(){abego.IntelliTagger.assistTagging(_dc,_da);},100);return false;};_81(_dc);}};var _e0=function(e){if(!e){var e=window.event;}var _e3=resolveTarget(e);var _e4=_e3.getAttribute("tiddler");if(_e4){story.displayTiddler(_e3,_e4,"IntelliTaggerEditTagsTemplate",false);_d0(_e4);}return false;};var _e5=config.macros.tags.handler;config.macros.tags.handler=function(_e6,_e7,_e8,_e9,_ea,_eb){_e5.apply(this,arguments);abego.IntelliTagger.createEditTagsButton(_eb,createTiddlyElement(_e6.lastChild,"li"));};var _ec=function(){if(_71&&_72&&!abego.isDescendantOrSelf(document,_72)){abego.IntelliTagger.close();}};setInterval(_ec,100);abego.IntelliTagger.displayTagSuggestions=function(_ed,_ee,_ef,_f0,_f1){_74=_ed;_75=abego.toSet(_ee);_76=_ef;_72=_f0;_73=_f1;if(!_71){_71=createTiddlyElement(document.body,"div",null,"intelliTaggerSuggestions");_71.style.position="absolute";}_ac();abego.openAsPopup(_71);if(_77()){var w=_77().offsetWidth;if(_71.offsetWidth<w){_71.style.width=(w-2*(_6e+_6f))+"px";}abego.moveBelowAndClip(_71,_77());}else{abego.centerOnWindow(_71);}_c7();};abego.IntelliTagger.assistTagging=function(_f3,_f4){var _f5=_90(_f3);var s=_f3.value;if(_7d(_f3)){s=_7a(s);}var _f7=s.readBracketedList();var _f8=_f7.length>0?abego.filterStrings(abego.internal.getTagManager().getPartnerRankedTags(_f7),_f5,_70):_a0(_f5,_70);abego.IntelliTagger.displayTagSuggestions(_a9(_f5,_f7),_f7,_f8,_f3,function(tag,e){if(e.shiftKey){onClickTag.call(this,e);}else{_85(tag,_f3,_f4);}});};abego.IntelliTagger.close=function(){abego.closePopup(_71);_71=null;return false;};abego.IntelliTagger.createEditTagsButton=function(_fb,_fc,_fd,_fe,_ff,id,_101){if(!_fd){_fd="[edit]";}if(!_fe){_fe="Edit the tags";}if(!_ff){_ff="editTags";}var _102=createTiddlyButton(_fc,_fd,_fe,_e0,_ff,id,_101);_102.setAttribute("tiddler",(_fb instanceof Tiddler)?_fb.title:String(_fb));return _102;};abego.IntelliTagger.getSuggestionTagsMaxCount=function(){return 100;};config.macros.intelliTagger={label:"intelliTagger",handler:function(_103,_104,_105,_106,_107,_108){var _109=_107.parseParams("list",null,true);var _10a=_109[0]["action"];for(var i=0;_10a&&i<_10a.length;i++){var _10c=_10a[i];var _10d=config.macros.intelliTagger.subhandlers[_10c];if(!_10d){abego.alertAndThrow("Unsupported action '%0'".format([_10c]));}_10d(_103,_104,_105,_106,_107,_108);}},subhandlers:{showTags:function(_10e,_10f,_110,_111,_112,_113){_b4(_10e,_74,_76?_76.length:0,_76,abego.IntelliTagger.getSuggestionTagsMaxCount());},showFavorites:function(_114,_115,_116,_117,_118,_119){_b4(_114,_76,0);},closeButton:function(_11a,_11b,_11c,_11d,_11e,_11f){var _120=createTiddlyButton(_11a,"close","Close the suggestions",abego.IntelliTagger.close);},version:function(_121){var t="IntelliTagger %0.%1.%2".format([version.extensions.IntelliTaggerPlugin.major,version.extensions.IntelliTaggerPlugin.minor,version.extensions.IntelliTaggerPlugin.revision]);var e=createTiddlyElement(_121,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";},copyright:function(_124){var e=createTiddlyElement(_124,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">© 2006-2007 <b><font color=\"red\">abego</font></b> Software<font>";}}};})();config.shadowTiddlers["IntelliTaggerStyleSheet"]="/***\n"+"!~IntelliTagger Stylesheet\n"+"***/\n"+"/*{{{*/\n"+".intelliTaggerSuggestions {\n"+"\tposition: absolute;\n"+"\twidth: 600px;\n"+"\n"+"\tpadding: 2px;\n"+"\tlist-style: none;\n"+"\tmargin: 0;\n"+"\n"+"\tbackground: #eeeeee;\n"+"\tborder: 1px solid DarkGray;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .currentTag {\n"+"\tfont-weight: bold;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .suggestionNumber {\n"+"\tcolor: #808080;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .numberedSuggestion{\n"+"\twhite-space: nowrap;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .intelliTaggerFooter {\n"+"\tmargin-top: 4px;\n"+"\tborder-top-width: thin;\n"+"\tborder-top-style: solid;\n"+"\tborder-top-color: #999999;\n"+"}\n"+".intelliTaggerSuggestions .favorites {\n"+"\tborder-bottom-width: thin;\n"+"\tborder-bottom-style: solid;\n"+"\tborder-bottom-color: #999999;\n"+"\tpadding-bottom: 2px;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .normalTags {\n"+"\tpadding-top: 2px;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .intelliTaggerFooter .button {\n"+"\tfont-size: 10px;\n"+"\n"+"\tpadding-left: 0.3em;\n"+"\tpadding-right: 0.3em;\n"+"}\n"+"\n"+"/*}}}*/\n";config.shadowTiddlers["IntelliTaggerMainTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<div class=\"favorites\" macro=\"intelliTagger action: showFavorites\"></div>\n"+"<div class=\"normalTags\" macro=\"intelliTagger action: showTags\"></div>\n"+"<!-- The Footer (with the Navigation) ============================================ -->\n"+"<table class=\"intelliTaggerFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n"+" <tr>\n"+"\t<td align=\"left\">\n"+"\t\t<span macro=\"intelliTagger action: closeButton\"></span>\n"+"\t</td>\n"+"\t<td align=\"right\">\n"+"\t\t<span macro=\"intelliTagger action: version\"></span>, <span macro=\"intelliTagger action: copyright \"></span>\n"+"\t</td>\n"+" </tr>\n"+"</tbody></table>\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["IntelliTaggerEditTagsTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\n"+"<div class='title' macro='view title'></div>\n"+"<div class='tagged' macro='tags'></div>\n"+"<div class='viewer' macro='view text wikified'></div>\n"+"<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\n"+"<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["BSD open source license (abego Software)"]="See [[Licence|http://tiddlywiki.abego-software.de/#%5B%5BBSD%20open%20source%20license%5D%5D]].";config.shadowTiddlers["IntelliTaggerPlugin Documentation"]="[[Documentation on abego Software website|http://tiddlywiki.abego-software.de/doc/IntelliTagger.pdf]].";config.shadowTiddlers["IntelliTaggerPlugin SourceCode"]="[[Plugin source code on abego Software website|http://tiddlywiki.abego-software.de/archive/IntelliTaggerPlugin/Plugin-IntelliTagger-src.1.0.2.js]]\n";(function(){var _126=restart;restart=function(){setStylesheet(store.getTiddlerText("IntelliTaggerStyleSheet"),"IntelliTaggerStyleSheet");_126.apply(this,arguments);};})();}
// %/
<<tabs "" [[Intro ]] "help with menus" [[IntroTræblik]] [[CreateNewMenu]] "" [[CreateNewMenu]] [[CreateNewBranches]] "" [[CreateNewBranches]] [[MenuOptions]] "" [[MenuOptions]] [[RollYourOwn]] "" [[RollYourOwn]]>>
[[►|IntroTræblik]]''~Tb-Træblik en "altmulig" ~TiddlyWiki til både begyndere og erfarne brugere.''
*@@color:#C06;Dette er en beta version der kan kommenteres og evalueres eller bruges som den er hvis ingen alvorlige problemer opstår.@@
{{center{<html><a href='http://træblik.tiddlyspot.com/download' class='button'>''Hent Tb Træblik''</a></html>}}}
It has been inspired by the Treeview plugin by ~MarkS and the interest shown to it. While having moved well beyond this it can trace its original legacy back to [[NoBrainerNotes|http://www.giffmex.org/nobrainernotes.html]].
We decided to release a general purpose TW using Treeview so the people who might want to evaluate it can do so with minimal fuss. The menus used in existing [[TW Notes|http://twnotes.tiddlyspot.com/]] and [[TWT-Notes|http://twt-notes.tiddlyspot.com/]] and [[NoBrainerNotes|http://www.giffmex.org/nobrainernotes.html]] can be imported with little or no change needed.
----
|vertical-align:top;width:50%;<<tiddler IntroTreeview##description>>|vertical-align:top;width:50%;<<tiddler IntroTreeview##features>>|
|borderless|k
/%
!features
@@color:#c06;''Features:''@@
*This is a ready to use Treeview enabled ~TiddlyWiki.
*Two click menu building. Automatic menu updating.
*~TiddlersBar tabs that can be toggled and off.
*Automatic saving with manual backup button.
*The latest ~QuickEdit wysiwyg editor.
*Several 'premade' new tiddlers (object sliders iframes tabsets etc.)
*Tools for manipulating tags;
*Plugins for professional extended customizing+++[►]<<tiddler Plugins>>===
!end
%/
/%
!description
@@color:#c06;''Introduction''@@
~TiddlyWiki is a remarkable achievement in programming innovation. It is but a single file that can be emailed or kept on a Thunb (flash) drive. The extensive array of plugins for it lends itself to quite sophisticated uses. I won't even attempt to list them for others have done so.
It ultimately has vast capabilities but, the minimal form it originally comes in can intimidate the raw beginner. or even slow down an experienced user. It is for this reason I have generated ~TW-Treeview, in a ready to use form, to get a new user up and running quickly. I have only assembled this, the hard work and generosity was given by others.
Morris Gray
!end
%/
<html><div align="center"><iframe src="http://mail.h-u.dk/webmail/src/login.php" frameborder="0" width="100%" height="600"></iframe></div></html>
/***
!!!<<gradient horiz #4EB93E #fff >><<tiddler RefreshStyles>> StyleSheetTiddlersBar>>/%==================================================%/
***/
.treeview, .treeview ul {
padding: 0;
margin: 0;
list-style: none;
}
.treeview ul {
background-color:transparent;
margin-top: 4px;
}
.treeview .hitarea {
background: url([[treeview-default.gif]]) -64px -25px no-repeat;
height: 16px;
width: 16px;
margin-left: -16px;
float: left;
cursor: pointer;
}
/* fix for IE6 */
* html .hitarea {
display: inline;
float:none;
}
.treeview li {
margin: 0;
padding: 3px 0pt 3px 16px;
}
.treeview a.selected {
background-color: #eee;
}
#treecontrol { margin: 1em 0; display: none; }
.treeview .hover { color: red; cursor: pointer; }
.treeview li { background: url([[treeview-red-line.gif]]) 0 0 no-repeat; }
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
.treeview .expandable-hitarea { background-position: -80px -3px; }
.treeview li.last { background-position: 0 -1766px }
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url([[treeview-default.gif]]); }
.treeview li.lastCollapsable { background-position: 0 -111px }
.treeview li.lastExpandable { background-position: -32px -67px }
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
.treeview-red li { background-image: url([[treeview-red-line.gif]]); }
.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url([[treeview-red.gif]]); }
.treeview-black li { background-image: url([[treeview-black-line.gif]]); }
.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url([[treeview-black.gif]]); }
.treeview-gray li { background-image: url([[treeview-gray-line.gif]]); }
.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url([[treeview-gray.gif]]); }
.treeview-famfamfam li { background-image: url([[treeview-famfamfam-line.gif]]); }
.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url([[treeview-famfamfam.gif]]); }
.filetree li { padding: 3px 0 2px 16px; }
.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
.filetree span.folder { background: url([[openbook.gif]]) 0 0 no-repeat; }
.filetree li.expandable span.folder { background: url([[book.gif]]) 0 0 no-repeat; }
.filetree span.file { background: url([[file.gif]]) 0 0 no-repeat; }
/***
!!!<<gradient horiz #4EB93E #fff >><<tiddler RefreshStyles>> StyleSheetTiddlersBar>>/%==================================================%/
***/
.treeview, .treeview ul {
padding: 0;
margin: 0;
list-style: none;
}
.treeview ul {
background-color:transparent;
margin-top: 4px;
}
.treeview .hitarea {
background: url([[treeview-default.gif]]) -64px -25px no-repeat;
height: 16px;
width: 16px;
margin-left: -16px;
float: left;
cursor: pointer;
}
/* fix for IE6 */
* html .hitarea {
display: inline;
float:none;
}
.treeview li {
margin: 0;
padding: 3px 0pt 3px 16px;
}
.treeview a.selected {
background-color: #eee;
}
#treecontrol { margin: 1em 0; display: none; }
.treeview .hover { color: red; cursor: pointer; }
.treeview li { background: url([[treeview-red-line.gif]]) 0 0 no-repeat; }
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
.treeview .expandable-hitarea { background-position: -80px -3px; }
.treeview li.last { background-position: 0 -1766px }
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url([[treeview-default.gif]]); }
.treeview li.lastCollapsable { background-position: 0 -111px }
.treeview li.lastExpandable { background-position: -32px -67px }
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
.treeview-red li { background-image: url([[treeview-red-line.gif]]); }
.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url([[treeview-red.gif]]); }
.treeview-black li { background-image: url([[treeview-black-line.gif]]); }
.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url([[treeview-black.gif]]); }
.treeview-gray li { background-image: url([[treeview-gray-line.gif]]); }
.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url([[treeview-gray.gif]]); }
.treeview-famfamfam li { background-image: url([[treeview-famfamfam-line.gif]]); }
.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url([[treeview-famfamfam.gif]]); }
.filetree li { padding: 3px 0 2px 16px; }
.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
.filetree span.folder { background: url([[folder.gif]]) 0 0 no-repeat; }
.filetree li.expandable span.folder { background: url([[folder-closed.gif]]) 0 0 no-repeat; }
.filetree span.file { background: url([[file.gif]]) 0 0 no-repeat; }
/***
!!!<<gradient horiz #4EB93E #fff >><<tiddler RefreshStyles>> StyleSheetTiddlersBar>>/%==================================================%/
***/
.treeview, .treeview ul {
padding: 0;
margin: 0;
list-style: none;
}
.treeview ul {
background-color:transparent;
margin-top: 4px;
}
.treeview .hitarea {
background: url([[treeview-gold.gif]]) -64px -25px no-repeat;
height: 16px;
width: 16px;
margin-left: -16px;
float: left;
cursor: pointer;
}
/* fix for IE6 */
* html .hitarea {
display: inline;
float:none;
}
.treeview li {
margin: 0;
padding: 3px 0pt 3px 16px;
}
.treeview a.selected {
background-color: #eee;
}
#treecontrol { margin: 1em 0; display: none; }
.treeview .hover { color: red; cursor: pointer; }
.treeview li { background: url([[treeview-gold-line.gif]]) 0 0 no-repeat; }
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
.treeview .expandable-hitarea { background-position: -80px -3px; }
.treeview li.last { background-position: 0 -1766px }
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url([[treeview-gold.gif]]); }
.treeview li.lastCollapsable { background-position: 0 -111px }
.treeview li.lastExpandable { background-position: -32px -67px }
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
.treeview-red li { background-image: url([[treeview-red-line.gif]]); }
.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url([[treeview-red.gif]]); }
.treeview-gold li { background-image: url([[treeview-gold-line.gif]]); }
.treeview-gold .hitarea, .treeview-gold li.lastCollapsable, .treeview-gold li.lastExpandable { background-image: url([[treeview-gold.gif]]); }
.treeview-black li { background-image: url([[treeview-black-line.gif]]); }
.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url([[treeview-black.gif]]); }
.treeview-gray li { background-image: url([[treeview-gray-line.gif]]); }
.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url([[treeview-gray.gif]]); }
.treeview-famfamfam li { background-image: url([[treeview-famfamfam-line.gif]]); }
.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url([[treeview-famfamfam.gif]]); }
.filetree li { padding: 3px 0 2px 16px; }
.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
.filetree span.folder { background: url([[folder.gif]]) 0 0 no-repeat; }
.filetree li.expandable span.folder { background: url([[folder-closed.gif]]) 0 0 no-repeat; }
.filetree span.file { background: url([[file.gif]]) 0 0 no-repeat; }
<<forEachTiddler where 'tiddler.tags.contains("Elev")&&tiddler.data ("K-gruppe")&&tiddler.data("K-gruppe").contains (context.viewerTiddler.title)'
sortBy 'tiddler.data("K-gruppe")'
write
'(index < 200)? "|"+(index+1)+"| [["+tiddler.title+"]] | [["+tiddler.data("Gang")+"]] | [["+tiddler.data("Kl") +"]] | <<toggleTag HU [["+tiddler.title+"]] nolabel \>\> | <<toggleTag Syg [["+tiddler.title+"]] nolabel \>\> |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>| [["+tiddler.title+"]] |<<tiddler HUUpdate\>\>|<<tiddler SygeUpdate\>\> |h\n"
+"|!#| "+tiddler.field("billede")+" | Gang | Klasse | ![[HU]] | ![[Syg]] |h\n"'
end 'count+" kontaktgruppe elever\n"' none '"Ingen elever i denne kontaktgruppegruppe\n"'
>>
@@padding-left:0.2em;+++[Mapper]{{left{{{mmheading{[[KontaktGrupper|K-Grupper]]}}}
<<treeview2 "Lærere" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Lærer-ID"' >>
<script>
var out=[]; var fmt='[[%0]]: %1|'; var fmt2='\n|[[%0]]|';
var tids=store.sortTiddlers(store.filterTiddlers("[tag[(context.viewerTiddler.title Elev T)]]"), "modified");
for (var i=0; i<tids.length; i++) {
out.push(fmt2.format([tids[i].title]));
for (var f in tids[i].fields) out.push(fmt.format
([f,tids[i].fields [f]]));
}
return out.join('|');
</script>
<html><p>For at komme i gang med denne tomme tiddlywiki, skal du ændre på de følgende tiddlere:</p><p>* SiteTitle & SiteSubtitle: Sidens titel og undertitel, som vist øverst (efter de er gemt, vil de også vise sig i browserens titelmenu)</p><p>* MainMenu: er hovedmenuen (er oftest placeret til venstre)</p><p>* DefaultTiddlers: Indeholder navnene på de tiddlere du vilhave skal starte op når du åbner TiddlyWiki</p><p>Du skal også skrive dit brugernavn for at signere dine redigeringer: <<option txtUserName>></p></html>
''__De følgende [[indstillinger og instruktioner|Kom i gang]] viser de første skridt i at foretage ændringer i din egen kopi af dette dokument:__''
{{big{
# få en kopi<br>{{normal{
Start med at hente en kopi af dette Htmldokument til din egen computer:
{{center{@@font-size:200%;line-height:120%;[[hent nu!|http://el0809.tiddlyspot.com/download]]@@}}}}}}
# åben din lokale kopi<br>{{normal{Når filen er gemt på din pc, skal du lukke ''//dette//'' browser/fane vindue og ''åbne den //lokale// fil du lige har gemt''.}}}
# Indstil titler og menuer<br>{{normal{Udskift indhold i [[SideTitel|SiteTitle]], [[UnderTitel|SiteSubtitle]], og [[HovedMenu|MainMenu]]}}}
# vælg opstartstiddlere<br>{{normal{redigér [[OpstartsTiddlere|DefaultTiddlers]] for at vælge hvilke tiddlere der vises ved opstart. Den nuværende indstilling er: {{block{<<wikify "{{{\n%0\n}}}\n" {{store.getTiddlerText("DefaultTiddlers")}}>>Bemærk: {{{[tag[opstart]]}}} syntaksen inkluderer automatisk alle tiddlere som er tagget med <<tag opstart>>(hvis der er nogen). På denne måde kan du hurtigt tilføje/fjerne individuelle tiddlere fra startvisningen blot ved at tilføje/fjerne<<tag opstart>> tagget på disse tiddlere, i stedet for, hver gang, at skulle redigere [[OpstartsTiddlere|DefaultTiddlers]] manuelt.
}}}}}}
# vælg typografier //(valgfrit)//<br>{{normal{Hvis det ønskes, kan du foretage æstetiske ændringer i StyleSheet som passer dig bedre}}}
# vælg præferencer //(valgfrit)//<br>{{normal{Du kan, redigere [[zzConfigOptions]] for at tilføje, fjerne, eller indstille "fabriksindstillede" plugin præferencer (se de individuelle plugins for detaljer). Nuværende indstillinger er:{{block{
<<tiddler zzConfigOptions>>}}}}}}
# færdig<br>{{normal{''Det var det!''... når du har gemt og genåbnet dit dokument, er det klar til brug.}}}
}}}Ps:
!!!Hvis du vil have ~EfterSkoleLister som hjemmeside, læs her:
[[Opret en hjemmeside på TiddlySpot]]
{{left{
{{mmheading{Oversigt over Kontaktlister}}}
<<treeview2 "Kontakt" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Kontakt-ID"' >>
pr telefon: +45 25344884
pr mail: [[mama snabela himmerlands-ungdomsskole punktum dk|mailto:"mama@himmerlands-ungdomsskole.dk"]] eller <<tiddler MailMåns>>
pr skrift: Elevvej 11 / 9600 / Aars
pr visit: Elevvej 11 / 9600 / Aars
<html><div align="center"><iframe src="http://www.krak.dk/person/" frameborder="0" width="100%" height="600"></iframe></div></html>
<<forEachTiddler where 'tiddler.tags.contains("Fag") && tiddler.fields["laerer"] && tiddler.fields["laerer"].contains(context.viewerTiddler.title)'
sortBy
'tiddler.title.toUpperCase()'
write '" <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"faghold\" er oprettede endnu//"'
>>
/%
|Name|CreateTiddlersFromCSV|
|Source|http://www.TiddlyTools.com/#CreateTiddlersFromCSV|
|Version|1.1.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|html|
|Requires||
|Overrides||
|Description|create tiddlers from CSV data|
CSV FORMAT:
title,created,modified,modifier,text,tags,field1,field2,field3,...
* first line contains lower-case 'field names' and must include a 'title' field
* subsequent lines contain corresponding CSV-encoded, comma-separated data values
* 'tags' are entered as a space-separated bracketed list
* other items ("fieldN") are added as custom fields
SAMPLE/TEST DATA (paste into 2nd line of input)
a,"b is ""quoted"", with a comma","c",d is not quoted,"e is quoted no comma",f,g,h,"i is, with a comma",j,k
REVISIONS:
[1.1.0] handle CSV-encoded embedded commas and quotes
%/<<tiddler HideTiddlerTags>>{{small smallform{
Enter/paste CSV data below... or, read data from a tiddler: <html><hide linebreaks>
<form style='display:inline;margin:0;padding:0;'>
<input class='editor' name='tid' value='TiddlerName' title='enter a tiddler name'>
<input type='button' value='get data'
onclick="this.form.src.value=store.getTiddlerText(this.form.tid.value,'')">
<input type='button' value='create tiddlers' onclick="
var lines=this.form.src.value.split('\n');
var names=lines[0].split(','); var count=0;
var quoted=/\x22((?:[^\x22]|\x22\x22)*?)\x22/g;
for (var i=1; i<lines.length; i++) {
if (!lines[i].length) continue;
var title=''; var text=''; var tags=[]; var fields={};
var created=null; var when=new Date(); var who=config.options.txtUserName;
var line=lines[i].replace(quoted,
function(x){ return x.substr(1,x.length-2).replace(/\,/g,'!~~!'); });
var values=line.split(','); for (var v=0; v<values.length; v++)
values[v]=values[v].replace(/!~~!/g,',').replace(/\x22\x22/g,'\x22');
for (var v=0; v<values.length; v++) { var val=values[v];
if (names[v]) switch(names[v].toLowerCase()) {
case 'title': title=val.replace(/\[\]\|/g,'_'); break;
case 'created': created=val; break;
case 'modified':when=val; break;
case 'modifier':who=val; break;
case 'text': text=val; break;
case 'tags': tags=val.readBracketedList(); break;
default: fields[names[v].toLowerCase()]=val; break;
}
}
if (title.length) {
store.saveTiddler(title,title,text,who,when,tags,fields,true,created||when);
displayMessage('Created '+title);
count++;
}
else if (!confirm('invalid data on line '+i+': missing/blank TiddlerName\n\n'
+values.join('\n')+'\n\n\OK=skip, CANCEL=stop')) break;
}
displayMessage('Created '+count+' tiddlers');
"><br><textarea class='editor' name='src' style='display:inline;width:100%;height:10em;'></textarea>
</form>
</html>}}}
Eksempel på en regnearksOpstilling:
|title|text|tags|felt1|felt2|felt3|...|h
|Test1|Dette er [[Test1]]|test et foo|mumle|grynt|fnys|
|Test2|Dette er [[Test2]]|test to bar|snork|snøvle|pludder |
* Første linjer indeholder 'feltnavne' med små bogstaver og skal indeholde et 'titel' felt
* 'tekst' feltet er normalt tiddler tekst(body)indhold.//@@color(#cc3300):NB!: Kan IKKE indeholde komma!!@@//
* 'tags' er en med mellemrum - eller firkantede parenteser separeret liste (dvs. på samme måde, som når man redigerer en tiddler)
* Andre områder (valgfrie) bliver tilføjet som brugerdefinerede felter
<html><div align="center"><iframe src="http://spreadsheets.google.com/ccc?key=pqdy--SaXp5wwjIoujXgGbQ" frameborder="0" width="100%" height="600"></iframe></div></html>
Elgg - En social network løsning, der kan køres lokalt - minder om Facebook.
http://elgg.org
----
Min BlogTing...
http://twgroup.tiddlyspot.com
----
Oversigt over mine TWs
http://twspot.tiddlyspot.com
----
Den "gamle" elevliste
http://gdsskole.tiddlyspot.com
----
Den mobile elevliste fra i år
http://måns.dk/weekend
----
Den mobile elevliste til næste år:
http://måns.dk/0910
----
Dansk opgivelser leveret i en TW:
http://opgivelser.tiddlyspot.com
----
Kristendomsopgivelser leveret i en TW:
http://kristendom.tiddlyspot.com
----
Kristendomsoplæg leveret i en TW(kræver kode):
http://kristendoms.tiddlyspot.com
----
<<tiddler Links>>
++++[Browser]<<miniBrowser LinkSamling>>===
<script label="L2T" title="List2Tags">
var here=story.findContainingTiddler(place);
if (!here) return;
var title=here.getAttribute("tiddler");
var tiddler=store.getTiddler(title);
var t=store.getTiddlerText(tiddler.title) ;
var target = store.getTiddler(tiddler.title) ;
var taglist = t.split('\n') ;
for(var i=0 ; i < taglist.length ; i++) {
if ( taglist[i] && ! target.tags.contains(taglist[i]) )
target.tags.push( taglist[i] ) ;
}
return 'Liste er overført til tags - klik redigér og færdig i tiddleren' ;
</script>
<script label="L2T&Hold" title="List2Tags&Hold">
var tid=prompt("Skriv navnet på det nye hold","");
if (!tid || !tid.length) return;
var txt="";
var who=config.options.txtUserName;
var when=new Date();
var tags=['Fag'];
var initialer=prompt("Skriv lærerens initialer","");
if (!initialer || !initialer.length) return;
var fields={ laerer: initialer };
store.saveTiddler(tid,tid,txt,who,when,tags,fields);
story.displayTiddler(null,tid);
var t=store.getTiddlerText("MMs DK");
var here=story.findContainingTiddler(place);
if (!here) return;
var title=here.getAttribute("tiddler");
var tiddler=store.getTiddler(title);
var target = store.getTiddler(tiddler.title) ;
var taglist = t.split('\n') ;
for(var i=0 ; i < taglist.length ; i++) {
if ( taglist[i] && ! target.tags.contains(taglist[i]) )
target.tags.push( taglist[i] ) ;
}
return 'Liste er overført til tags - klik redigér og færdig i tiddleren' ;
</script>
/***
|Name|ListboxPlugin|
|Source|http://www.TiddlyTools.com/#ListboxPlugin|
|Documentation|http://www.TiddlyTools.com/#ListboxPluginInfo|
|Version|1.2.3|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|set tiddler fields by selecting from a listbox or 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
<<<
2009.06.15 [1.2.3] in setFieldValue(), eliminate extra tiddly brackets around single value selections
|please see [[ListboxPluginInfo]] for additional revision details|
2007.05.12 [0.5.0] started
<<<
!!!!!Code
***/
//{{{
version.extensions.ListboxPlugin= {major: 1, minor: 2, revision: 3, date: new Date(2009,6,15)};
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.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.substr(0,1)=="=") { // get items from tagged tiddlers
var tids=store.getTaggedTiddlers(p.substr(1));
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, 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'),
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, 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=!allowMultiple?[v]:v.toString().readBracketedList();
}
// add 'no value' item
if (!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 (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+'"'+' 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 label=config.macros.select.otherLabel;
if (here.getAttribute("allowother")=="true" && here.options[here.selectedIndex].text.substr(0,label.length)==label)
here.onchange.apply(here,arguments);
},
onChange:
function(here,event) {
if (here.options[here.selectedIndex].text==config.macros.select.editLabel) {
story.displayTiddler(story.findContainingTiddler(here),here.value,DEFAULT_EDIT_TEMPLATE);
return false;
}
var label=config.macros.select.otherLabel;
if (here.getAttribute("allowother")=="true" && here.options[here.selectedIndex].text.substr(0,label.length)==label) {
var newval=prompt(config.macros.select.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[here.selectedIndex].value=newval;
here.options[here.selectedIndex].text=config.macros.select.otherLabel+": "+newval;
here.value=newval;
}
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(),[]);
// get multi-select items
var values=[]; for (var i=0; i<here.options.length; i++) { var opt=here.options[i];
if (opt.selected && opt.text!=config.macros.select.editLabel)
values.pushUnique(String.encodeTiddlyLink(opt.value));
}
if (values.length==1) values=[here.value]; // remove extra brackets around single value
// set field, 'touch' tiddler and report to user
store.setValue(tid,field,values.length?values.join(' '):null); // if no selections, delete field
var t=store.getTiddler(tid);
store.saveTiddler(tid,tid,t.body,config.options.txtUserName,new Date(),t.tags,t.fields);
if (config.macros.select.verbose)
{ clearMessage(); displayMessage(config.macros.select.changeMsg.format([field,tid,here.value])); }
}
}
//}}}
<<tiddler Tabs4Tags with: "Lister" >>
{{left{
{{wrap{
{{mmheading{Oversigt over lister}}}
<<treeview2 "Lister" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Lister-ID"' >>
/***
|''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);
}
//}}}
{{mmheading{Lokaler}}}<<treeview2 "Lokaler" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Lokaler-ID"' >>
<script>
var out=[]; var fmt='[[%0]]: %1|'; var fmt2='\n|[[%0]]|';
var tids=store.sortTiddlers(store.filterTiddlers("[tag[(Lærere)]]"), "modified");
for (var i=0; i<tids.length; i++) {
out.push(fmt2.format([tids[i].title]));
for (var f in tids[i].fields) out.push(fmt.format
([f,tids[i].fields [f]]));
}
return out.join('|');
</script>
MM
Måns Mårtensson
PS
Petra Shulz
BI
Brynjólfur Þorvarðarson
JA
Jacob Krüger Andersen
BK
Betina Skovbo Korsbæk
DO
Dan Bojer Olesen
ET
Else Thorsen Jensen
HC
Henning Christensen
HM
Henrik Meldgaard
JD
Jesper Dalhoff
JG
Jakob Mols Græsborg
JK
Jørn Knudsen
LM
Lis Madsen
LS
Line Hargreaves
PA
Peter Andersen
SB
Svend Brøndum
SM
Sara Mols Græsborg
TN
Thomas Nederby
TsT
Test Teacher
DK
Dorthe Kjærgaard
|<<wikify [img(6em+,)[%1|%0][%2-Note]] billede@here fuldenavn@here title@here>>| <<wikify "[[send mail|mailto:%0]]" email>> [[mailoversigt|EmailListe]] |
|~|<<tag TelefonListe Tlf:>><<wikify "[[%0|TelefonListe]]" telefon>>|
|~|<<tag Vagt Vagtdag:>><<wikify "[[%0|VagtPlan]]" vagt>> <<tag GangOversigt Gang:>><<wikify "[[%0]]" gang>>|
<<forEachTiddler where 'tiddler.tags.contains("Elev") && tiddler.fields["k-gruppe"] && tiddler.fields["k-gruppe"].contains(context.viewerTiddler.title)'
sortBy 'tiddler.title.toUpperCase()'
script
'
function getFirstLine(s) {
var m = s.match(/\s*(.*)/);
return m != null && m.length >= 1 ? m[1] : "";
}
'
write
'(index < 10)? "|"+(index+1)+"|[["+tiddler.title+"]] | <<tag "+tiddler.fields["gang"]+" \>\> | [["+tiddler.fields["kl"] +"]] | <<toggleTag HU [["+tiddler.title+"]] - \>\> | <<toggleTag Syg [["+tiddler.title+"]] - \>\> | <<checkbox [[hjem@"+tiddler.title+"]]>"+"> | ||[img(3em+,)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | <<editTiddler [["+tiddler.title+"]]$))|@@color(#cc0000):→~~//"+getFirstLine(tiddler.text)+"//~~@@ |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|!<<wikify [[%0]] fuldenavn@here \>\> | | | ||||| <<tiddler OpretNyElevUdtalelseKnap \>\> |h\n"
+"|!| |<<tag GangOversigt Gang \>\>|<<tag Kl \>\>| <<tag HU \>\> | <<tag Syg \>\> | [[Hjem|Hjemme]] |||| |h\n"'
end 'count+" kontaktgruppe elever\n"' none '"ingen kontaktelever \n"'>>
<<newTiddler label: "Ny k-elev" tag:"Elev"{{tiddler.title}} title:"Indskriv navnet på en ny elev her" text:"Klik færdig, derefter rediger og tilføj oplysninger på kortets bagside">>
<<tiddler RefreshTiddler with: "Opfrisk" "Gem ændringer til denne tiddler - hvis online">><html><center>
<td <b>Fast vagtdag:</b><select name=vagt >
<option> Mandag
<option> Tirsdag
<option> Onsdag
<option> Torsdag
<option> Fredag
</select ><b>Ganglærer på:</b> <select name=Gang >
<option>G
<option>K
<option>M
<option>N
<option>P
<option>S
<option>St
<option>T
<option>V
<option>Ø
</select >
</td><table><td valign="top"><b>Telefon:</b></sub>
<input name=Telefon type=text/></td>
</tr></table><td valign="top"><b>Besked - noter:</b>
<TEXTAREA name=besked rows=2 cols=30 ></TEXTAREA><p/></td></tr>
</center></html>
<<forEachTiddler where 'tiddler.tags.contains("Lærere") && tiddler.fields["fuldenavn"]&& tiddler.fields["billede"] '
sortBy 'tiddler.fields["title"]'
write
'(index < 30)? "| "+(index+1)+"|[["+tiddler.fields["fuldenavn"]+"|"+tiddler.title+"]] | [img(3em+,)["+tiddler.fields["fuldenavn"]+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>| <<tiddler K-Grupper\>\> |h\n"
+"|!|!<<tag Lærere Navn \>\> ||h\n"'
end 'count+" stk Lærere\n"' none '"Ingen Lærere\n"'>>
Elever på HU
<<snapshot print label:Udskrift prompt:Udskriv id:viewer>><<fontSize>>
<<tiddler SygeUpdate>>
<<forEachTiddler
where
'tiddler.tags.contains("Lærere")'
sortBy 'tiddler.title'
write
'(index < 200) ? "|"+(index+1)+"|[["+tiddler.title+"]]|"+tiddler.body+"|"+tiddler.tags+"| [["+tiddler.fields["gang"]+"]] |"+tiddler.fields["telefon"]+"|"+tiddler.fields["fuldenavn"]+"|"+tiddler.fields["vagt"]+"|"+tiddler.fields["billede"] +"|\n" : ""'
begin '"|sortable|k\n|!#|title|text|tags|gang|telefon|fuldenavn|vagt|billede|h\n"'
end 'count+" lærere\n"'
none '"Ingen lærere\n"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Lærere")'
sortBy
'tiddler.title.toUpperCase()'
write
'(index < 200) ? ""+(index+1)+("[["+tiddler.title+"]]"" : ", ")+"("+tiddler.body+"" : ", ")+("+tiddler.tags+"" : ", ")+("[["+tiddler.fields["gang"]+"]]"" : ", ")+"("+tiddler.fields["telefon"]+"" : ", ")+"("+tiddler.fields["fuldenavn"]+"" : ", ")+"("+tiddler.fields["vagt"]+"" : ", ")+"+tiddler.fields["billede"] +""'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Lærere")'
sortBy
'tiddler.title.toUpperCase()'
write
'((index == 0) ? "" : ", ")+"[["+tiddler.title+"]]"'
>>
<!--{{{-->
<div class='title' macro='view title'></div>
<div class='toolbar' macro='toolbar +saveTiddler closeOthers -cancelTiddler deleteTiddler wikibar'></div>
<div style='clear:both'></div>
<div class='viewer'>
<table class='borderless' style='width:100%'><tr>
<td style='width:10%'>
<div class='small'>LærerInitialer (tiddler navn):</div>
<div class='editor' macro='select title rows:1 width:100% allowBlank allowOther +LærerListe allowEdit'></div>
<div class='small'>Tlf (må videregives):</div>
<div class='editor' macro='select telefon rows:1 width:100% allowBlank allowOther +TelefonListe allowEdit'></div>
<div class='small'>Ganglærer på:</div>
<div class='editor' macro='select gang rows:1 width:100% allowBlank allowOther +GangListe allowEdit'></div>
<div class='small'>Fast ugentlig vagtdag:</div>
<div class='editor' macro='select vagt rows:1 width:100% allowBlank allowOther Mandag Tirsdag Onsdag Torsdag Fredag Lørdag Søndag '></div>
</td><td style='width:20%'>
<div class='small'>Fulde navn:</div>
<div class='editor' macro='select fuldenavn rows:1 width:100% allowBlank allowOther +LærerListe allowEdit'></div>
<div class='small'>Email:</div>
<div class='editor' macro='select email rows:1 width:100% allowBlank allowOther +EmailListe allowEdit'></div>
<div class='small'>billede URL (jpg/gif):</div>
<div class='editor' macro='edit billede'></div>
</td></table>
<div class='small borderless'><span class='small'>Note (tekst):</span></div>
<div class='editor' macro='edit text 10'></div>
<div class='editor' macro='edit tags'></div>
<div class='toolbar editorFooter' style='text-align:left !important;float:left !important'>
<span macro='message views.editor.tagPrompt'></span><span class macro='newHere label: Adressebog title: {{tiddler.fields.fuldenavn}} tag: {{tiddler.title}} Adressebog text:""' </span>
<span macro='tagChooser'></span>
</div>
<div style='clear:both'></div>
</div><!-- viewer -->
<!--}}}-->
<!--{{{-->
<div <span class macro='snapshot print label:print prompt:Udskriv id:story'><span macro='email to:{{tiddler.fields.email}} permalink:"true"'></span></span></div></span>
<div class='tagClear'></div>
<div <span class='menubox' style='float:center;margin:0em'
<table <span class='viewer'>
<div class='tagClear'></div></span><span class='title'><span macro='wikify "[[%0|Lærere]]" fuldenavn'></span></span><div <span class macro='tiddler TabLærerTabel'></div></div>
</span></span></div>
</td></tr></div>
<div <span class='menubox' style='float:center;margin:0em' macro='notes heading: "NoteArkiv" tag: "NoteArkiv" suffix:"Note"'> </span></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<div class='tagClear'></div>
<!--}}}-->
{{invisibletable{
|>|>|>|>|>|<<tiddler [[Brev til Herdis]]>> |
Kræver password for at kunne læses: <<getTiddlerPassword>>
<html><p>Det ser ud til mit link til "Et udviklingsprojekt" (panelet) indholdt en ødelagt fil.<br /> Jeg har vedhæftet det her i stedet. [[Et udviklingsprojekt|http://dl.getdropbox.com/u/1064531/Et%20udviklingsprojekt-2.pdf]]<br /> Jeg fandt også et par dokumenter, jeg har lavet tidligere i et forsøg på at forklare hvad ElevListerne går ud på...<br /> De er også vedhæftede..</p><p>#[[Den mobile elevliste|http://dl.getdropbox.com/u/1064531/Den%20Mobile%20ElevListe.pdf]]</p><p>#[[ElevListen&Dagbogen|http://dl.getdropbox.com/u/1064531/ElevListen%20nyt%20april%2009.pdf]]<br /> God læsning - og bær over med layout etc.. - Jeg er hverken webdesigner eller grafiker kun lærer...<br /> <br /> Mvh Måns Mårtensson. 25344884<br /> <br /> NB!: Dokumenter og lister er alle ment som interne lister - og har kode på - når jeg ikke viser dem frem som her.<br /> Betragt derfor denne invitation som en "lukket invitation" til at se på tingene (evt. downloade de originale TiddlyWikisider) - om kort tid (ca 14 dage) vil jeg fjerne eller kodeordsbeskytte de lister som er online (pg.a. billeder af elever etc...)<br /> <br /> <br /> -------- Original Message --------</p><table cellspacing="0" cellpadding="0" border="0" class="moz-email-headers-table"> <tbody> <tr> <th valign="baseline" nowrap="nowrap" align="right">Subject:</th> <td>Re: ang.Licensen til skoleplan + et par gode ideer ;-)</td> </tr> <tr> <th valign="baseline" nowrap="nowrap" align="right">Date:</th> <td>Thu, 11 Jun 2009 17:12:09 +0800</td> </tr> <tr> <th valign="baseline" nowrap="nowrap" align="right">From:</th> <td>Måns Mårtensson <a class="moz-txt-link-rfc2396E" href="mailto:mama@himmerlands-ungdomsskole.dk"><mama@himmerlands-ungdomsskole.dk></a></td> </tr> <tr> <th valign="baseline" nowrap="nowrap" align="right">CC:</th> <td><a class="moz-txt-link-abbreviated" href="mailto:mail@skoleplan.dk">mail@skoleplan.dk</a>, <a class="moz-txt-link-abbreviated" href="mailto:allan@fredslund.nu">allan@fredslund.nu</a></td> </tr> <tr> <th valign="baseline" nowrap="nowrap" align="right">References:</th> <td><a class="moz-txt-link-rfc2396E" href="mailto:4A30A3BB.1030704@himmerlands-ungdomsskole.dk"><4A30A3BB.1030704@himmerlands-ungdomsskole.dk></a></td> </tr> </tbody> </table> <p> </p><p>Hej igen</p><p>Et tilbud om assistance- eller blot et par ideer til overvejelse:</p><p>Jeg glemte lige at nævne at jeg selv har lavet nogle forsøg på at lave webapplikationer, til brug for vores efterskole.</p><p>Jeg tænker at I måske kan bruge et par af de ideer jeg har udviklet til noget fornuftigt i jeres arbejde med at lave webinterfaces - og måske ovenikøbet til selve brugerfladen... forbindelse til programdele etc.</p><p>De er alle baseret på <span style="text-decoration: underline;">[[TiddlyWiki|http://tiddlywiki.com]]</span></p><p>. TW er OpenSource (Bsd-licens - v. [[Una-Mesa|http://about.unamesa.org/]] og kan modificeres som man har lyst.</p><p>Det er blot en enkelt htmlfil med javascript, der kan køre lokalt fra netværket, en lokal pc, en usb eller som hjemmeside på nettet. Der er lavet mange varianter over TiddlyWiki som serverbaseret wiki - men det er først og fremmest som enkeltbruger fil den er særligt egnet. (Den kan dog "låses" ved hjælp af et plugin, der sikrer at flere brugere kan åbne filen på een gang, men at det kun er den bruger, der først går i gang med redigering, som kan gemme ændringer. Der kommer en popup som viser at filen er låst af en anden bruger).</p> <p>Jeg har lavet disse applikationer indtil videre:</p><p>1) Den mobile elevliste [[0809|http://xn--mns-ula.dk/weekend]] & [[0910|http://xn--mns-ula.dk/0910]]</p><p>2) Den Store elevliste m. indbygget projekt/mål og opgavemanagement for alle fag [[0809|http://gdsskole.tiddlyspot.com]]</p><p>3) Sidste nye: EfterSkoleLister (ESL) - den mest overskuelige til dato og virker også i InternetExplorer [[0809|http://el0809.tiddlyspot.com]]</p><p><a href="http://el0910.tiddlyspot.com/">0910 (ikke helt færdig endnu</a></p><p>Nr. 2 og 3 er ret "tunge" applikationer fordi de mest er "showcases" med det formål at vise hvor mange muligheder, der er i at bruge TW..</p><p>Ideen er naturligvis at filen skal være så lille som muligt, med færrest mulige scripts og plugins</p><p>Derudover har jeg brugt TiddlyWiki til at lave undervisningmaterialer og til at kommunikere med censorer, kolleger og lærere jeg skal være censor for.</p><p>Et par eksempler:</p> <p><a class="moz-txt-link-freetext" href="http://opgivelser.tiddlyspot.com/">http://opgivelser.tiddlyspot.com</a><br /> <a class="moz-txt-link-freetext" href="http://kristendom.tiddlyspot.com/">http://kristendom.tiddlyspot.com</a><br /> <a class="moz-txt-link-freetext" href="http://kristendoms.tiddlyspot.com/">http://kristendoms.tiddlyspot.com</a></p><p>(+ oplæg - så der kræves kode(kultur) og brugernavn(kristendoms))</p> <p><a class="moz-txt-link-freetext" href="http://edb.tiddlyspot.com/">http://edb.tiddlyspot.com</a><br /> <a class="moz-txt-link-freetext" href="http://behovsanalyse.tiddlyspot.com/">http://behovsanalyse.tiddlyspot.com</a></p><p>For at se en oversigt over mange af de andre applikationer jeg har lavet/designet/sat sammen - se her:</p><p><a class="moz-txt-link-freetext" href="http://twspot.tiddlyspot.com/">http://twspot.tiddlyspot.com</a></p><p>Allan Fredslund, vores konsulent, siger at de ikke ser helt tossede ud (de TiddlyWikiapplikationer jeg har lavet) - og jeg tilbyder gerne at hjælpe med at udforme eventuelle TiddlyWikiapplikationer, som kan levere udskrifter eller egentlige programfunktioner i SkolePlan fra skolens lukkede netværk - indtil I har "rigtige" webmoduler klar.</p> <p>Udover TiddlyWikiapplikationerne har jeg lavet/sammensat et usbprogrampanel (modificeret geekmenu fra portableapps.com), der bl.a. kan starte en Linuxdistro (PuppyLinux) op på en pc uden harddisk. (Det er min situation lige nu ;-)). Linuxen har en windowsemulator installeret, (Der bl.a. gjorde det muligt for mig at afspille jeres eskekverbare demofil) som gør at man kan køre de samme portable programmer fra panelet, som man kan, når man bruger panelet i Windows. (Open Office, FireFox mmm.) Linuxen er udviklet til at være persistent når den bliver brugt inde i Windows (emuleres med Qemu) og er derfor meget anvendelig - også når ens harddisk ikke er i stykker - og man bruger Windows.</p><p>Jeg har lavet en lille reklame for panelet, der er kraftigt motiveret/inspireret af en af de Iteo reklamer vi har fået ind af døren på et tidspunkt.</p> <p><a href="http://dl.getdropbox.com/u/1064531/Et%20udviklingsprojekt.pdf">Reklame for panelet</a></p><p>Jeg forestiller mig at det er muligt at udvikle noget fornuftigt ved kombination af nogle af de ovenstående applikationer - og hvis du/I skulle have nogle ideer til hvad jeg kunne bidrage med i den forbindelse - så sig endelig til.</p></html>
<<editTiddler {{tiddler.title}}>> <<wikify %0 text>> eller skriv her: [[Jobmail]]
<script>
/*<![CDATA[*/
/***********************************************
* Encrypt Email script- Please keep notice intact
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/
<!-- Encrypted version of: humamamm [at] *****.*** //-->
var emailriddlerarray=[104,117,109,97,109,97,109,109,64,103,109,97,105,108,46,99,111,109]
var encryptedemail_id12='' //variable to contain encrypted email
for (var i=0; i<emailriddlerarray.length; i++)
encryptedemail_id12+=String.fromCharCode(emailriddlerarray[i])
document.write('<a href="mailto:'+encryptedemail_id12+'?subject=Send mail til Måns">Mail</a>')
/*]]>*/
</script>
{{left{
{{wrap{
{{mmheading{[[Mails]]}}}
<<treeview2 "Mails" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Mails-ID"' >>
Type the text for 'New Tiddler'
{{center{
<<tiddler HjemKnap>>
{{left{
<<tabs ""[[Info]] "Information" Info&Blog [[Lister]] "Syge, Weekendtilmelding og Hjemme" [[Meldinger]] [[K-grp]] "Alle K-grupper" TabKontaktGrupper [[Fag]] "Alle fag" [[TabFag]][[Alle]] "Alle Lister på een gang NB! den er laangsom" [[Lister]] >>
{{center{<html><a href="http://esl.tiddlyspot.com/download">^^Hent en kopi ^^[img[http://www.symbex.net.au/Wiki/images/disk.gif]]^^ til dig selv^^</a><br></html>[[Tak til ... & licens]]
[[Kontakt Måns]]
[[Originalen|http://twt-treeview.tiddlyspot.com/]]
+++[nye tiddlere]
<<newTiddler "New Tiddler">>
<<tiddler NewHTMLFromTemplate>>
<<tiddler NewIframeFromTemplate>>
<<tiddler NewObjectFromTemplate>>
<<tiddler NewScriptTiddler>>
<<tiddler NewSliderFromTemplate>>
<<tiddler NewSystemConfigTiddler>>
<<tiddler NewTableFromTemplate>>
<<tiddler NewTabsFromTemplate>>
===
<script>
/*
* Treeview 1.4 - jQuery plugin to hide and show branches of a tree
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
*
*/
;(function($) {
$.extend($.fn, {
swapClass: function(c1, c2) {
var c1Elements = this.filter('.' + c1);
this.filter('.' + c2).removeClass(c2).addClass(c1);
c1Elements.removeClass(c1).addClass(c2);
return this;
},
replaceClass: function(c1, c2) {
return this.filter('.' + c1).removeClass(c1).addClass(c2).end();
},
hoverClass: function(className) {
className = className || "hover";
return this.hover(function() {
$(this).addClass(className);
}, function() {
$(this).removeClass(className);
});
},
heightToggle: function(animated, callback) {
animated ?
this.animate({ height: "toggle" }, animated, callback) :
this.each(function(){
jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
if(callback)
callback.apply(this, arguments);
});
},
heightHide: function(animated, callback) {
if (animated) {
this.animate({ height: "hide" }, animated, callback);
} else {
this.hide();
if (callback)
this.each(callback);
}
},
prepareBranches: function(settings) {
if (!settings.prerendered) {
// mark last tree items
this.filter(":last-child:not(ul)").addClass(CLASSES.last);
// collapse whole tree, or only those marked as closed, anyway except those marked as open
this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide();
}
// return all items with sublists
return this.filter(":has(>ul)");
},
applyClasses: function(settings, toggler) {
this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) {
toggler.apply($(this).next());
}).add( $("a", this) ).hoverClass();
if (!settings.prerendered) {
// handle closed ones first
this.filter(":has(>ul:hidden)")
.addClass(CLASSES.expandable)
.replaceClass(CLASSES.last, CLASSES.lastExpandable);
// handle open ones
this.not(":has(>ul:hidden)")
.addClass(CLASSES.collapsable)
.replaceClass(CLASSES.last, CLASSES.lastCollapsable);
// create hitarea
this.prepend("<div class=\"" + CLASSES.hitarea + "\"/>").find("div." + CLASSES.hitarea).each(function() {
var classes = "";
$.each($(this).parent().attr("class").split(" "), function() {
classes += this + "-hitarea ";
});
$(this).addClass( classes );
});
}
// apply event to hitarea
this.find("div." + CLASSES.hitarea).click( toggler );
},
treeview: function(settings) {
settings = $.extend({
cookieId: "treeview"
}, settings);
if (settings.add) {
return this.trigger("add", [settings.add]);
}
if ( settings.toggle ) {
var callback = settings.toggle;
settings.toggle = function() {
return callback.apply($(this).parent()[0], arguments);
};
}
// factory for treecontroller
function treeController(tree, control) {
// factory for click handlers
function handler(filter) {
return function() {
// reuse toggle event handler, applying the elements to toggle
// start searching for all hitareas
toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() {
// for plain toggle, no filter is provided, otherwise we need to check the parent element
return filter ? $(this).parent("." + filter).length : true;
}) );
return false;
};
}
// click on first element to collapse tree
$("a:eq(0)", control).click( handler(CLASSES.collapsable) );
// click on second to expand tree
$("a:eq(1)", control).click( handler(CLASSES.expandable) );
// click on third to toggle tree
$("a:eq(2)", control).click( handler() );
}
// handle toggle event
function toggler() {
$(this)
.parent()
// swap classes for hitarea
.find(">.hitarea")
.swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )
.end()
// swap classes for parent li
.swapClass( CLASSES.collapsable, CLASSES.expandable )
.swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
// find child lists
.find( ">ul" )
// toggle them
.heightToggle( settings.animated, settings.toggle );
if ( settings.unique ) {
$(this).parent()
.siblings()
// swap classes for hitarea
.find(">.hitarea")
.replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )
.end()
.replaceClass( CLASSES.collapsable, CLASSES.expandable )
.replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
.find( ">ul" )
.heightHide( settings.animated, settings.toggle );
}
}
function serialize() {
function binary(arg) {
return arg ? 1 : 0;
}
var data = [];
branches.each(function(i, e) {
data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0;
});
$.cookie(settings.cookieId, data.join("") );
}
function deserialize() {
var stored = $.cookie(settings.cookieId);
if ( stored ) {
var data = stored.split("");
branches.each(function(i, e) {
$(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ]();
});
}
}
// add treeview class to activate styles
this.addClass("treeview");
// prepare branches and find all tree items with child lists
var branches = this.find("li").prepareBranches(settings);
switch(settings.persist) {
case "cookie":
var toggleCallback = settings.toggle;
settings.toggle = function() {
serialize();
if (toggleCallback) {
toggleCallback.apply(this, arguments);
}
};
deserialize();
break;
case "location":
var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); });
if ( current.length ) {
current.addClass("selected").parents("ul, li").add( current.next() ).show();
}
break;
}
branches.applyClasses(settings, toggler);
// if control option is set, create the treecontroller and show it
if ( settings.control ) {
treeController(this, settings.control);
$(settings.control).show();
}
return this.bind("add", function(event, branches) {
$(branches).prev()
.removeClass(CLASSES.last)
.removeClass(CLASSES.lastCollapsable)
.removeClass(CLASSES.lastExpandable)
.find(">.hitarea")
.removeClass(CLASSES.lastCollapsableHitarea)
.removeClass(CLASSES.lastExpandableHitarea);
$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler);
});
}
});
// classes used by the plugin
// need to be styled via external stylesheet, see first example
var CLASSES = $.fn.treeview.classes = {
open: "open",
closed: "closed",
expandable: "expandable",
expandableHitarea: "expandable-hitarea",
lastExpandableHitarea: "lastExpandable-hitarea",
collapsable: "collapsable",
collapsableHitarea: "collapsable-hitarea",
lastCollapsableHitarea: "lastCollapsable-hitarea",
lastCollapsable: "lastCollapsable",
lastExpandable: "lastExpandable",
last: "last",
hitarea: "hitarea"
};
// provide backwards compability
$.fn.Treeview = $.fn.treeview;
})(jQuery);
</script>
<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=4793024;
var sc_invisible=1;
var sc_partition=54;
var sc_click_stat=1;
var sc_security="a9269ce8";
</script>
<script type="text/javascript"
src="http://www.statcounter.com/counter/counter.js"></script>
<!-- End of StatCounter Code -->
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<script type="text/javascript" src="http://maans.newp.dk/fckeditor/fckeditor.js"></script>
<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>ElevLister 0809</b> hentes<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Bruger Javascript - bedst i Firefox.</span>
<link rel="shortcut icon" href="http://maans.newp.dk/Billeder/images/notebook.gif" type="image/vnd.microsoft.icon" />
<link rel="icon" href="http://maans.newp.dk/Billeder/images/notebook.gif" type="image/vnd.microsoft.icon" /> </div>
<!--}}}-->
/***
|Name|MatchTagsPlugin|
|Source|http://www.TiddlyTools.com/#MatchTagsPlugin|
|Documentation|http://www.TiddlyTools.com/#MatchTagsPluginInfo|
|Version|2.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|'tag matching' with full boolean expressions (AND, OR, NOT, and nested parentheses)|
!!!!!Documentation
> see [[MatchTagsPluginInfo]]
!!!!!Revisions
<<<
2008.09.04 [2.0.0] added "report" and "panel" options to generate formatted results and store in a tiddler. Also, added config.macros.matchTags.formatList(place,fmt,sep) API to return formatted output for use with other plugins/scripts
| please see [[MatchTagsPluginInfo]] for additional revision details |
2008.02.28 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.MatchTagsPlugin= {major: 2, minor: 0, revision: 0, date: new Date(2008,9,4)};
// store.getMatchingTiddlers() processes boolean expressions for tag matching
// sortfield (optional) sets sort order for tiddlers - default=title
// tiddlers (optional) use alternative set of tiddlers (instead of current store)
TiddlyWiki.prototype.getMatchingTiddlers = function(tagexpr,sortfield,tiddlers) {
var debug=config.options.chkDebug; // abbreviation
var cmm=config.macros.matchTags; // abbreviation
var r=[]; // results are an array of tiddlers
var tids=tiddlers||store.getTiddlers(sortfield||"title");
if (tiddlers && sortfield) store.sortTiddlers(tids,sortfield);
if (debug) displayMessage(cmm.msg1.format([tids.length]));
// try simple lookup to quickly find single tags or tags that
// contain boolean operators as literals, e.g. "foo and bar"
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged(tagexpr)) r.pushUnique(tids[t]);
if (r.length) {
if (debug) displayMessage(cmm.msg4.format([r.length,tagexpr]));
return r;
}
// convert expression into javascript code with regexp tests,
// so that "tag1 AND ( tag2 OR NOT tag3 )" becomes
// "/\~tag1\~/.test(...) && ( /\~tag2\~/.test(...) || ! /\~tag3\~/.test(...) )"
// normalize whitespace, tokenize operators, delimit with "~"
var c=tagexpr.trim(); // remove leading/trailing spaces
c = c.replace(/\s+/ig," "); // reduce multiple spaces to single spaces
c = c.replace(/\(\s?/ig,"~(~"); // open parens
c = c.replace(/\s?\)/ig,"~)~"); // close parens
c = c.replace(/(\s|~)?&&(\s|~)?/ig,"~&&~"); // &&
c = c.replace(/(\s|~)AND(\s|~)/ig,"~&&~"); // AND
c = c.replace(/(\s|~)?\|\|(\s|~)?/ig,"~||~"); // ||
c = c.replace(/(\s|~)OR(\s|~)/ig,"~||~"); // OR
c = c.replace(/(\s|~)?!(\s|~)?/ig,"~!~"); // !
c = c.replace(/(^|~|\s)NOT(\s|~)/ig,"~!~"); // NOT
c = c.replace(/(^|~|\s)NOT~\(/ig,"~!~("); // NOT(
// change tag terms to regexp tests
var terms=c.split("~"); for (var i=0; i<terms.length; i++) { var t=terms[i];
if (/(&&)|(\|\|)|[!\(\)]/.test(t) || t=="") continue; // skip operators/parens/spaces
if (t==config.macros.matchTags.untaggedKeyword)
terms[i]="tiddlertags=='~~'"; // 'untagged' tiddlers
else
terms[i]="/\\~"+t+"\\~/.test(tiddlertags)";
}
c=terms.join(" ");
if (debug) { displayMessage(cmm.msg2.format([tagexpr])); displayMessage(cmm.msg3.format([c])); }
// scan tiddlers for matches
for (var t=0; t<tids.length; t++) {
// assemble tags from tiddler into string "~tag1~tag2~tag3~"
var tiddlertags = "~"+tids[t].tags.join("~")+"~";
try { if(eval(c)) r.push(tids[t]); } // test tags
catch(e) { // error in test
displayMessage(cmm.msg2.format([tagexpr]));
displayMessage(cmm.msg3.format([c]));
displayMessage(e.toString());
break; // skip remaining tiddlers
}
}
if (debug) displayMessage(cmm.msg4.format([r.length,tagexpr]));
return r;
}
//}}}
//{{{
config.macros.matchTags = {
msg1: "scanning %0 input tiddlers",
msg2: "looking for '%0'",
msg3: "using expression: '%0'",
msg4: "found %0 tiddlers matching '%1'",
noMatch: "no matching tiddlers",
untaggedKeyword: "-",
untaggedLabel: "no tags",
untaggedPrompt: "show tiddlers with no tags",
defTiddler: "MatchingTiddlers",
defFormat: "%0",
defSeparator: "\n",
reportHeading: "Found %0 tiddlers tagged with: '{{{%1}}}'\n----\n",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var mode=params[0]?params[0].toLowerCase():'';
if (mode=="inline")
params.shift();
if (mode=="report" || mode=="panel") {
params.shift();
var target=params.shift()||this.defTiddler;
}
if (mode=="popup") {
params.shift();
if (params[0]&¶ms[0].substr(0,6)=="label:") var label=params.shift().substr(6);
if (params[0]&¶ms[0].substr(0,7)=="prompt:") var prompt=params.shift().substr(7);
} else {
var fmt=(params.shift()||this.defFormat).unescapeLineBreaks();
var sep=(params.shift()||this.defSeparator).unescapeLineBreaks();
}
var sortBy="+title";
if (params[0]&¶ms[0].substr(0,5)=="sort:") sortBy=params.shift().substr(5);
var expr = params.join(" ");
if (mode!="panel" && (!expr||!expr.trim().length)) return;
if (expr==this.untaggedKeyword)
{ var label=this.untaggedLabel; var prompt=this.untaggedPrompt };
switch (mode) {
case "popup": this.createPopup(place,label,expr,prompt,sortBy); break;
case "panel": this.createPanel(place,expr,fmt,sep,sortBy,target); break;
case "report": this.createReport(target,expr,fmt,sep,sortBy); break;
case "inline": default: this.createInline(place,expr,fmt,sep,sortBy); break;
}
},
formatList: function(tids,fmt,sep) {
var out=[];
for (var t=0; t<tids.length; t++) {
var title="[["+tids[t].title+"]]";
var who=tids[t].modifier;
var when=tids[t].modified.toLocaleString();
var text=tids[t].text;
var first=tids[t].text.split("\n")[0];
var desc=store.getTiddlerSlice(tids[t].title,"description");
desc=desc||store.getTiddlerSlice(tids[t].title,"Description");
desc=desc||store.getTiddlerText(tids[t].title+"##description");
desc=desc||store.getTiddlerText(tids[t].title+"##Description");
out.push(fmt.format([title,who,when,text,first,desc]));
}
return out.join(sep);
},
createInline: function(place,expr,fmt,sep,sortBy) {
wikify(this.formatList(store.sortTiddlers(store.getMatchingTiddlers(expr),sortBy),fmt,sep),place);
},
createPopup: function(place,label,expr,prompt,sortBy) {
var btn=createTiddlyButton(place,
(label||expr).format([expr]),
(prompt||config.views.wikified.tag.tooltip).format([expr]),
function(ev){ return config.macros.matchTags.showPopup(this,ev||window.event); });
btn.setAttribute("sortBy",sortBy);
btn.setAttribute("expr",expr);
},
showPopup: function(here,ev) {
var p=Popup.create(here); if (!p) return false;
var tids=store.getMatchingTiddlers(here.getAttribute("expr"));
store.sortTiddlers(tids,here.getAttribute("sortBy"));
var list=[]; for (var t=0; t<tids.length; t++) list.push(tids[t].title);
if (!list.length) createTiddlyText(p,this.noMatch);
else {
var b=createTiddlyButton(createTiddlyElement(p,"li"),
config.views.wikified.tag.openAllText,
config.views.wikified.tag.openAllTooltip,
function() {
var list=this.getAttribute("list").readBracketedList();
story.displayTiddlers(null,tids);
});
b.setAttribute("list","[["+list.join("]] [[")+"]]");
createTiddlyElement(p,"hr");
}
var out=this.formatList(tids," %0 ","\n"); wikify(out,p);
Popup.show(p,false);
ev.cancelBubble=true;
if(ev.stopPropagation) ev.stopPropagation();
return false;
},
createReport: function(target,expr,fmt,sep,sortBy) {
var tids=store.sortTiddlers(store.getMatchingTiddlers(expr),sortBy);
if (!tids.length) { displayMessage('no matches for: '+expr); return false; }
var msg=config.messages.overwriteWarning.format([target]);
if (store.tiddlerExists(target) && !confirm(msg)) return false;
var out=this.reportHeading.format([tids.length,expr])
out+=this.formatList(tids,fmt,sep);
store.saveTiddler(target,target,out,config.options.txtUserName,new Date(),[],{});
story.closeTiddler(target); story.displayTiddler(null,target);
},
createPanel: function(place,expr,fmt,sep,sortBy,tid) {
var html="<form style='display:inline'><!-- \
--><input type='text' name='expr' style='width:55%' title='tag expression'><!-- \
--><input type='text' name='fmt' style='width:10%' title='list item format'><!-- \
--><input type='text' name='sep' style='width:5%' title='list item separator'><!-- \
--><input type='text' name='tid' style='width:20%' title='target tiddler title'><!-- \
--><input type='button' name='go' style='width:8%' value='go' onclick=\" \
var expr=this.form.expr.value; \
if (!expr.length) { alert('Enter a boolean tag expression'); return false; } \
var fmt=this.form.fmt.value; \
if (!fmt.length) { alert('Enter the list item output format'); return false; } \
var sep=this.form.sep.value.unescapeLineBreaks(); \
var tid=this.form.tid.value; \
if (!tid.length) { alert('Enter a target tiddler title'); return false; } \
config.macros.matchTags.createReport(tid,expr,fmt,sep,'title'); \
return false;\"> \
</form>";
var s=createTiddlyElement(place,"span"); s.innerHTML=html;
var f=s.getElementsByTagName("form")[0];
f.expr.value=expr; f.fmt.value=fmt; f.sep.value=sep.escapeLineBreaks(); f.tid.value=tid;
}
};
//}}}
//{{{
// SHADOW TIDDLER for displaying default panel input form
config.shadowTiddlers.MatchTags="{{smallform{<<matchTags panel>>}}}";
//}}}
//{{{
// TWEAK core filterTiddlers() for enhanced boolean matching in [tag[...]] syntax:
// use getMatchingTiddlers instead getTaggedTiddlers
var fn=TiddlyWiki.prototype.filterTiddlers;
fn=fn.toString().replace(/getTaggedTiddlers/g,"getMatchingTiddlers");
eval("TiddlyWiki.prototype.filterTiddlers="+fn);
//}}}
//{{{
// REDEFINE core handler for enhanced boolean matching in tag:"..." paramifier
// use filterTiddlers() instead of getTaggedTiddlers() to get list of tiddlers.
config.paramifiers.tag = {
onstart: function(v) {
var tagged = store.filterTiddlers("[tag["+v+"]]");
story.displayTiddlers(null,tagged,null,false,null);
}
};
//}}}
<<tiddler Tabs4Tags with: {{tiddler.title}} >>
{{textcenter{@@padding-left:1.2em;+++[Meddelelser]...<<tiddler Tabs4Tags with: {{tiddler.title}} >>+++}}}
<<tabs "" [[Mapper]] "Mapper over alle meldinger" MeldingerMapper [[Syg]] "Syge elever på skolen" TabSyge [[Hjem]] "Elever som er hjemme hos deres forældre"
TabHjemme [[Week]] "Tilmeldte til weekend på skolen" TabHU >>
{{mmheading{Meldinger}}}
<<treeview2 "Meldinger" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Meldinger-ID"' >>
[[►|MenuOptions]]''These are the options that are incorporated'' in the Treeview plugin. For the latest information see the plugin at the author's site
''Note:'' The implementation of Treeview plugin in ~TWT-Treeview may vary slightly from the author's instructions.
----
From the plugin at http://treeview.tiddlyspot.com/.
!!Usage
{{{<<treeview2 }}}> {{{<root tag> [tree style] [startup parameters]}}} {{{ >>}}}
!!Where:
''root tag'' is the tag at the top of your tagging tree, i.e. the mother of all tiddlers related to it by using its name as one of their tags.
''tree style'' indicates which type of tree will be displayed, possibly //treeview//, //filetree//, and //treeview-red//, and //treeview-famfamfam//. There may be other styles too, but those are the ones I know about.
''startup parameters'' are a set of optional parameters given in a comma-separated, key/value string like this:
>{{{'collapsed: false, animated: "normal", persist: true'}}}
There's a list of possible options at:
http://www.dynamicdrive.com/dynamicindex1/treeview/index.htm
However, not all settings may actually work under TW. Mainly, you will probably be interested in controlling the presence of animation, and whether the initial state of the tree is opened or closed.
!!!!Images and stylesheet set-up
The tree is constructed from little bits of images. If you don't want to carry these images in a separate directory, nor reference them remotely, you can embed them in your TW file. To do this, you will need the AttachFilePackage and accompanying plugins from
> www.tiddlytools.com
and you will need the AttachFilePluginFormatters plugin from the same site.
Then import all the tiddlers from this file tagged as treeviewimage . These images are referenced in the StyleSheet. If you import JqueryTreeviewCss from this file, and then put the name in your StyleSheet, the images should be imported without having to access them remotely.
!!!!Persistence
To make persistence work, you will need to have the treeview cookie library loaded. The easiest way to do that is to put:
>{{{<script src="http://www.dynamicdrive.com/dynamicindex1/treeview/lib/jquery.cookie.js" type="text/javascript"></script>}}}
into the MarkupPostBody. However, this technique will only work if you have online access. If you will be working offline, then you will either need to download the cookie library to the same directory as your ~TiddlyWiki file and put the following into your MarkupPostBody:
>>{{{<script src="jquery.cookie.js"></script>}}}
or you will need to put the entire contents of the cookie library into script tags inside the MarkupPostBody.
Then, in any macro that wants its tree to be persistently configured, you will need to use configuration parameter:
>>{{{persist: "cookie", cookieId: "myid"}}}
where //myid// should be an identification that will be unique throughout the entire TW file.
Type the text for 'New Tiddler'
/***
|Name|MiniBrowserPlugin|
|Source|http://www.TiddlyTools.com/#MiniBrowserPlugin|
|Version|1.4.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|PlayerPlugin (optional, recommended)|
|Overrides||
|Options|##Configuration|
|Description|embedded browser-in-browser with favorites lists and media support|
!!!!!Usage
<<<
{{{<<miniBrowser noplayer expand hidecontrols URL TiddlerName TiddlerName TiddlerName...>>}}}
* ''noplayer'' (optional)<br>disables support for embedded media player (using [[PlayerPlugin]], if installed)
* ''expand'' (optional)<br>displays minibrowser controls on two lines instead of one for increased readability, especially when long titles or URLs are displayed.
* ''hidecontrols'' (optional)<br>hide initial display of minibrowser controls (except for 'show controls' checkbox)<br>//note: if no initial URL is specified, controls will be shown anyway//
* ''URL'' (optional)<br>specifies an initial URL to open when the mini browser is rendered
* ''TiddlerName'', ''TiddlerName''... (optional)<br>indicates one or more tiddlers containing "HR-separated" lists of favorites.<br>//notes: if no tiddler is specified, [[MiniBrowserList]] is used by default. In addition, when adding/deleting favorites, the plugin automatically updates [[MiniBrowserList]], regardless of any alternative lists of favorites stored in separate tiddlers. After changes to [[MiniBrowserList]] are made, you can then use cut/paste to manually move entries from that tiddler into other tiddlers.//
<<<
!!!!!Configuration
<<<
Default mini browser size:
width: <<option txtMiniBrowserWidth>> height: <<option txtMiniBrowserHeight>>
<<<
!!!!!Example
>{{{<<miniBrowser>>}}}<br>{{smallform small{<<miniBrowser>>}}}
>{{{<<miniBrowser expand>>}}}<br>{{smallform small{<<miniBrowser expand>>}}}
>{{{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}<br>{{smallform small{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}
!!!!!Revisions
<<<
2008.09.30 [1.4.0] removed hard-coded 8pt fontsize. Added optional "expand" display mode to show controls on two lines instead of one for increased readability.
2008.09.16 [1.3.1] fixed getWikifiedData() when using IE (remove \r and multiple \n)
2008.08.12 [1.3.0] added support for wikifying content from favorites lists to enable use of forEachTiddler or inline script output to generate lists on the fly.
2008.08.06 [1.2.2] corrected size control buttons to use fixed width
2008.04.07 [1.2.1] added txtMiniBrowserWidth and txtMiniBrowserHeight. cleanup init handling (somewhat)
2008.04.06 [1.2.0] added support for specifying initial URL to view (suggested by Richard Berg). When opening a URL, select matching entry (if any) in bookmarks droplist. Added support for hiding minibrowser controls.
2008.01.19 [1.1.0] added support for optional extra favorites lists stored in separate tiddlers
2007.10.15 [1.0.0] combined MiniBrowser and MediaCenter inline scripts and converted to true plugin
2006.03.01 [0.0.0] inline script
<<<
!!!!!Code
***/
//{{{
version.extensions.MiniBrowserPlugin={major: 1, minor: 4, revision: 0, date: new Date(2008,9,30)};
//}}}
//{{{
config.shadowTiddlers.MiniBrowser="<<miniBrowser>>";
//}}}
//{{{
if (config.options.txtMiniBrowserWidth==undefined) config.options.txtMiniBrowserWidth="100%";
if (config.options.txtMiniBrowserHeight==undefined) config.options.txtMiniBrowserHeight="480";
//}}}
//{{{
config.macros.miniBrowser= {
favoritesList:
"MiniBrowserList",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var noPlayer=params[0]&¶ms[0].toLowerCase()=="noplayer"; if (noPlayer) params.shift();
if (!config.macros.player) noPlayer=true; // if PlayerPlugin not installed
var expand=params[0]&¶ms[0].toLowerCase()=="expand"; if (expand) params.shift();
var hideControls=params[0]&¶ms[0].toLowerCase()=="hidecontrols"; if (hideControls) params.shift();
var url=(params[0]&&!store.tiddlerExists(params[0]))?params.shift():"";
hideControls=hideControls&&url.length; // if no initial URL, then show controls anyway
var w=config.options.txtMiniBrowserWidth;
var h=config.options.txtMiniBrowserHeight;
// create form
var guid=new Date().getTime()+Math.random().toString(); // globally unique ID
var html=this.html;
html=html.replace(/%id%/g,guid);
html=html.replace(/%noplayer%/g,noPlayer?"true":"");
html=html.replace(/%hidecontrols%/g,hideControls?"none":"block");
html=html.replace(/%bookmarksize%/g,expand?"70%":"20%");
html=html.replace(/%urlsize%/g,expand?"69.5%":"20%");
html=html.replace(/%linebreak%/g,expand?"<br>":"");
html=html.replace(/%favorites%/g,params[0]||config.macros.miniBrowser.favoritesList);
createTiddlyElement(place,"span").innerHTML=html;
// init form
document.getElementById("minibrowser_controls_"+guid).style.display=hideControls?"none":"block";
document.getElementById("minibrowser_resize_"+guid).style.display=hideControls?"none":"block";
document.getElementById("minibrowser_togglecontrols_"+guid).checked=!hideControls;
document.getElementById("minibrowser_form_"+guid).url.value=url;
document.getElementById("minibrowser_form_"+guid).w.value=w;
document.getElementById("minibrowser_form_"+guid).h.value=h;
if (noPlayer) { // hide "type" list no PlayerPlugin
document.getElementById("minibrowser_type_"+guid).style.display="none";
document.getElementById("minibrowser_url_"+guid).style.width="36%";
}
// load bookmarks droplist from HR-separated tiddler contents
var b=document.getElementById("minibrowser_bookmarks_"+guid);
while (b.options[1]) b.options[1]=null; // clear list but leave 'prompt' item
var p; while (p=params.shift()) this.getFavorites(b,p); // load custom bookmarks
if (b.length<2) this.getFavorites(b,config.macros.miniBrowser.favoritesList); // default list
// load initial URL (if any)
var place=document.getElementById("minibrowser_player_"+guid);
this.load(place,guid,"","",w,h,true,noPlayer);
this.go(document.getElementById("minibrowser_form_"+guid));
},
getFavorites: function(list,tid) {
var txt=store.getTiddlerText(tid); if (!txt||!txt.trim().length) return;
txt=this.getWikifiedData(txt);
var parts=txt.split("\n----\n");
for (var p=0; p<parts.length; p++) {
var lines=parts[p].split("\n");
var label=lines.shift()||""; // 1st line=display text
var value=lines.shift()||""; // 2nd line=item value
var indent=value&&value.length?"\xa0\xa0":"";
list.options[list.length]=new Option(indent+label,value,false,false);
}
},
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.replace(/\r*/g,"").replace(/\n\n/g,"\n");
},
load: function(place,id,type,url,w,h,showcontrols,noPlayer) {
if (noPlayer) {
if (!place) place=document.getElementById(id).parentNode;
place.innerHTML="<iframe name='"+id+"' id='"+id+"' \
src='"+url+"' width='"+w+"' height='"+h+"' \
style='background:#fff;border:1px solid'></iframe>"
} else
config.macros.player.loadURL(place,id,type,url,w,h,showcontrols);
},
go: function(f) {
var url=f.url.value.trim();
if (!url.length) url=f.url.value=f.bookmarks.value.trim();
if (!url.length) { this.done(f); return false; }
var id=f.playerID.value;
document.getElementById("minibrowser_player_"+id).style.display="block";
document.getElementById("minibrowser_controls2_"+id).style.display="block";
this.load(null,id,f.type.value,f.url.value,f.w.value,f.h.value,f.ctrls.checked,f.noPlayer.value=="true");
var matched=false; for (var i=0; i<f.bookmarks.options.length; i++) // select matching bookmark
if (f.bookmarks.options[i].value==url) { f.bookmarks.selectedIndex=i; matched=true; break; }
if (!matched) f.bookmarks.selectedIndex=0;
f.done.disabled=false;
return false;
},
done: function(f) {
var id=f.playerID.value;
this.load(null,id,null,null,f.w.value,0,f.ctrls.checked,f.noPlayer.value=="true");
document.getElementById("minibrowser_player_"+id).style.display="none";
document.getElementById("minibrowser_controls2_"+id).style.display="none";
f.done.disabled=true;
return false;
},
fit: function(place) {
var trim=89; // fudge factor to account for the other controls + padding + borders. ADJUST THIS VALUE TO FIT LAYOUT
var t=story.findContainingTiddler(place);
if (!t) { t=place; while (t && t.className!='floatingPanel') t=t.parentNode; } if (!t) return;
var w="100%"; // horizontal stretching via CSS works, but vertical stretching doesn't... so:
var h=t.offsetHeight-trim; // workaround: get containing panel/tiddler height and subtract "trim" height
var f=place.form;
this.load(null,f.playerID.value,f.type.value,f.url.value,w,h,f.ctrls.checked,f.noPlayer.value=="true"); // reload player with new size
place.form.w.value=w; place.form.h.value=h; // update width/height input fields
},
add: function(place,title) {
var v=place.value; if (!v.length) return;
var d=prompt("Please enter a description for\n"+place.value); if (!d || !d.length) return;
var who=config.options.txtUserName;
var when=new Date();
var tid=store.getTiddler(title);
var txt="%0\n%1\n----\n%2".format([d,v,tid?tid.text:""]);
store.saveTiddler(title,title,txt,who,when,tid?tid.tags:[],tid?tid.fields:{});
if (!tid) story.displayTiddler(story.findContainingTiddler(place),title);
else story.refreshTiddler(title,1,true);
var here=story.findContainingTiddler(place);
if (here) story.refreshTiddler(here.getAttribute("tiddler"),1,true);
},
del: function(place,title) {
var v=place.value; if (!v.length) return;
var d=place.options[place.selectedIndex].text; if (!d.length) return;
if (!confirm("Are you sure you want to remove this favorite?\n\n"+d+"\n"+v)) return;
var tid=store.getTiddler(title); if (!tid) return;
var who=config.options.txtUserName;
var when=new Date();
var pat='%0\n%1\n----\n'.format([d.replace(/\xa0/g,''),v]); var re=new RegExp(pat,"i");
var txt=tid.text.replace(re,"");
store.saveTiddler(title,title,txt,who,when,tid?tid.tags:[],tid?tid.fields:{});
story.refreshTiddler(title,1,true);
var here=story.findContainingTiddler(place);
if (here) story.refreshTiddler(here.getAttribute("tiddler"),1,true);
},
html: "<form id='minibrowser_form_%id%' style='display:block;margin:0;padding:0' onsubmit='return config.macros.miniBrowser.go(this);'><!-- \
--><nobr><input type='hidden' name='playerID' value='%id%'><input type='hidden' name='noPlayer' value='%noplayer%'><!-- \
--><div id='minibrowser_controls_%id%' style='display:%hidecontrols%'><!-- \
--><input type='button' value='<' title='back' style='width:3%' \
onclick='try{window.frames[\"player_%id%\"].history.go(-1)}catch(e){window.history.go(-1)}' ><!-- \
--><input type='button' value='>' title='forward' style='width:3%' \
onclick='try{window.frames[\"player_%id%\"].history.go(+1)}catch(e){window.history.go(+1)}'><!-- \
--><input type='button' value='+' title='refresh'style='width:3%' \
onclick='try{window.frames[\"player_%id%\"].location.reload()}catch(e){;}'><!-- \
--><input type='button' value='x' title='stop'style='width:3%' \
onclick='window.stop()'><!-- \
--><select name='bookmarks' id='minibrowser_bookmarks_%id%' size='1' style='width:%bookmarksize%' \
onchange='this.form.url.value=this.value; return config.macros.miniBrowser.go(this.form);'><!-- \
--><option value=''>bookmarks...</option><!-- \
--></select><!-- \
--><input type='button' value='add' title='add URL to the bookmarks' style='width:6%' \
favorites=\"%favorites%\" \
onclick='config.macros.miniBrowser.add(this.form.url,this.getAttribute(\"favorites\"));'><!-- \
--><input type='button' value='del' title='remove URL from the bookmarks' style='width:6%' \
favorites=\"%favorites%\" \
onclick='config.macros.miniBrowser.del(this.form.bookmarks,this.getAttribute(\"favorites\"));'><!-- \
--><input type='button' value='edit' title='edit the bookmarks list' style='width:6%' \
favorites=\"%favorites%\" \
onclick='story.displayTiddler(null,this.getAttribute(\"favorites\"),2)'><!-- \
-->%linebreak%<!-- \
--><select name='type' id='minibrowser_type_%id%' size='1' style='width:12%' \
onchange='var opt=this.options; for (var i=0; i<opt.length; i++) \
if (i==this.selectedIndex) opt[i].text=opt[i].text.replace(/\xa0\xa0/,\"√\"); \
else opt[i].text=opt[i].text.replace(/√/,\"\xa0\xa0\"); \
if (this.selectedIndex==0) opt[1].text=opt[1].text.replace(/\xa0\xa0/,\"√\");'><!-- \
--><option value=''>type...</option><!-- \
--><option value=''>√ auto-detect</option><!-- \
--><option value='iframe'> web page</option><!-- \
--><option value='windows'> windows media</option><!-- \
--><option value='realone'> real one</option><!-- \
--><option value='quicktime'> quicktime</option><!-- \
--><option value='flash'> flash</option><!-- \
--><option value='image'> jpg/gif/png</option><!-- \
--></select><!-- \
--><input type='text' name='url' id='minibrowser_url_%id%' size='60' value='' style='width:%urlsize%' \
onfocus='this.select()'><!-- \
--><input type='submit' value='go' title='view URL in embedded player' style='width:6%'><!-- \
--><input type='button' value='open' title='view URL in a separate player' style='width:6%' \
onclick='if (this.form.url.value.length) window.open(this.form.url.value)'><!-- \
--><input type='button' value='done' name='done' disabled title='disconnect from URL' style='width:6%' \
onclick='return config.macros.miniBrowser.done(this.form);'><!-- \
--></div><!-- \
--><div id='minibrowser_player_%id%' style='display:none;text-align:center'></div><!-- \
--><span id='minibrowser_controls2_%id%' style='margin-top:2px;display:none;'><!-- \
--><div id='minibrowser_resize_%id%' style='display:%hidecontrols%;float:right'><!-- \
--> size: <input type='text' name='w' size='3' value='' style='' \
onfocus='this.select()'><!-- \
-->x<input type='text' name='h' size='3' value='' style='' \
onfocus='this.select()'><!-- \
--> <input type='submit' value='set' style='width:5em' \
onclick='var f=this.form; \
if(!f.w.value.trim().length) f.w.value=config.options.txtMiniBrowserWidth; \
if(!f.h.value.trim().length) f.h.value=config.options.txtMiniBrowserHeight; \
config.options.txtMiniBrowserWidth=f.w.value; config.options.txtMiniBrowserHeight=f.h.value; \
saveOptionCookie(\"txtMiniBrowserWidth\"); saveOptionCookie(\"txtMiniBrowserHeight\");'><!-- \
--><input type='submit' value='reset' style='width:5em' \
onclick='var f=this.form; f.ctrls.checked=true; f.w.value=\"100%\"; f.h.value=\"480\"; \
config.options.txtMiniBrowserWidth=f.w.value; config.options.txtMiniBrowserHeight=f.h.value; \
saveOptionCookie(\"txtMiniBrowserWidth\"); saveOptionCookie(\"txtMiniBrowserHeight\");'><!-- \
--><input type='button' value='fit' title='resize player to fit containing window' style='width:5em' \
onclick='config.macros.miniBrowser.fit(this)'><!-- \
--></div><!-- \
--> <input type='checkbox' name='ctrls' id='minibrowser_togglecontrols_%id%' title='toggle minibrowser controls' CHECKED \
onclick='document.getElementById(\"minibrowser_controls_%id%\").style.display=this.checked?\"block\":\"none\"; \
document.getElementById(\"minibrowser_resize_%id%\").style.display=this.checked?\"block\":\"none\";' \
><a href='' title='toggle minibrowser controls' \
onclick='this.previousSibling.click();return false;'>show controls</a><!-- \
--></span><!-- \
--></nobr></form> \
"
}
//}}}
/***
| Name:|''monkeyTagger''|
| Created by:|SaqImtiaz|
| Location:|http://tw.lewcid.org/|
| Version:|0.9 (08-Apr-2006)|
| Requires:|~TW2.07|
[Snip - see plugin documentation at the link above]
!CODE
***/
//{{{
config.macros.monkeyTagger= {};
//config.macros.monkeyTagger.dropdownchar = (document.all?"▼":"▾"); // the fat one is the only one that works in IE
config.macros.monkeyTagger.dropdownchar = "▼"; // uncomment previous line and comment this for smaller version in FF
config.macros.monkeyTagger.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
var nAV = paramString.parseParams('test', null, true);
if ((nAV[0].arrow)&&(nAV[0].arrow[0])=='false')
var arrow=': ';
else
var arrow=': '+ config.macros.monkeyTagger.dropdownchar;
if((nAV[0].source)&&(nAV[0].source[0])!='.')
{var tagToTrack = nAV[0].source[0]}
else if(params[0]&&(params[0]!='.'))
{var tagToTrack = params[0]}
else
{return false;};
var monkeylabel = ((nAV[0].label)&&(nAV[0].label[0])!='.')?nAV[0].label[0]+arrow: tagToTrack+arrow;
var logmode = ((nAV[0].logging)&&(nAV[0].logging[0])!='.')?nAV[0].logging[0]: "false";
if ((nAV[0].anchor)&&(nAV[0].anchor[0])!='.')
var anchor = nAV[0].anchor[0];
var monkeytooltip=tagToTrack + ' :';
if(tiddler instanceof Tiddler)
{var title = tiddler.title;
var addcomment = function(tiddler,newTag){
var now = new Date();
var timeFormat= 'DD/0MM/YY 0hh:0mm';
var formattednow= now.formatString(timeFormat);
var txt="\n*''"+tagToTrack+"'' set as ''"+newTag+"'' on "+formattednow;
if (anchor && anchor!='.')
{var pos=tiddler.text.indexOf(anchor);
if (pos!=-1) {pos=pos + anchor.length}
else if (pos==-1) {pos=tiddler.text.length}}
else if (!anchor){var pos = tiddler.text.length;};
tiddler.set(null,tiddler.text.substr(0,pos)+txt+tiddler.text.substr(pos));
story.refreshTiddler(tiddler.title,null,true);
return false;
}
var ontagclick = function(e) {
if (!e) var e = window.event;
var tag = this.getAttribute("tag");
var t=store.getTiddler(title);
if (!t || !t.tags) return;
if (t.tags.find(tag)==null)
{t.tags.push(tag)
if (logmode=="true"){addcomment(t,tag);}}
else
{t.tags.splice(t.tags.find(tag),1)};
story.saveTiddler(title);
story.refreshTiddler(title,null,true);
return false;
};
var onclick = function(e) {
if (!e) var e = window.event;
var popup = Popup.create(this);
var thistiddler=store.getTiddler(title);
var taggedarray = new Array();
var tagslabel = new Array();
var taggedtiddlers = store.getTaggedTiddlers(tagToTrack);
for (var t=0; t<taggedtiddlers.length; t++){
var taggedtitle= ((taggedtiddlers[t]).title);
taggedarray.push(taggedtitle);}
for (var t=0; t<taggedarray.length; t++){
var temptag = taggedarray[t];
if (thistiddler.tags.find(temptag)==null)
{var temptag='[ ] '+ temptag;
tagslabel.push(temptag);}
else
{var temptag ='[x] '+ temptag;
tagslabel.push(temptag);}
}
if(tagslabel.length == 0)
createTiddlyText(createTiddlyElement(popup,"li"),('no '+tagToTrack));
for (var t=0; t<tagslabel.length; t++)
{
var theTag = createTiddlyButton(createTiddlyElement(popup,"li"),tagslabel[t],("toggle '"+ ([taggedarray[t]]))+"'",ontagclick);
theTag.setAttribute("tag",taggedarray[t]);
}
Popup.show(popup,false);
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
};
//createTiddlyButton(place,monkeylabel,monkeylabel,onclick);
var createdropperButton = function(place){
var sp = createTiddlyElement(place,"span",null,"monkeytaggerbutton");
var theDropDownBtn = createTiddlyButton(sp,monkeylabel,monkeytooltip,onclick);
};
createdropperButton(place);
}
};
setStylesheet(
".toolbar .monkeytaggerbutton {margin-right:0em; border:0px solid #fff; padding:0px; padding-right:0px; padding-left:0px;}\n"+
".monkeytaggerbutton a.button {padding:2px; padding-left:2px; padding-right:2px;}\n"+
// ".monkeytaggerbutton {font-size:130%;}\n"+
//".monkeytaggerbutton .button {color:#703;}\n"+
"",
"MonkeyTaggerStyles");
//}}}
<html><div align="center"><iframe src="http://files.getdropbox.com/u/1064531/Multimedie%20tegning-billedkunst.pdf" frameborder="0" width="100%" height="600"></iframe></div></html>
/***
<<mURL "http://google.com" "http://tiddlywiki.com" "http://tiddlywiki.org">>
***/
//{{{
(function($) {
config.macros.mURL = {
handler: function(place, macroName, params, wikifier, paramString, tiddler) {
var container = $('<div class="mURL" />').appendTo(place);
$.each(params, function(i, item) {
var callback = function(ev) {
var url = $(this).attr("href");
$("iframe", container).attr("src", url);
return false;
};
$("<a />").attr("href", item).text(i).click(callback).
appendTo(container);
});
var el = $("<iframe />").appendTo(container);
}
};
})(jQuery);
//}}}
<!--{{{-->
<div class='header' macro='gradient vert #00c #003'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler=''></span>
<span class='siteSubtitle' refresh='content' tiddler=''></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div id='topMenu'><span class='topMenu' refresh='content' tiddler='TopMenu'></span></div>
</div><div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='mainMenu' refresh='content' force='true' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' force='true' 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 id='contentFooter' refresh='content' tiddler='ContentFooter'></div></div>
<!--}}}-->
TiddlyWiki.com - official release
http://www.TiddlyWiki.com
----
TiddlyWiki.org - wiki, tickets, source control
http://www.TiddlyWiki.org
----
GoogleGroup: TiddlyWiki - user/author discussion
http://groups.google.com/group/TiddlyWiki/
----
GoogleGroup: TiddlyWikiDev - core/plugin discussion
http://groups.google.com/group/TiddlyWikiDev/
----
TiddlyVault - index of add-ons from many sources
http://TiddlyVault.TiddlySpot.com
----
TiddlySpot - instant TiddlyWiki hosting!!
http://www.TiddlySpot.com
----
TiddlyTools - plugins, scripts, templates, etc.
http://www.TiddlyTools.com
<html><div align="center"><font size="-1"><input type="button" value="« Back" onClick="history.go(-1)" name="button" class="btn" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/>@@color:#ffe;|@@<a href="javascript:;" onclick="var tid=story.findContainingTiddler(this); if (tid) story.refreshTiddler(tid.getAttribute('tiddler'),null,true); return false;"><input class="btn" type="button" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'" value="Reload " ></a>@@color:#ffe;|@@<input class="btn" type="button" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'" value="Forward » "onClick="history.forward()"</font></div></html>
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Documentation|http://www.TiddlyTools.com/#NestedSlidersPluginInfo|
|Version|2.4.9|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|show content in nest-able sliding/floating panels, without creating separate tiddlers for each panel's content|
!!!!!Documentation
>see [[NestedSlidersPluginInfo]]
!!!!!Configuration
<<<
<<option chkFloatingSlidersAnimate>> allow floating sliders to animate when opening/closing
>Note: This setting can cause 'clipping' problems in some versions of InternetExplorer.
>In addition, for floating slider animation to occur you must also allow animation in general (see [[AdvancedOptions]]).
<<<
!!!!!Revisions
<<<
2008.11.15 - 2.4.9 in adjustNestedSlider(), don't make adjustments if panel is marked as 'undocked' (CSS class). In onClickNestedSlider(), SHIFT-CLICK docks panel (see [[MoveablePanelPlugin]])
|please see [[NestedSlidersPluginInfo]] for additional revision details|
2005.11.03 - 1.0.0 initial public release. Thanks to RodneyGomes, GeoffSlocock, and PaulPetterson for suggestions and experiments.
<<<
!!!!!Code
***/
//{{{
version.extensions.NestedSlidersPlugin= {major: 2, minor: 4, revision: 9, date: new Date(2008,11,15)};
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkFloatingSlidersAnimate===undefined)
config.options.chkFloatingSlidersAnimate=false; // avoid clipping problems in IE
// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
// if removeCookie() function is not defined by TW core, define it here.
if (window.removeCookie===undefined) {
window.removeCookie=function(name) {
document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;';
}
}
config.formatters.push( {
name: "nestedSliders",
match: "\\n?\\+{3}",
terminator: "\\s*\\={3}\\n?",
lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^(?:[^\\^\\*\\@\\[\\>]*\\^)?)?(\\*)?(\\@)?(?:\\{\\{([\\w]+[\\s\\w]*)\\{)?(\\[[^\\]]*\\])?(\\[[^\\]]*\\])?(?:\\}{3})?(\\#[^:]*\\:)?(\\>)?(\\.\\.\\.)?\\s*",
handler: function(w)
{
lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
var defopen=lookaheadMatch[1];
var cookiename=lookaheadMatch[2];
var header=lookaheadMatch[3];
var panelwidth=lookaheadMatch[4];
var transient=lookaheadMatch[5];
var hover=lookaheadMatch[6];
var buttonClass=lookaheadMatch[7];
var label=lookaheadMatch[8];
var openlabel=lookaheadMatch[9];
var panelID=lookaheadMatch[10];
var blockquote=lookaheadMatch[11];
var deferred=lookaheadMatch[12];
// location for rendering button and panel
var place=w.output;
// default to closed, no cookie, no accesskey, no alternate text/tip
var show="none"; var cookie=""; var key="";
var closedtext=">"; var closedtip="";
var openedtext="<"; var openedtip="";
// extra "+", default to open
if (defopen) show="block";
// cookie, use saved open/closed state
if (cookiename) {
cookie=cookiename.trim().slice(1,-1);
cookie="chkSlider"+cookie;
if (config.options[cookie]==undefined)
{ config.options[cookie] = (show=="block") }
show=config.options[cookie]?"block":"none";
}
// parse label/tooltip/accesskey: [label=X|tooltip]
if (label) {
var parts=label.trim().slice(1,-1).split("|");
closedtext=parts.shift();
if (closedtext.substr(closedtext.length-2,1)=="=")
{ key=closedtext.substr(closedtext.length-1,1); closedtext=closedtext.slice(0,-2); }
openedtext=closedtext;
if (parts.length) closedtip=openedtip=parts.join("|");
else { closedtip="show "+closedtext; openedtip="hide "+closedtext; }
}
// parse alternate label/tooltip: [label|tooltip]
if (openlabel) {
var parts=openlabel.trim().slice(1,-1).split("|");
openedtext=parts.shift();
if (parts.length) openedtip=parts.join("|");
else openedtip="hide "+openedtext;
}
var title=show=='block'?openedtext:closedtext;
var tooltip=show=='block'?openedtip:closedtip;
// create the button
if (header) { // use "Hn" header format instead of button/link
var lvl=(header.length>5)?5:header.length;
var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,buttonClass,title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
}
else
var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider,buttonClass);
btn.innerHTML=title; // enables use of HTML entities in label
// set extra button attributes
btn.setAttribute("closedtext",closedtext);
btn.setAttribute("closedtip",closedtip);
btn.setAttribute("openedtext",openedtext);
btn.setAttribute("openedtip",openedtip);
btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
btn.defOpen=defopen!=null; // save default open/closed state (boolean)
btn.keyparam=key; // save the access key letter ("" if none)
if (key.length) {
btn.setAttribute("accessKey",key); // init access key
btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
}
btn.setAttribute("hover",hover?"true":"false");
btn.onmouseover=function(ev) {
// optional 'open on hover' handling
if (this.getAttribute("hover")=="true" && this.sliderPanel.style.display=='none') {
document.onclick.call(document,ev); // close transients
onClickNestedSlider(ev); // open this slider
}
// mouseover on button aligns floater position with button
if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this,this.sliderPanel);
}
// create slider panel
var panelClass=panelwidth?"floatingPanel":"sliderPanel";
if (panelID) panelID=panelID.slice(1,-1); // trim off delimiters
var panel=createTiddlyElement(place,"div",panelID,panelClass,null);
panel.button = btn; // so the slider panel know which button it belongs to
btn.sliderPanel=panel; // so the button knows which slider panel it belongs to
panel.defaultPanelWidth=(panelwidth && panelwidth.length>2)?panelwidth.slice(1,-1):"";
panel.setAttribute("transient",transient=="*"?"true":"false");
panel.style.display = show;
panel.style.width=panel.defaultPanelWidth;
panel.onmouseover=function(event) // mouseover on panel aligns floater position with button
{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this.button,this); }
// render slider (or defer until shown)
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if ((show=="block")||!deferred) {
// render now if panel is supposed to be shown or NOT deferred rendering
w.subWikify(blockquote?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
// align floater position with button
if (window.adjustSliderPos) window.adjustSliderPos(place,btn,panel);
}
else {
var src = w.source.substr(w.nextMatch);
var endpos=findMatchingDelimiter(src,"+++","===");
panel.setAttribute("raw",src.substr(0,endpos));
panel.setAttribute("blockquote",blockquote?"true":"false");
panel.setAttribute("rendered","false");
w.nextMatch += endpos+3;
if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
}
}
}
}
)
function findMatchingDelimiter(src,starttext,endtext) {
var startpos = 0;
var endpos = src.indexOf(endtext);
// check for nested delimiters
while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
// count number of nested 'starts'
var startcount=0;
var temp = src.substring(startpos,endpos-1);
var pos=temp.indexOf(starttext);
while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
// set up to check for additional 'starts' after adjusting endpos
startpos=endpos+endtext.length;
// find endpos for corresponding number of matching 'ends'
while (startcount && endpos!=-1) {
endpos = src.indexOf(endtext,endpos+endtext.length);
startcount--;
}
}
return (endpos==-1)?src.length:endpos;
}
//}}}
//{{{
window.onClickNestedSlider=function(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
while (theTarget && theTarget.sliderPanel==undefined) theTarget=theTarget.parentNode;
if (!theTarget) return false;
var theSlider = theTarget.sliderPanel;
var isOpen = theSlider.style.display!="none";
// if SHIFT-CLICK, dock panel first (see [[MoveablePanelPlugin]])
if (e.shiftKey && config.macros.moveablePanel) config.macros.moveablePanel.dock(theSlider,e);
// toggle label
theTarget.innerHTML=isOpen?theTarget.getAttribute("closedText"):theTarget.getAttribute("openedText");
// toggle tooltip
theTarget.setAttribute("title",isOpen?theTarget.getAttribute("closedTip"):theTarget.getAttribute("openedTip"));
// deferred rendering (if needed)
if (theSlider.getAttribute("rendered")=="false") {
var place=theSlider;
if (theSlider.getAttribute("blockquote")=="true")
place=createTiddlyElement(place,"blockquote");
wikify(theSlider.getAttribute("raw"),place);
theSlider.setAttribute("rendered","true");
}
// show/hide the slider
if(config.options.chkAnimate && (!hasClass(theSlider,'floatingPanel') || config.options.chkFloatingSlidersAnimate))
anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
else
theSlider.style.display = isOpen ? "none" : "block";
// reset to default width (might have been changed via plugin code)
theSlider.style.width=theSlider.defaultPanelWidth;
// align floater panel position with target button
if (!isOpen && window.adjustSliderPos) window.adjustSliderPos(theSlider.parentNode,theTarget,theSlider);
// if showing panel, set focus to first 'focus-able' element in panel
if (theSlider.style.display!="none") {
var ctrls=theSlider.getElementsByTagName("*");
for (var c=0; c<ctrls.length; c++) {
var t=ctrls[c].tagName.toLowerCase();
if ((t=="input" && ctrls[c].type!="hidden") || t=="textarea" || t=="select")
{ try{ ctrls[c].focus(); } catch(err){;} break; }
}
}
var cookie=theTarget.sliderCookie;
if (cookie && cookie.length) {
config.options[cookie]=!isOpen;
if (config.options[cookie]!=theTarget.defOpen) window.saveOptionCookie(cookie);
else window.removeCookie(cookie); // remove cookie if slider is in default display state
}
// prevent SHIFT-CLICK from being processed by browser (opens blank window... yuck!)
// prevent clicks *within* a slider button from being processed by browser
// but allow plain click to bubble up to page background (to close transients, if any)
if (e.shiftKey || theTarget!=resolveTarget(e))
{ e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); }
Popup.remove(); // close open popup (if any)
return false;
}
//}}}
//{{{
// click in document background closes transient panels
document.nestedSliders_savedOnClick=document.onclick;
document.onclick=function(ev) { if (!ev) var ev=window.event; var target=resolveTarget(ev);
if (document.nestedSliders_savedOnClick)
var retval=document.nestedSliders_savedOnClick.apply(this,arguments);
// if click was inside a popup... leave transient panels alone
var p=target; while (p) if (hasClass(p,"popup")) break; else p=p.parentNode;
if (p) return retval;
// if click was inside transient panel (or something contained by a transient panel), leave it alone
var p=target; while (p) {
if ((hasClass(p,"floatingPanel")||hasClass(p,"sliderPanel"))&&p.getAttribute("transient")=="true") break;
p=p.parentNode;
}
if (p) return retval;
// otherwise, find and close all transient panels...
var all=document.all?document.all:document.getElementsByTagName("DIV");
for (var i=0; i<all.length; i++) {
// if it is not a transient panel, or the click was on the button that opened this panel, don't close it.
if (all[i].getAttribute("transient")!="true" || all[i].button==target) continue;
// otherwise, if the panel is currently visible, close it by clicking it's button
if (all[i].style.display!="none") window.onClickNestedSlider({target:all[i].button})
if (!hasClass(all[i],"floatingPanel")&&!hasClass(all[i],"sliderPanel")) all[i].style.display="none";
}
return retval;
};
//}}}
//{{{
// adjust floating panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel) {
if (hasClass(panel,"floatingPanel") && !hasClass(panel,"undocked")) {
// see [[MoveablePanelPlugin]] for use of 'undocked'
var rightEdge=document.body.offsetWidth-1;
var panelWidth=panel.offsetWidth;
var left=0;
var top=btn.offsetHeight;
if (place.style.position=="relative" && findPosX(btn)+panelWidth>rightEdge) {
left-=findPosX(btn)+panelWidth-rightEdge; // shift panel relative to button
if (findPosX(btn)+left<0) left=-findPosX(btn); // stay within left edge
}
if (place.style.position!="relative") {
var left=findPosX(btn);
var top=findPosY(btn)+btn.offsetHeight;
var p=place; while (p && !hasClass(p,'floatingPanel')) p=p.parentNode;
if (p) { left-=findPosX(p); top-=findPosY(p); }
if (left+panelWidth>rightEdge) left=rightEdge-panelWidth;
if (left<0) left=0;
}
panel.style.left=left+"px"; panel.style.top=top+"px";
}
}
//}}}
//{{{
// TW2.1 and earlier:
// hijack Slider stop handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }
// TW2.2+
// hijack Morpher stop handler so sliderPanel/floatingPanel overflow is visible after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
Morpher.prototype.coreStop = Morpher.prototype.stop;
Morpher.prototype.stop = function() {
this.coreStop.apply(this,arguments);
var e=this.element;
if (hasClass(e,"sliderPanel")||hasClass(e,"floatingPanel")) {
// adjust panel overflow and position after animation
e.style.overflow = "visible";
if (window.adjustSliderPos) window.adjustSliderPos(e.parentNode,e.button,e);
}
};
}
//}}}
/***
''NestedSlidersPlugin for TiddlyWiki version 1.2.x and 2.0''
^^author: Eric Shulman
source: http://www.TiddlyTools.com/#NestedSlidersPlugin
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^
Quickly make any tiddler content into an expandable 'slider' panel, without needing to create a separate tiddler to contain the slider content. Optional syntax allows ''default to open'', ''custom button label/tooltip'' and ''automatic blockquote formatting.''
You can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created. This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.
For more details, please click on a section headline below:
++++!!!!![Configuration]>
Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
===
++++!!!!![Usage]>
When installed, this plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content. Use {{{+++}}} and {{{===}}} to delimit the slider content. Additional optional syntax elements let you specify
*default to open
*cookiename
*heading level
*floater (with optional CSS width value)
*mouse auto rollover
*custom label/tooltip/accesskey
*automatic blockquote
*deferred rendering
The complete syntax, using all options, is:
//{{{
++++(cookiename)!!!!!^width^*[label=key|tooltip]>...
content goes here
===
//}}}
where:
* {{{+++}}} (or {{{++++}}}) and {{{===}}}^^
marks the start and end of the slider definition, respectively. When the extra {{{+}}} is used, the slider will be open when initially displayed.^^
* {{{(cookiename)}}}^^
saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.^^
* {{{!}}} through {{{!!!!!}}}^^
displays the slider label using a formatted headline (Hn) style instead of a button/link style^^
* {{{^width^}}} (or just {{{^}}})^^
makes the slider 'float' on top of other content rather than shifting that content downward. 'width' must be a valid CSS value (e.g., "30em", "180px", "50%", etc.). If omitted, the default width is "auto" (i.e., fit to content)^^
* {{{*}}}^^
automatically opens/closes slider on "rollover" as well as when clicked^^
* {{{[label=key|tooltip]}}}^^
uses custom label/tooltip/accesskey. {{{=key}}} and {{{|tooltip}}} are optional. 'key' is must be a ''single letter only''. Default labels/tootips are: ">" (more) and "<" (less), with no default access key assignment.^^
* {{{">"}}} //(without the quotes)//^^
automatically adds blockquote formatting to slider content^^
* {{{"..."}}} //(without the quotes)//^^
defers rendering of closed sliders until the first time they are opened. //Note: deferred rendering may produce unexpected results in some cases. Use with care.//^^
//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
===
++++!!!!![Examples]>
simple in-line slider:
{{{
+++
content
===
}}}
+++
content
===
----
use a custom label and tooltip:
{{{
+++[label|tooltip]
content
===
}}}
+++[label|tooltip]
content
===
----
content automatically blockquoted:
{{{
+++>
content
===
}}}
+++>
content
===
----
all options combined //(default open, cookie, heading, sized floater, rollover, label/tooltip/key, blockquoted, deferred)//
{{{
++++(testcookie)!!!^30em^*[label=Z|click or press Alt-Z to open]>...
content
===
}}}
++++(testcookie)!!!^30em^*[label=Z|click or press Alt-Z to open]>...
content
===
----
complex nesting example:
{{{
+++^[get info...=I|click for information or press Alt-I]
put some general information here, plus a floating slider with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could include a rollover with a +++^25em^*[glossary definition]explaining technical terms===
===
===
}}}
+++^[get info...=I|click for information or press Alt-I]
put some general information here, plus a floating slider with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could include a rollover with a +++^25em^*[glossary definition]explaining technical terms===
===
===
----
nested floaters
>menu: <<tiddler NestedSlidersExample>>
(see [[NestedSlidersExample]] for definition)
----
===
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2006.05.11 - 1.9.0'' added optional '^width^' syntax for floating sliders and '=key' syntax for setting an access key on a slider label
''2006.05.09 - 1.8.0'' in onClickNestedSlider(), when showing panel, set focus to first child input/textarea/select element
''2006.04.24 - 1.7.8'' in adjustSliderPos(), if floating panel is contained inside another floating panel, subtract offset of containing panel to find correct position
''2006.02.16 - 1.7.7'' corrected deferred rendering to account for use-case where show/hide state is tracked in a cookie
''2006.02.15 - 1.7.6'' in adjustSliderPos(), ensure that floating panel is positioned completely within the browser window (i.e., does not go beyond the right edge of the browser window)
''2006.02.04 - 1.7.5'' add 'var' to unintended global variable declarations to avoid FireFox 1.5.0.1 crash bug when assigning to globals
''2006.01.18 - 1.7.4'' only define adjustSliderPos() function if it has not already been provided by another plugin. This lets other plugins 'hijack' the function even when they are loaded first.
''2006.01.16 - 1.7.3'' added adjustSliderPos(place,btn,panel,panelClass) function to permit specialized logic for placement of floating panels. While it provides improved placement for many uses of floating panels, it exhibits a relative offset positioning error when used within *nested* floating panels. Short-term workaround is to only adjust the position for 'top-level' floaters.
''2006.01.16 - 1.7.2'' added button property to slider panel elements so that slider panel can tell which button it belongs to. Also, re-activated and corrected animation handling so that nested sliders aren't clipped by hijacking Slider.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
''2006.01.14 - 1.7.1'' added optional "^" syntax for floating panels. Defines new CSS class, ".floatingPanel", as an alternative for standard in-line ".sliderPanel" styles.
''2006.01.14 - 1.7.0'' added optional "*" syntax for rollover handling to show/hide slider without requiring a click (Based on a suggestion by tw4efl)
''2006.01.03 - 1.6.2'' When using optional "!" heading style, instead of creating a clickable "Hn" element, create an "A" element inside the "Hn" element. (allows click-through in SlideShowPlugin, which captures nearly all click events, except for hyperlinks)
''2005.12.15 - 1.6.1'' added optional "..." syntax to invoke deferred ('lazy') rendering for initially hidden sliders
removed checkbox option for 'global' application of lazy sliders
''2005.11.25 - 1.6.0'' added optional handling for 'lazy sliders' (deferred rendering for initially hidden sliders)
''2005.11.21 - 1.5.1'' revised regular expressions: if present, a single newline //preceding// and/or //following// a slider definition will be suppressed so start/end syntax can be place on separate lines in the tiddler 'source' for improved readability. Similarly, any whitespace (newlines, tabs, spaces, etc.) trailing the 'start slider' syntax or preceding the 'end slider' syntax is also suppressed.
''2005.11.20 - 1.5.0'' added (cookiename) syntax for optional tracking and restoring of slider open/close state
''2005.11.11 - 1.4.0'' added !!!!! syntax to render slider label as a header (Hn) style instead of a button/link style
''2005.11.07 - 1.3.0'' removed alternative syntax {{{(((}}} and {{{)))}}} (so they can be used by other
formatting extensions) and simplified/improved regular expressions to trim multiple excess newlines
''2005.11.05 - 1.2.1'' changed name to NestedSlidersPlugin
more documentation
''2005.11.04 - 1.2.0'' added alternative character-mode syntax {{{(((}}} and {{{)))}}}
tweaked "eat newlines" logic for line-mode {{{+++}}} and {{{===}}} syntax
''2005.11.03 - 1.1.1'' fixed toggling of default tooltips ("more..." and "less...") when a non-default button label is used
code cleanup, added documentation
''2005.11.03 - 1.1.0'' changed delimiter syntax from {{{(((}}} and {{{)))}}} to {{{+++}}} and {{{===}}}
changed name to EasySlidersPlugin
''2005.11.03 - 1.0.0'' initial public release
<<<
!!!!!Credits
<<<
This feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with initial research and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 1, minor: 9, revision: 0, date: new Date(2006,5,11)};
//}}}
//{{{
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;
if (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;
// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
//}}}
//{{{
config.formatters.push( {
name: "nestedSliders",
match: "\\n?\\+{3}",
terminator: "\\s*\\={3}\\n?",
lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^(?:[^\\^\\*\\[\\>]*\\^)?)?(\\*)?(\\[[^\\]]*\\])?(\\>)?(\\.\\.\\.)?\\s*",
handler: function(w)
{
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
// location for rendering button and panel
var place=w.output;
// default to closed, no cookie, no accesskey
var show="none"; var title=" ►"; var tooltip="show"; var cookie=""; var key="";
// extra "+", default to open
if (lookaheadMatch[1])
{ show="block"; title="◄"; tooltip="hide"; }
// cookie, use saved open/closed state
if (lookaheadMatch[2]) {
cookie=lookaheadMatch[2].trim().slice(1,-1);
cookie="chkSlider"+cookie;
if (config.options[cookie]==undefined)
{ config.options[cookie] = (show=="block") }
if (config.options[cookie])
{ show="block"; title="◄"; tooltip="hide"; }
else
{ show="none"; title=" ►"; tooltip="show"; }
}
// parse custom label/tooltip/accesskey: [label=X|tooltip]
if (lookaheadMatch[6]) {
title = lookaheadMatch[6].trim().slice(1,-1);
var pos=title.indexOf("|");
if (pos!=-1) { tooltip = title.substr(pos+1,title.length); title=title.substr(0,pos); }
if (title.substr(title.length-2,1)=="=") { key=title.substr(title.length-1,1); title=title.slice(0,-2); }
if (pos==-1) tooltip += " "+title; // default tooltip: "show/hide <title>"
}
// create the button
if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link
var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;
var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,null,title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
}
else
var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider);
btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
btn.keyparam=key; // save the access key letter ("" if none)
if (key.length) {
btn.setAttribute("accessKey",key); // init access key
btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
}
// "non-click" MouseOver open/close slider
if (lookaheadMatch[5]) btn.onmouseover=onClickNestedSlider;
// create slider panel
var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";
var panel=createTiddlyElement(place,"div",null,panelClass,null);
panel.style.display = show;
if (lookaheadMatch[4] && lookaheadMatch[4].length>2) panel.style.width=lookaheadMatch[4].slice(1,-1); // custom width
panel.button = btn; // so the slider panel know which button it belongs to
btn.sliderPanel=panel;
// render slider (or defer until shown)
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if ((show=="block")||!lookaheadMatch[8]) {
// render now if panel is supposed to be shown or NOT deferred rendering
w.subWikify(lookaheadMatch[7]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
// align slider/floater position with button
adjustSliderPos(place,btn,panel,panelClass);
}
else {
var src = w.source.substr(w.nextMatch);
var endpos=findMatchingDelimiter(src,"+++","===");
panel.setAttribute("raw",src.substr(0,endpos));
panel.setAttribute("blockquote",lookaheadMatch[7]?"true":"false");
panel.setAttribute("rendered","false");
w.nextMatch += endpos+3;
if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\n\n"+panel.getAttribute("raw"));
}
}
}
}
)
// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)
function findMatchingDelimiter(src,starttext,endtext) {
var startpos = 0;
var endpos = src.indexOf(endtext);
// check for nested delimiters
while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
// count number of nested 'starts'
var startcount=0;
var temp = src.substring(startpos,endpos-1);
var pos=temp.indexOf(starttext);
while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
// set up to check for additional 'starts' after adjusting endpos
startpos=endpos+endtext.length;
// find endpos for corresponding number of matching 'ends'
while (startcount && endpos!=-1) {
endpos = src.indexOf(endtext,endpos+endtext.length);
startcount--;
}
}
return (endpos==-1)?src.length:endpos;
}
//}}}
//{{{
window.onClickNestedSlider=function(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var theLabel = theTarget.firstChild.data;
var theSlider = theTarget.sliderPanel
var isOpen = theSlider.style.display!="none";
// if using default button labels, toggle labels
if (theLabel==">") theTarget.firstChild.data = "◄";
else if (theLabel=="<") theTarget.firstChild.data = "►";
// if using default tooltips, toggle tooltips
if (theTarget.getAttribute("title")=="show")
theTarget.setAttribute("title","hide");
else if (theTarget.getAttribute("title")=="hide")
theTarget.setAttribute("title","show");
if (theTarget.getAttribute("title")=="show "+theLabel)
theTarget.setAttribute("title","hide "+theLabel);
else if (theTarget.getAttribute("title")=="hide "+theLabel)
theTarget.setAttribute("title","show "+theLabel);
// deferred rendering (if needed)
if (theSlider.getAttribute("rendered")=="false") {
if (config.options.chkDebugLazySliderRender)
alert("rendering '"+theLabel+"':\n\n"+theSlider.getAttribute("raw"));
var place=theSlider;
if (theSlider.getAttribute("blockquote")=="true")
place=createTiddlyElement(place,"blockquote");
wikify(theSlider.getAttribute("raw"),place);
theSlider.setAttribute("rendered","true");
}
// show/hide the slider
if(config.options.chkAnimate)
anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
else
theSlider.style.display = isOpen ? "none" : "block";
// if showing panel, set focus to first 'focus-able' element in panel
if (theSlider.style.display!="none") {
var ctrls=theSlider.getElementsByTagName("*");
for (var c=0; c<ctrls.length; c++) {
var t=ctrls[c].tagName.toLowerCase();
if (t=="input" || t=="textarea" || t=="select")
{ ctrls[c].focus(); break; }
}
}
if (this.sliderCookie && this.sliderCookie.length)
{ config.options[this.sliderCookie]=!isOpen; saveOptionCookie(this.sliderCookie); }
// align slider/floater position with target button
adjustSliderPos(theSlider.parentNode,theTarget,theSlider,theSlider.className);
return false;
}
// hijack animation handler 'stop' handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function() { this.coreStop(); this.element.style.overflow = "visible"; }
// adjust panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel,panelClass) {
if (panelClass=="floatingPanel") {
var left=0;
var top=btn.offsetHeight;
if (place.style.position!="relative") {
var left=findPosX(btn);
var top=findPosY(btn)+btn.offsetHeight;
var p=place; while (p && p.className!='floatingPanel') p=p.parentNode;
if (p) { left-=findPosX(p); top-=findPosY(p); }
}
if (left+panel.offsetWidth > getWindowWidth()) left=getWindowWidth()-panel.offsetWidth-10;
panel.style.left=left+"px"; panel.style.top=top+"px";
}
}
function getWindowWidth() {
if(document.width!=undefined)
return document.width; // moz (FF)
if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
return document.documentElement.clientWidth; // IE6
if(document.body && ( document.body.clientWidth || document.body.clientHeight ) )
return document.body.clientWidth; // IE4
if(window.innerWidth!=undefined)
return window.innerWidth; // IE - general
return 0; // unknown
}
//}}}
<html><hide linebreaks>
<div id='contentFooter' refresh='content' tiddler='ContentFooter'></div>
</html>
<<formTiddler NewBibEntryTemplate>>
<html>
<table>
<tr>
<td align="right"><b>[[Forfatter|Efter forfatter]]:</b></td>
<td colspan="3"><input name=author type=text style="width:100%" /></td></tr>
<tr>
<td align="right"><b>[[Titel|Efter titel]]:</b></td>
<td colspan="3"><span class macro='edit title'> </td></tr>
<tr>
<td align="right"><b>Data:</b></td>
<td colspan="3"><input name=bibdata type=text style="width:100%" /></td></tr>
<tr>
<td align="right"><b>[[Tema|Efter tema]]:</b></td>
<td colspan="3"><input name=primtopic type=text style="width:100%" /></td></tr>
<tr>
<td align="right"><b><<tiddler TilElevFraBog>>:</b></td>
<td colspan="3"><input name=wherekept type=text style="width:100%" /></td></tr>
</span></table> </html>
<<newTiddler label:"newHTML" title:'New HTML' text:{{store.getTiddlerText('TiddlerMakeFile##html')}} tag:html>>
/***
|Name:|NewHerePlugin|
|Description:|Creates the new here and new journal macros|
|Version:|3.0 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#NewHerePlugin|
|Author:|Simon Baird <simon.baird@gmail.com>, modified by giffmex|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.macros, {
newHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]] tag:treeview>>",place,null,tiddler);
}
},
newJournalHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newJournal "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
}
}
});
//}}}
/***
|Name:|NewHerePlugin|
|Description:|Creates the new here and new journal macros|
|Version:|3.0 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#NewHerePlugin|
|Author:|Simon Baird <simon.baird@gmail.com>, modified by giffmex|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.macros, {
newHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]] tag:Note>>",place,null,tiddler);
}
},
newJournalHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newJournal "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
}
}
});
//}}}
<<newTiddler label:"newIframe" title:'New iframe' text:{{store.getTiddlerText('TiddlerMakeFile##iframe')}} tag:'iframe'>>
<<newJournal title:"YYYY.0MM.0DD at 0hh:0mm:0ss" text:{{store.getTiddlerText('TiddlerMakeFile##journal')}} tag:'journal'>>@@color:#00F;(normal date)@@
<<newTiddler
label:"newObject"
title:"NewObjectTiddler"
text:{{store.getTiddlerText('TiddlerMakeFile##object')}}
tag:"object"
focus:"title"
>>
<<newTiddler label:"newScript" title:"New Script Tiddler" tag:"script" focus:"text">>
<<newTiddler label:"newSlider" title:'New Slider' text:{{store.getTiddlerText('BlankSlider')}} tag:'slider'>>
<<newTiddler label:"newSystemConfig" title:"New SystemConfig Tiddler" tag:"systemConfig" "excludeLists" focus:"text">>
<<newTiddler label:"newTable" title:'New Table' text:{{store.getTiddlerText('TiddlerMakeFile##table')}} tag:'table'>>
<<newTiddler label:"newTabs" title:'New Tabs' text:{{store.getTiddlerText('TiddlerMakeFile##tabs')}} tag:'tabs'>>
{{wrap{
{{mmheading{[[NoteArkiv]]}}}
<<treeview2 "NoteArkiv" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "NoteArkiv-ID"' >>
{{mmheading{[[Alle noter|Note]]}}}
<<treeview2 "Note" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Note-ID"' >>
<script>
var out=[];
var exclude=['Fag','fag','opgave','projekt','mål','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Dansk','Engelsk','Synopse','NoteArkiv','Synopser','ValgFag','AndreFag'];
var fmt='|[[%0]]|';
var here=story.findContainingTiddler(place); if (!here) return;
var tid=store.getTiddler(here.getAttribute('tiddler'));
if (tid.tags.length) out.push('|<<tag NoteArkiv\>\> Klik for sortering|h\n|sortable|k');
for (var t=0; t<tid.tags.length; t++)
if (!exclude.contains(tid.tags[t]))
out.push(fmt.format([tid.tags[t]]));
return out.join('\n');
</script>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span style='padding-right: 2em;' macro='newHere label:"*lav et underemne til dette emne*"'></span></div>
<span class='title' macro='view title'></span>
<table class='borderless' style='width:100%'><top<tr>
<td style='width:35%'>
<div class='small' macro='tiddler NoteArkivScript'></div>
<div class='viewer' macro='view text wikified'></div></td>
<td style='width:5%'>
<div class='small borderless'><span class='small'>Noter: </span></div>
<div class='editor' macro='edit feltnoter 6'></div></top></td>
</table>
<div class='tagClear'></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<!--}}}-->
|<<tiddler ChecklistScript>> | Privat <<edit privat 14>> |
<<slider chkNoteSkabelon NoteSkabelon 'Private noter »'>>
<script label="Nyt faghold" title="opret nyt hold">
var tid=prompt("Skriv navnet på det nye hold","");
if (!tid || !tid.length) return;
var txt="";
var who=config.options.txtUserName;
var when=new Date();
var tags=['Fag'];
var initialer=prompt("Skriv lærerens initialer","");
if (!initialer || !initialer.length) return;
var fields={ laerer: initialer };
store.saveTiddler(tid,tid,txt,who,when,tags,fields);
story.displayTiddler(null,tid);
</script>
<data>{"author":"Jan Guillou","booktitle":"Ondskaben","primtopic":"Ondskab","mine":false,"wherekept":"TestElev","bibdata":"ISBN: 9788776070014"}</data>
Om bogen
En selvbiografisk og gribende fortælling om en drengs opdragelse i ondskab, fra faderens mishandlinger til de brutale magtkampe i skolegården.
Erik kommer fra en rig familie, han er dygtig i skolen og god til sport. Men hjemme i familien får han tæv af faderenen hver dag. Erik lærer at slås og klare mange tæv, men det giver ham problemer i skolen. Han bliver bortvist og sendt til en kostskole, hvor de ældre elevers systematiske undertrykkelse fører til en endeløs cirkel af provokationer og afstraffelser. Det eneste lyspunkt er vennen Pierre og hævnen, som han får til sidst.
Easy reader udgave af den oprindelige roman i serien Lette klassikere
<script label="TilladRedigering" title="Tillader redigering og bagscene funktionalitet, og slår animationer fra">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>
<html><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4391700&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4391700&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><p><a href="http://vimeo.com/4391700">Introduction to Open Source</a> from <a href="http://vimeo.com/user423727">Phil Whitehouse</a> on <a href="http://vimeo.com">Vimeo</a>.</p></html>
For at lave din egen hjemmeside ud af "Simple Noter" skal du først oprette en wikihjemmeside på [[TiddlySpot|http://tiddlyspot.com]].
Du skal blot angive navnet på din nye side (Du riskikerer naturligvis at det er optaget)
og en selvvalgt kode(x2). Brug blot satndardTiddlyWikien. (Det har ingen betydning eftersom vi overskriver den om lidt). Klik opret - og notér din hjemmesideadresse: {{{http://DitHjemmesidenavn.tiddlyspot.com}}}
Derefter vender du tilbage til "simplenoter.html" (på din pc)
##Åben "bagscenen"(øverst th.)
##Åben importér.
##Indskriv adressen på din nyligt oprettede hjemmeside.
##Klik Open
##Sæt et flueben øverst for at importere alle tiddlere
##Fjern fluebenet nederst ud for "Keep these tiddlers linked to this server so that you can synchronise subsequent changes"
##Klik importér - og færdig
##Åben SideBarOptions
##Klik redigér
##Indskriv {{{<<TspotControl>>}}} - evt. under {{{<<saveChanges>>}}}
##Klik færdig
##Gem ændringer
##Opdatér siden (F5)
##Klik muligheder (i Sidepanelet)
##Skriv din kode
##Klik gem til nettet.
##Siden uploades til nettet.
##Du har nu din egen udgave af simplenoter som hjemmeside.
!!!Alternativ uploadmetode:
Indskriv navnet (på din nyoprettede side) i upload (bagscenen øverst th)
Indskriv koden i næste felt.
I feltet nedenunder (Url of the UploadService script (default: store.php))
skriver du: "DitHjemmesideNavn.tiddlyspot.com/store.cgi".
Til sidst skriver du evt. "backup" i feltet: Relative Directory where to backup.(Ikke obligatorisk)
Nu kan du overskrive den side du lige har oprettet på tiddlyspot, ved at klikke på "Gem til nettet" i uploadvinduet.
@@color(#cc0000):NB!@@ Hvis du vælger denne metode vil siden ikke umiddlebart være redigérbar på nettet.
Vil du redigere i den online er du nødt til at lægge en såkaldt "bookmarklet" i din værktøjslinie, som du skal klikke på for at "få lov" til det.
Træk dette link <<tiddler OnlineRedigering>> til menulien i din browser - eller højreklik og vælg "bogmærk dette link". //Du kan selvfølgelig også bare klikke på linket <<tiddler OnlineRedigering>> her uden at bogmærke det!//
Fremover kan du klikke på bogmærket i browserens menulinie, og din side bliver redigérbar. (allerede åbne tiddlere, skal [[genopfriskes|GenOpfrisk]] for at kunne redigeres!)
Ps: Når du gemmer mens du er online via upload i "bagscenen", skal du blot skrive "store.cgi" i feltet: Url of the UploadService script - i stedet for hele adressen.
Mvh Måns
{{applyNow nowrap{<<tiddler OpretNyElevUdtalelseKnap##Apply with: [[Skriv udtalelse!]]>>}}}/%
!Apply
<script label="$1" title="Opret ny elevudtalelse">
var tid='Udtalelse til "Skriv elevnavn her"';
var tag="ElevUdtalelse";
var template="ElevUdtalelseEditTemplate";
if (store.tiddlerExists(tid)) {
story.displayTiddler(null,tid);
} else {
var d=document.createElement("div");
wikify("<<newTiddler title:[["+tid+"]] tag:[["+tag+"]] tag:[[data]] template:[["+template+"]]>>",d);
d.getElementsByTagName("A")[0].onclick();
}
</script>
!end Apply
%/
{{mmheading{Vælg opstartstiddlere}}}
{{normal{Redigér [[OpstartsTiddlere|DefaultTiddlers]] for at vælge hvilke tiddlere der vises ved opstart. Den nuværende indstilling er: {{block{<<wikify "{{{\n%0\n}}}\n" {{store.getTiddlerText("DefaultTiddlers")}}>>}}}
----
<<newTiddler title: 'Skriv titel på ny opstartstiddler her' tag: 'opstart' label: ' Ny opstartstiddler ' text: 'klik på redigér og tilføj indhold'>>
Disse muligheder for at ændre på TiddlyWiki bliver gemt i din browser
Dit brugernavn til at signere dine ændringer. Skriv det som et WikiOrd (f.eks. PerPoulsen)
<<option txtUserName>>
<<option chkSaveBackups>> Gem backups
<<option chkAutoSave>> Auto gem
<<option chkRegExpSearch>> Regexp søg
<<option chkCaseSensitiveSearch>> Søgning på store og små bogstaver
<<option chkAnimate>> Tillad animationer
----
Se også [[Avancerede muligheder|AdvancedOptions]]
<html><p align="center"><textarea id="xclToTw" rows="10" cols="60"></textarea><br><button onclick="(function(){var ta=document.getElementById('xclToTw'); displayMessage('original: ' + ta.value); ta.value=ta.value.replace(/^|$|\t/gm, '|');})();" > Oversæt</button></p></html>
<!--{{{-->
<div class='header' macro='gradient vert #5DC44D #000'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler=''></span>
<span class='siteSubtitle' refresh='content' tiddler=''></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div id='topMenu'><span class='topMenu' refresh='content' tiddler='TopMenu'></span></div>
</div><div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='mainMenu' refresh='content' force='true' tiddler='MainMenu'><div id='contentFooter' refresh='content' tiddler='ContentFooter'></div></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' force='true' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea' ondblclick='clearMessage();return false;'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='ContentFooter'>xxxxxxxxxxxxxxxxx</div>
<!--}}}-->
/***
|''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"
});
*/
//}}}
@@color:#800;Tiddlers tagged with systemConfig (plugins, macros and tweaks)@@
<<tiddler ToggleRightSidebar with: "Sidebar »">>
{{twocolumns{
<script>
// get all tiddlers tagged with "systemConfig"
var tids=store.getTaggedTiddlers("systemConfig");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("systemConfig")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
}}}
/***
|''Name:''|Publish Macro|
|''Version:''|2.4.1 (2 July 2008)|
|''Source''|http://jackparke.googlepages.com/jtw.html#PublishMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23PublishMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
<<doPublish>> tiddlers tagged with these tags <<option txtPublishTags>> (comma seperated) as HTML pages to the subfolder 'publish' (you must create this). Use the [[PublishTemplateHead]] and [[PublishTemplateBody]] templates to style your pages and the [[PublishIndexTemplate]] to define an index page. For publishing individual tiddlers the [[PublishTemplateBodySingle]] template is used.
!Usage
To publish all tagged tiddlers:
{{{<<doPublish>>}}} <<doPublish>>
To publish a single tiddler, use the {{{<<publishTiddler>>}}} macro or add the "publishTiddler" command to your ViewTemplate
!Template placeholders
|!Placeholder|!Meaning|
|%0|Your SiteTitle "<<tiddler SiteTitle>>"|
|%1|The current tiddler title|
|%2|The rendered tiddler HTML|
|%3|CSV list of tags|
|%4|Tiddler modifier|
|%5|Tiddler modified date|
|%6|Tiddler creation date|
|%7|Tiddler wiki text|
!Revision History
* Original by [[Jack]] 24 May 2006
* Updated 2 Jan 2007
* Refactored 4 Jan 2007
* Small improvements
* Publish single tiddlers
* Template placeholder %7 for tiddler's wiki text
!Code
***/
//{{{
version.extensions.doPublish = {
major: 2,
minor: 4,
revision: 1,
date: new Date("July 2, 2008")
};
config.macros.doPublish = {
label: "publish",
prompt: "Publish Tiddlers as HTML files"
};
if (config.options.txtPublishTags == undefined) config.options.txtPublishTags = "Publish";
config.shadowTiddlers.PublishTemplateHead = '<title>%0 - %1</title>\n<link rel="stylesheet" type="text/css" href="style.css"/>\n<meta name="keywords" content="%3"/>'
config.shadowTiddlers.PublishTemplateBody = '<div class=\'viewer\' id=\'contentWrapper\'><small><a href=\"./publish/index.html\">Home</a> > %1</small><h1>%0</h1>\n<h2>%1</h2>\n%2\n<hr>Tags: %3\n<hr>%4, %5 (created %6)\n</div>\n'
config.shadowTiddlers.PublishTemplateBodySingle = '<h1>%0</h1>\n<h2>%1</h2>\n%2\n<hr>Tags: %3\n<hr>%4, %5 (created %6)\n</div>\n'
config.shadowTiddlers.PublishIndexTemplate = '<div class=\'viewer\' id=\'contentWrapper\'><small><a href="./publish/index.html">Home</a> > %1</small><h1>%0</h1><h2>%1</h2>\n<ul>%2\n</ul>\n<small>Published: %6</small>\n</div>\n';
config.macros.doPublish.handler = function(place)
{
if (!readOnly)
createTiddlyButton(place, this.label, this.prompt,
function() {
doPublish();
return false;
},
null, null, this.accessKey);
}
config.macros.publishTiddler = {
label : 'publish',
prompt : 'Publish this tiddler as an HTML file.',
handler : function(place,macroName,params,wikifier,paramString,tiddler)
{
var btn = createTiddlyButton(place, this.label, this.prompt,
function(e) {
if(!e) var e = window.event;
publishTiddler(this.getAttribute('tiddler'))
return false;
},
null, null, this.accessKey);
btn.setAttribute('tiddler', tiddler.title);
}}
config.commands.publishTiddler = {handler : function(event,src,title) {publishTiddler(title);},text: "publish", tooltip: "Publish this tiddler as HTML"};
function publishTiddler(title) {
//debugger
var PublishFolder = getWikiPath('publish');
var place = document.getElementById(story.container)
var HTMLTemplateHead = store.getTiddlerText("PublishTemplateHead");
var HTMLTemplateBody = store.getTiddlerText("PublishTemplateBodySingle") || store.getTiddlerText("PublishTemplateBody");
HTMLTemplateBody = renderTemplate(HTMLTemplateBody)
HTMLTemplateBody = wiki2Web(HTMLTemplateBody);
var tiddler = store.getTiddler(title);
var tiddlerText = store.getValue(tiddler, 'text');
var tiddlerHTML = wikifyStatic(tiddlerText);
var HTML = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + HTMLTemplateBody + '\n</body>\n</html>';
HTML = HTML.format([
wikifyPlain("SiteTitle").htmlEncode(),
tiddler.title.htmlEncode(),
wiki2Web(tiddlerHTML),
tiddler.tags.join(", "),
tiddler.modifier,
tiddler.modified.toLocaleString(),
tiddler.created.toLocaleString(),
tiddlerText
]);
saveFile(PublishFolder + tiddler.title.filenameEncode() + ".html", HTML);
//story.closeTiddler(tiddler.title);
//var indexWin = window.open((PublishFolder + title.filenameEncode() + ".html").replace(/\\/g, "/"), null);
indexWin.focus();
}
function doPublish() {
var savedTiddlers = [];
var tiddlers = store.getTiddlers("title");
var place = document.getElementById(story.container)
var HTMLTemplateHead = store.getTiddlerText("PublishTemplateHead");
var HTMLTemplateBody = store.getTiddlerText("PublishTemplateBody");
HTMLTemplateBody = renderTemplate(HTMLTemplateBody)
HTMLTemplateBody = wiki2Web(HTMLTemplateBody);
var PublishTags = config.options.txtPublishTags || "publish";
PublishTags = PublishTags.split(",")
var PublishFolder = getWikiPath('publish');
if (!PublishFolder) return;
var indexFile = "";
var indexFileTemplate = store.getTiddlerText("PublishIndexTemplate");
// This does not allow <<myMacro>> but wants <div macro="myMacro">
indexFileTemplate = renderTemplate(indexFileTemplate)
// This option allows WIKI-syntax but is limited in it's HTML capabilities
//indexFileTemplate = wikifyStatic(indexFileTemplate)
for (var t = 0; t < tiddlers.length; t++) {
var tiddler = tiddlers[t];
if (tiddler.tags.containsAny(PublishTags)) {
var tiddlerText = store.getValue(tiddler, 'text');
var tiddlerHTML = wikifyStatic(tiddlerText);
var HTML = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + HTMLTemplateBody + '\n</body>\n</html>';
HTML = HTML.format([
wikifyPlain("SiteTitle").htmlEncode(),
tiddler.title.htmlEncode(),
wiki2Web(tiddlerHTML),
tiddler.tags.join(", "),
tiddler.modifier,
tiddler.modified.toLocaleString(),
tiddler.created.toLocaleString(),
tiddlerText
]);
//saveFile(PublishFolder + tiddler.created.formatString("YYYY0MM0DD") + ".html", HTML);
saveFile(PublishFolder + tiddler.title.filenameEncode() + ".html", HTML);
indexFile += "<li><a href=\"" + tiddler.title.filenameEncode() + ".html" + "\" class=\"tiddlyLink tiddlyLinkExisting\">" + tiddler.title + "</a></li>\n";
story.closeTiddler(tiddler.title);
}
}
indexFileTemplate = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + indexFileTemplate + '\n</body>\n</html>';
indexFileTemplate = indexFileTemplate.format([wikifyPlain("SiteTitle").htmlEncode(), wikifyPlain("SiteSubtitle").htmlEncode(), "%2", "", "", "", (new Date()).toLocaleString()])
indexFile = indexFileTemplate.replace("%2", indexFile)
indexFile = wiki2Web(indexFile);
saveFile(PublishFolder + "index.html", indexFile)
saveFile(PublishFolder + "style.css", store.getTiddlerText("StyleSheet") + store.getTiddlerText("StyleSheetLayout") + store.getTiddlerText("StyleSheetColors"))
var indexWin = window.open("file:///" + PublishFolder.replace(/\\/g, "/") + "index.html", null);
indexWin.focus();
}
function renderTemplate(html) {
var result = document.createElement("div");
result.innerHTML = html;
applyHtmlMacros(result, null);
var temp = result.innerHTML;
//result.parentNode.removeChild(result);
return temp;
}
// Convert wikified text to html
function wiki2Web(wikiHTML) {
//var regexpLinks = new RegExp("<a tiddlylink=.*?</a>", "img");
var regexpLinks = /<a[^>]+tiddlylink\s*=\s*["']?\s*?([^ "'>]*)\s*["']?[^>]*>[^<]+<\/a>/img;
var result = wikiHTML.match(regexpLinks);
if (result) {
for (i = 0; i < result.length; i++) {
var className = result[i].match(/ class="(.*?)"/i) ? result[i].match(/ class="(.*?)"/i)[1] : "";
var tiddlerName = result[i].match(/ tiddlylink="(.*?)"/i)[1];
var url = tiddlerName.htmlDecode().filenameEncode() + ".html";
var tiddlerLabel = result[i].match(/">(.*?)<\/a>/i)[1];
if (!className.match(/tiddlyLinkNonExisting/i))
wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" href=\"" + url + "\">" + tiddlerLabel + "</a>");
else
wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" title=\"Page does not exist\" href=\"#\">" + tiddlerName + "</a>");
}
wikiHTML = wikiHTML.replace(/ href="http:\/\//gi, " target=\"_blank\" href=\"http://");
}
return wikiHTML
}
function getWikiPath(folderName) {
var originalPath = document.location.toString();
if (originalPath.substr(0, 5) != 'file:') {
alert(config.messages.notFileUrlError);
if (store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null, config.messages.saveInstructions);
return;
}
var localPath = getLocalPath(originalPath);
var backSlash = localPath.lastIndexOf('\\') == -1 ? '/': '\\';
var dirPathPos = localPath.lastIndexOf(backSlash);
var subPath = localPath.substr(0, dirPathPos) + backSlash + (folderName ? folderName + backSlash: '');
return subPath;
}
// Replace without regex
String.prototype.myReplace = function(sea, rep) {
var t1 = this.indexOf(sea);
var t2 = parseInt(this.indexOf(sea)) + parseInt(sea.length);
var t3 = this.length;
return this.substring(0, t1) + rep + this.substring(t2, t3)
}
// Convert illegal characters to underscores
String.prototype.filenameEncode = function()
{
return (this.toLowerCase().replace(/[^a-z0-9_-]/g, "_"));
}
//}}}
This package provides a toolbar of interactive 'power tools' that you can use while editing a tiddler to quickly insert TiddlyWiki tiddler links, images, macros, etc. or common formatting sequences directly into tiddler content, as well as perform other functions (such as find/replace, sort, split, convert, etc.) that can be used to modify the current tiddler's source content in a variety of ways.
<<tiddler QuickEditToolbar with: show>>
!!!!!Installation:
<<<
Individual ~QuickEdit buttons are defined in separate tiddlers (e.g., [[QuickEdit_replace]]) that have also been //transcluded// into a single toolbar definition named [[QuickEditToolbar]]. You can edit this definition to add, remove, or rearrange the toolbar buttons to best suit your needs, and then embed the [[QuickEditToolbar]] tiddler into your document's [[EditTemplate]], like this:
{{{
<div macro='tiddler QuickEditToolbar'></div>
}}}
Next, in order to support some of the formatting 'shortcuts' provided by the toolbar, add a reference to the shortcuts CSS class definitions in your [[StyleSheet]]:
{{{
[[StyleSheetShortcuts]]
}}}
By default, the QuickEdit toolbar is hidden until you enable it by using the ''toggleQuickEdit'' command, which you can add to the ~EditToolbar definition in [[ToolbarCommands]]:
{{{
|EditToolbar|... toggleQuickEdit ...|
}}}
You can also toggle the ~QuickEdit toolbar display via a single checkbox option that can be added to [[SideBarOptions]] (or any other desired location):
{{{
<<option chkShowQuickEdit>> show QuickEdit toolbar
}}}
Note: You can 'hard-code' the ''chkShowQuickEdit'' setting, so that the toolbar will be //initially// displayed, by creating a tiddler (e.g., ConfigTweaks), tagged with <<tag systemConfig>>, containing:
{{{
config.options.chkShowQuickEdit=true;
}}}
Alternatively, if you want the toolbar to //always// be displayed, regardless of the option setting, you can add a special keyword, ''show'', to the [[EditTemplate]] syntax, like this:
{{{
<div macro='tiddler QuickEditToolbar with: show'></div>
}}}
<<<
/***
|Name|QuickEditPlugin|
|Source|http://www.TiddlyTools.com/#QuickEditPlugin|
|Documentation|http://www.TiddlyTools.com/#QuickEditPlugin|
|Version|2.4.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Support functions for ~QuickEdit package: styles, utility functions, and 'toggleQuickEdit' command|
!!!!!Revisions
<<<
2009.05.07 [2.4.2] added processed() function to abbreviate event handler code
2008.09.07 [2.4.1] added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.05.17 [2.4.0] copied code from StickyPopupPlugin to remove dependency
2008.05.12 [2.3.0] added "toggleQuickEdit" command handler (replaces inline script command)
2008.01.11 [2.2.0] converted from inline script
2007.03.29 [1.0.0] initial release (as inline script)
<<<
!!!!!Code
***/
//{{{
version.extensions.QuickEditPlugin= {major: 2, minor: 4, revision: 2, date: new Date(2009,5,7)};
// SET STYLESHEET
setStylesheet("\
.quickEdit a { border:2px outset ButtonFace; padding:0px 3px !important; \
-moz-border-radius:.5em; -webkit-border-radius:.5em; \
-moz-appearance:button !important; -webkit-appearance:push-button !important; \
background-color:ButtonFace; color:ButtonText !important; \
line-height:200%; font-weight:normal; } \
.quickEdit a:hover { border: 2px inset ButtonFace; background-color:ButtonFace; }\
", "quickEditStyles");
// REMOVE COOKIE
if (window.removeCookie===undefined) {
window.removeCookie=function(name) {
document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;';
}
}
// UTILITY FUNCTIONS
config.quickEdit = {
processed: function(ev) {
ev.cancelBubble=true;
if(ev.stopPropagation) ev.stopPropagation();
return false;
},
getField: function(where) {
var here=story.findContainingTiddler(where); if (!here) return null;
var e=story.getTiddlerField(here.getAttribute("tiddler"),"text");
if (e&&e.getAttribute("edit")=="text") return e;
return null;
},
setSelection: function(where,newtext) {
var e=this.getField(where); if (!e) return false;
e.focus(); replaceSelection(e,newtext);
return false;
},
wrapSelection: function(where,before,after) {
var e=this.getField(where); if (!e) return false;
e.focus(); replaceSelection(e,before+config.quickEdit.getSelection(e)+after);
return false;
},
getSelection: function(e) {
var seltext="";
if (e&&e.setSelectionRange)
seltext=e.value.substr(e.selectionStart,e.selectionEnd-e.selectionStart);
else if (document.selection) {
var range = document.selection.createRange();
if (range.parentElement()==e) seltext=range.text
}
return seltext;
},
promptForFilename: function(msg,path,file) {
if(window.Components) { // moz
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, nsIFilePicker.modeOpen);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='jpg';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterImages);
if (picker.show()!=nsIFilePicker.returnCancel)
var result="file:///"+picker.file.persistentDescriptor.replace(/\\/g,'/');
}
catch(e) { alert('error during local file access: '+e.toString()) }
}
else { // IE
try { // XP only
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|JPG files|*.jpg|GIF files|*.gif|PNG files|*.png|';
s.FilterIndex=1; // default to JPG
s.InitialDir=path;
s.FileName=file;
if (s.showOpen()) var result=s.FileName;
}
catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
}
return result;
}
}
//}}}
//{{{
if (config.options.chkShowQuickEdit===undefined) config.options.chkShowQuickEdit=false;
config.commands.toggleQuickEdit = {
hideReadOnly: true,
getText: function() { return config.options.chkShowQuickEdit?'\u221Aquickedit':'quickedit'; },
tooltip: 'show QuickEdit toolbar buttons',
handler: function(event,src,title) {
config.options.chkShowQuickEdit=!config.options.chkShowQuickEdit;
config.macros.option.propagateOption("chkShowQuickEdit","checked", config.options.chkShowQuickEdit,"input");
if (config.options.chkShowQuickEdit) saveOptionCookie("chkShowQuickEdit");
else removeCookie("chkShowQuickEdit");
src.innerHTML=config.commands.toggleQuickEdit.getText();
story.forEachTiddler(function(t,e){if (story.isDirty(t)) refreshElements(e);});
return false;
}
};
//}}}
// // COPIED FROM [[StickyPopupPlugin]] TO ELIMINATE PLUGIN DEPENDENCY
//{{{
if (config.options.chkStickyPopups==undefined) config.options.chkStickyPopups=false;
Popup.stickyPopup_onDocumentClick = function(ev)
{
// if click is in a sticky popup, ignore it so popup will remain visible
var e = ev ? ev : window.event; var target = resolveTarget(e);
var p=target; while (p) {
if (hasClass(p,"popup") && (hasClass(p,"sticky")||config.options.chkStickyPopups)) break;
else p=p.parentNode;
}
if (!p) // not in sticky popup (or sticky popups disabled)... use normal click handling
Popup.onDocumentClick(ev);
return true;
};
try{removeEvent(document,"click",Popup.onDocumentClick);}catch(e){};
try{addEvent(document,"click",Popup.stickyPopup_onDocumentClick);}catch(e){};
//}}}
/%
|Name|QuickEditToolbar|
|Source|http://www.TiddlyTools.com/#QuickEditToolbar|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin, InlineJavascriptPlugin|
|Optional|QuickEdit_replace, QuickEdit_split, QuickEdit_link, QuickEdit_macro, QuickEdit_image, QuickEdit_tiddler, QuickEdit_file, QuickEdit_format, QuickEdit_sort|
|Overrides||
|Description|quickly insert TiddlyWiki tiddler links or common formatting sequences directly into tiddler content|
Usage (in EditTemplate): <div macro='tiddler QuickEditToolbar with: show'></div>
where "show" is an OPTIONAL keyword to force the toolbar to be displayed regardless of the current 'toggle' state
%/<<tiddler HideTiddlerTags>>/%
TOOLBAR DEFINITIONS BEGIN HERE...
= = = = = = = = = = = = = = = = =
%/{{hidden fine center quickEdit{
<script>
// note: always show toolbar when directly viewing the tiddler containing the actual toolbar definition!
var here=story.findContainingTiddler(place); if (here) var tid=here.getAttribute("tiddler");
var show="$1"!="$"+"1"||config.options.chkShowQuickEdit||tid=="QuickEditToolbar"
place.style.display=show?"block":"none";
</script>/%
%/<<tiddler QuickEdit_replace>>/%
%/<<tiddler QuickEdit_split>>/%
%/<<tiddler QuickEdit_sort>>/%
%/<<tiddler QuickEdit_convert>>/%
%/ /% (SPACER)
%/<<tiddler QuickEdit_link>>/%
%/<<tiddler QuickEdit_insert>>/%
%/<<tiddler QuickEdit_macro>>/%
%/<<tiddler QuickEdit_image>>/%
%/<<tiddler QuickEdit_file>>/%
%/ /% (SPACER)
%/<<tiddler QuickEdit_format>>/%
%/<<tiddler QuickEdit_align>>/%
%/<<tiddler QuickEdit_color>>/%
%/<<tiddler QuickEdit_font>>/%
%/<<tiddler QuickEdit_custom>>/%
%/}}}
/%
|Name|QuickEdit_align|
|Source|http://www.TiddlyTools.com/#QuickEdit_align|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button for text alignment|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_align>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_align'></span>
**** ALIGNMENT ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="align text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select text alignment...','');
s.options[s.length]=new Option('left','left');
s.options[s.length-1].title='{{left{...}}}';
s.options[s.length]=new Option('center','center');
s.options[s.length-1].title='{{center{...}}}';
s.options[s.length]=new Option('right','right');
s.options[s.length-1].title='{{right{...}}}';
s.options[s.length]=new Option('justify','justify');
s.options[s.length-1].title='{{justify{...}}}';
s.options[s.length]=new Option('float left','floatleft');
s.options[s.length-1].title='{{floatleft{...}}}';
s.options[s.length]=new Option('float right','floatright');
s.options[s.length-1].title='{{floatright{...}}}';
s.size=s.length;
s.onclick=function(){ if (!this.value.length) return;
config.quickEdit.wrapSelection(this.button,'{{'+this.value+'{','}}}');
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>align</a></html>
/%
|Name|QuickEdit_color|
|Source|http://www.TiddlyTools.com/#QuickEdit_color|
|Version|2.2.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition of toolbar button for "color" command|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_color>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_color'></span>
**** COLOR ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="text/background color - @@color:#RGB;background-color:#RGB;...@@"
onclick="var p=Popup.create(this,null,'popup sticky smallform'); if (!p) return false;
p.style.padding='2px';
function hex(d) { return '0123456789ABCDEF'.substr(d,1); }
var fg=createTiddlyElement(p,'select'); fg.button=this;
fg.style.width='12em';
fg.options[0]=new Option('text color...','');
fg.options[1]=new Option('\xa0 or enter a value','_ask');
fg.options[2]=new Option('\xa0 or use default color','');
for (var r=0;r<16;r+=3) for (var g=0;g<16;g+=3) for (var b=0;b<16;b+=3) {
var label=hex(r)+hex(g)+hex(b);
fg.options[fg.length]=new Option(label,'#'+label);
fg.options[fg.length-1].style.color='#'+label;
}
fg.onchange=function(){ var val=this.value;
if (val=='_ask') { val=prompt('Enter a CSS color value');
if (!val||!val.length) return false; }
this.options[0].value=val; this.options[0].text=val.length?'text: '+val:'text color...';
var bg=this.nextSibling;
for (var i=3;i<bg.options.length;i++) bg.options[i].style.color=val;
var preview=this.nextSibling.nextSibling.nextSibling;
var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
if (!t.length) t='~AaBbCcDdEeFfGgHhIiJj 1234567890';
var fg=this.value; if (fg.length) fg='color:'+fg+';';
var bg=this.nextSibling.value; if (bg.length) bg='background-color:'+bg+';';
if (fg.length||bg.length) t='@@'+fg+bg+t+'@@';
removeChildren(preview); wikify(t,preview);
this.selectedIndex=0; return false;
};
var bg=createTiddlyElement(p,'select'); bg.button=this;
bg.style.width='12em';
bg.options[0]=new Option('background color...','');
bg.options[1]=new Option('\xa0 or enter a value','_ask');
bg.options[2]=new Option('\xa0 or use default color','');
for (var r=0;r<16;r+=3) for (var g=0;g<16;g+=3) for (var b=0;b<16;b+=3) {
var label=hex(15-r)+hex(15-g)+hex(15-b);
bg.options[bg.length]=new Option(label,'#'+label);
bg.options[bg.length-1].style.backgroundColor='#'+label;
}
bg.onchange=function(){ var val=this.value;
if (val=='_ask') { val=prompt('Enter a CSS color value');
if (!val||!val.length) return false; }
this.options[0].value=val;
this.options[0].text=val.length?'background: '+val:'background color...';
var fg=this.previousSibling;
for (var i=3;i<fg.options.length;i++) fg.options[i].style.backgroundColor=val;
var preview=this.nextSibling.nextSibling;
var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
if (!t.length) t='~AaBbCcDdEeFfGgHhIiJj 1234567890';
var fg=this.previousSibling.value; if (fg.length) fg='color:'+fg+';';
var bg=this.value; if (bg.length) bg='background-color:'+bg+';';
if (fg.length||bg.length) t='@@'+fg+bg+t+'@@';
removeChildren(preview); wikify(t,preview);
this.selectedIndex=0; return false;
};
var b=createTiddlyElement(p,'input',null,null,null,{type:'button'}); b.button=this;
b.value='ok'; b.style.width='4em';
b.onclick=function() {
var fg=this.previousSibling.previousSibling.value; if (fg.length) fg='color:'+fg+';';
var bg=this.previousSibling.value; if (bg.length) bg='background-color:'+bg+';';
var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
if (fg.length||bg.length) config.quickEdit.setSelection(this.button,'@@'+fg+bg+t+'@@');
Popup.remove(); return false;
};
var preview=createTiddlyElement(p,'div',null,'viewer'); var s=preview.style;
s.border='1px solid'; s.margin='2px'; s.width='24em'; s.padding='3px'; s.MozBorderRadius='3px';
s.overflow='hidden'; s.textAlign='center'; s.whiteSpace='normal';
var t=config.quickEdit.getSelection(config.quickEdit.getField(this));
wikify(t.length?t:'~AaBbCcDdEeFfGgHhIiJj 1234567890',preview);
Popup.show(p,false);
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>color</a></html>
/%
|Name|QuickEdit_convert|
|Source|http://www.TiddlyTools.com/#QuickEdit_convert|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|toolbar button for converting tab/comma-separated data to/from table format|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_convert>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_convert'></span>
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="convert between tab-separated, comma-separated data and wiki table formats"
onclick="var e=config.quickEdit.getField(this);
if (e) e.focus(); var txt=config.quickEdit.getSelection(e);
if (txt.indexOf(',')+txt.indexOf('\t')+txt.indexOf('|')==-3) {
alert('Please select text containing tabs, commas, or TiddlyWiki table syntax.');
return false;
}
var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select a converter...','');
if (txt.indexOf(',')!=-1) {
s.options[s.length]=new Option('commas -> table','commasToTable');
s.options[s.length]=new Option('commas -> tabs','commasToTabs');
}
if (txt.indexOf('\t')!=-1) {
s.options[s.length]=new Option('tabs -> table','tabsToTable');
s.options[s.length]=new Option('tabs -> commas','tabsToCommas');
}
if (txt.indexOf('|')!=-1) {
s.options[s.length]=new Option('table -> tabs','tableToTabs');
s.options[s.length]=new Option('table -> commas','tableToCommas');
}
s.size=s.length;
s.onclick=function(){ if (!this.value.length) return;
var e=config.quickEdit.getField(this.button); if (!e) return false;
e.focus(); var txt=config.quickEdit.getSelection(e);
switch(this.value) {
case 'tabsToTable':
txt=txt.replace(/\t/g,'|').replace(/^|$/g,'|');
txt=txt.replace(/\n/g,'|\n|').replace(/^\|$/g,'');
break;
case 'tableToTabs':
txt=txt.replace(/\t/g,' ').replace(/\|/g,'\t');
txt=txt.replace(/^\t/g,'').replace(/\t$/g,'');
txt=txt.replace(/\n\t/g,'\n').replace(/\t\n/g,'\n');
break;
case 'commasToTable':
txt=txt.replace(/,/g,'|').replace(/^|$/g,'|');
txt=txt.replace(/\n/g,'|\n|').replace(/^\|$/g,'');
break;
case 'tableToCommas':
txt=txt.replace(/,/g,' ').replace(/\|/g,',');
txt=txt.replace(/^,/g,'').replace(/,$/g,'');
txt=txt.replace(/\n,/g,'\n').replace(/,\n/g,'\n');
break;
case 'tabsToCommas':
txt=txt.replace(/\t/g,',');
break;
case 'commasToTabs':
txt=txt.replace(/,/g,'\t');
break;
}
replaceSelection(e,txt);
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>convert</a></html>
/%
|Name|QuickEdit_convert|
|Source|http://www.TiddlyTools.com/#QuickEdit_convert|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|toolbar button for converting tab/comma-separated data to/from table format|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_convert>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_convert'></span>
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="Konverter mellem tab-sparerede, komma-separerede data og wiki tabel formater"
onclick="var e=config.quickEdit.getField(this);
if (e) e.focus(); var txt=config.quickEdit.getSelection(e);
var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.onchange=function(){
if (!this.value) return false;
var e=config.quickEdit.getField(this.button); if (!e) return false;
e.focus(); var txt=config.quickEdit.getSelection(e);
switch(this.value) {
case 'tabsToTable':
txt=txt.replace(/\t/g,'|').replace(/^|$/g,'|');
txt=txt.replace(/\n/g,'|\n|').replace(/^\|$/g,'');
break;
case 'tableToTabs':
txt=txt.replace(/\t/g,' ').replace(/\|/g,'\t');
txt=txt.replace(/^\t/g,'').replace(/\t$/g,'');
txt=txt.replace(/\n\t/g,'\n').replace(/\t\n/g,'\n');
break;
case 'commasToTable':
txt=txt.replace(/,/g,'|').replace(/^|$/g,'|');
txt=txt.replace(/\n/g,'|\n|').replace(/^\|$/g,'');
break;
case 'tableToCommas':
txt=txt.replace(/,/g,' ').replace(/\|/g,',');
txt=txt.replace(/^,/g,'').replace(/,$/g,'');
txt=txt.replace(/\n,/g,'\n').replace(/,\n/g,'\n');
break;
case 'tabsToCommas':
txt=txt.replace(/\t/g,',');
break;
case 'commasToTabs':
txt=txt.replace(/,/g,'\t');
break;
}
replaceSelection(e,txt);
Popup.remove(); return false;
};
s.options[0]=new Option('vælg en konverter...','');
if (txt.indexOf(',')!=-1) {
s.options[s.length]=new Option('commas -> table','kommaer til tabel');
s.options[s.length]=new Option('commas -> tabs','kommaer til faneblade');
}
if (txt.indexOf('\t')!=-1) {
s.options[s.length]=new Option('tabs -> table','faneblade til tabel');
s.options[s.length]=new Option('tabs -> commas','fnaeblade til kommaer');
}
if (txt.indexOf('|')!=-1) {
s.options[s.length]=new Option('table -> tabs','tabel til faneblade');
s.options[s.length]=new Option('table -> commas','tabel til kommaer');
}
if (s.options.length==1) {
s.options[0]=new Option('vælgt noget tekst først...','');
if (txt.length) alert('Ingen konvertere kan anvendes, fordi den valgte tekst ikke indeholder nogle faneblade, kommaer, eller TiddlyWiki tabel syntaks.');
}
Popup.show(p,false);
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>Konvertér</a></html>
/%
|Name|QuickEdit_custom|
|Source|http://www.TiddlyTools.com/#QuickEdit_custom|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|provides a droplist of custom-defined formats|
Usage:
in QuickEditToolbar: <<tiddler QuickEdit_custom>>
OR
in EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_custom'></span>
!help
Reminders:
Custom format definitions are stored as an "HR-separated list" in a tiddler named [[QuickEdit_customList]].
The first line of each list item is the text 'label' to show in the droplist, followed by one or more lines of wiki content to be inserted into the tiddler source.
To embed the tiddler editor's current selected text within the formatted output, use "$1" (without quotes) to mark the position(s) where the selection should be inserted.
!end help
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="custom defined formats"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select a custom format...','');
var items=store.getTiddlerText('QuickEdit_customList','').split('\n----\n');
for (var i=0; i<items.length; i++) {
if (!items[i].length) continue; var lines=items[i].split('\n');
var label=lines.shift(); var val=lines.join('\n');
s.options[s.length]=new Option(label,val); s.options[s.length-1].title=val;
}
s.options[s.length]=new Option('[Edit custom formats...]','_edit');
s.options[s.length-1].title='add/change custom format definitions...';
s.size=Math.min(s.length,15);
s.onclick=function(){ if (!this.value.length) return;
if (this.value=='_edit') {
alert(store.getTiddlerText('QuickEdit_custom##help'));
story.displayTiddler(story.findContainingTiddler(this.button),
'QuickEdit_customList',DEFAULT_EDIT_TEMPLATE);
} else {
var e=config.quickEdit.getField(this.button); if (!e) return false;
e.focus(); var txt=config.quickEdit.getSelection(e);
replaceSelection(e,this.value.replace(/\$\x31/g,txt));
}
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>custom</a></html>
scrollbox
@@display:block;height:10em;overflow:auto;$1@@@@display:block;text-align:right;^^scroll for more...^^@@
----
nested slider
+++[$1]<<tiddler $1>>===
----
big red
@@font-size:36pt;color:red;$1@@
----
wikilink
[[$1]]
-----
/%
|Name|QuickEdit_font|
|Source|http://www.TiddlyTools.com/#QuickEdit_font|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button that set font-family CSS attribute|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_font>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_macro'></span>
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="set font-family CSS attribute - @@font-family:facename;...@@"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select a font family...','');
var fonts=store.getTiddlerText('QuickEdit_fontList','').split('\n');
for (var i=0; i<fonts.length; i++) {
if (!fonts[i].length) continue;
s.options[s.length]=new Option(fonts[i],fonts[i]);
s.options[s.length-1].style.fontFamily=fonts[i];
}
s.options[s.length]=new Option('[Edit font list...]','_edit');
s.options[s.length-1].title='enter fonts, one per line...';
s.size=Math.min(s.length,15);
s.onclick=function(){
if (this.value=='_edit')
story.displayTiddler(story.findContainingTiddler(this.button),'QuickEdit_fontList',DEFAULT_EDIT_TEMPLATE);
else
config.quickEdit.wrapSelection(this.button,'@@font-family:\x22'+this.value+'\x22;','@@');
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>font</a></html>
Arial,helvetica,sans-serif
Times New Roman,times,serif
Courier,monospaced
/%
|Name|QuickEdit_format|
|Source|http://www.TiddlyTools.com/#QuickEdit_format|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button for text formatting|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_format>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_format'></span>
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="plain text (remove ALL formatting)" accesskey="P"
onclick="var e=config.quickEdit.getField(this); if (e) e.focus(); var txt=config.quickEdit.getSelection(e);
config.quickEdit.setSelection(e,wikifyPlainText(txt)); return false;"
> ~ </a></html>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="''bold''" accesskey="B"
onclick="config.quickEdit.wrapSelection(this,'\x27\x27','\x27\x27'); return false;"
> B </a></html>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="//italics//" accesskey="I"
onclick="config.quickEdit.wrapSelection(this,'//','//'); return false;"
> I </a></html>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="__underline__" accesskey="U"
onclick="config.quickEdit.wrapSelection(this,'__','__'); return false;"
> U </a></html>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="--strikethrough--" accesskey="S"
onclick="config.quickEdit.wrapSelection(this,'--','--'); return false;"
> S </a></html>/%
%/ /% SPACER
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="format text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select text format...','');
s.options[s.length]=new Option('CSS class wrapper','{{$1{,}}},Enter a CSS classname');
s.options[s.length-1].title='CSS class wrapper - {{classname classname etc{...}}}';
s.options[s.length]=new Option('inline CSS styles','@@$1,@@,Enter CSS (attribute:value;attribute:value;...;)');
s.options[s.length-1].title='inline CSS styles - @@attr:value;attr:value;...@@';
s.options[s.length]=new Option('heading 1','\n!,\n');
s.options[s.length-1].title='H1 heading - !';
s.options[s.length]=new Option('heading 2','\n!!,\n');
s.options[s.length-1].title='H2 heading - !!';
s.options[s.length]=new Option('heading 3','\n!!!,\n');
s.options[s.length-1].title='H3 heading - !!!';
s.options[s.length]=new Option('heading 4','\n!!!!,\n');
s.options[s.length-1].title='H4 heading - !!!!';
s.options[s.length]=new Option('heading 5','\n!!!!!,\n');
s.options[s.length-1].title='H5 heading - !!!!!';
s.options[s.length]=new Option('blockquote','\n\<\<\<\n,\n\<\<\<\n');
s.options[s.length-1].title='indented blockquote - \<\<\<';
s.options[s.length]=new Option('monospaced','{{{,}}}');
s.options[s.length-1].title='inline monospaced text - {{{...}}}';
s.options[s.length]=new Option('plain text','\n{{{\n,\n}}}\n');
s.options[s.length-1].title='multi-line monospaced text box - {{{...}}}';
s.options[s.length]=new Option('superscript','^^,^^');
s.options[s.length-1].title='^^superscript^^';
s.options[s.length]=new Option('subscript','~~,~~');
s.options[s.length-1].title='~~subscript~~';
s.options[s.length]=new Option('HTML','<html>,<\x2fhtml>');
s.options[s.length-1].title='HTML syntax - <html>...<\x2fhtml>';
s.options[s.length]=new Option('comment','/%,%/');
s.options[s.length-1].title='comment (hidden content) - /%...%/';
s.size=s.length;
s.onclick=function(){ if (!this.value.length) return;
var parts=this.value.split(',');
var prefix=parts[0]; var suffix=parts[1]; var ask=parts[2];
if (ask) {
var val=prompt(ask); if (!val) { Popup.remove(); return false; }
prefix=prefix.replace(/\$1/g,val); suffix=suffix.replace(/\$1/g,val);
}
config.quickEdit.wrapSelection(this.button,prefix,suffix);
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>format</a></html>
/%
|Name|QuickEdit_image|
|Source|http://www.TiddlyTools.com/#QuickEdit_image|
|Version|2.2.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar buttons that insert embedded image references|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_image>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_image'></span>
**** INSERT IMAGE ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="embed an image (jpg/gif/png) - [img[tooltip|URL]] or [img[tooltip|path/to/file.ext]]"
onclick="var fn=config.quickEdit.promptForFilename('Enter/select an image file',getLocalPath(document.location.href),'');
if (!fn) return false; /* cancelled by user */
var tip=prompt('Enter a tooltip for this image',''); if (!tip) tip=''; else tip+='|';
return config.quickEdit.setSelection(this,'[img['+tip+fn+']]');"
>image</a></html>
/%
|Name|QuickEdit_insert|
|Source|http://www.TiddlyTools.com/#QuickEdit_insert|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button that inserts content from another tiddler or file|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_insert>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_insert'></span>
**** INSERT TIDDLER ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="insert content from another tiddler or external file"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s2=createTiddlyElement(p,'select'); s2.title='filter by tag';
s2.options[0]=new Option('filter by tag...','');
s2.options[s2.length]=new Option('[all tiddlers]','');
var tags=store.getTags();
for (var t=0; t<tags.length; t++) s2.options[s2.length]=new Option(tags[t][0],tags[t][0]);
s2.onchange=function(){
var tag=this.value;
var tids=tag.length?store.reverseLookup('tags',tag,true):store.reverseLookup('tags','excludeLists');
var list=this.nextSibling.nextSibling;
while (list.length) list.options[0]=null;
var prompt='select a tiddler or file...';
if (tag.length) prompt='select a tagged tiddler ['+tids.length+' matches]...';
list.options[0]=new Option(prompt,'');
if (!tag.length) list.options[list.length]=new Option('[browse for file...]','_file');
for (var t=0; t<tids.length; t++) {
list.options[list.length]=new Option(tids[t].title,tids[t].title);
list.options[list.length-1].title=tids[t].getSubtitle();
}
list.size=Math.min(list.length,10);
list.selectedIndex=0; list.focus();
this.style.width=list.offsetWidth+'px';
if (!tag.length) this.selectedIndex=0;
};
createTiddlyElement(p,'br');
var s=createTiddlyElement(p,'select'); s.button=this;
s.title='select a tiddler or file';
s.options[0]=new Option('select a tiddler or file...','');
s.options[s.length]=new Option('[browse for file...]','_file');
var tids=store.reverseLookup('tags','excludeLists');
for (var t=0; t<tids.length; t++) {
s.options[s.length]=new Option(tids[t].title,tids[t].title);
s.options[s.length-1].title=tids[t].getSubtitle();
}
s.size=Math.min(s.length,10);
s.onclick=function(){ if (!this.value.length) return false;
if (this.value=='_file') {
var fn=config.quickEdit.promptForFilename(
'Enter/select a text file',getLocalPath(document.location.href),'');
if (!fn) return false; /* cancelled by user */
var txt=loadFile(getLocalPath(fn));
if (!txt) { alert('Error: unable to read contents from \0027'+fn+'\0027'); return; }
}
else var txt=store.getTiddlerText(this.value);
if (!txt) {
displayMessage(this.value+' not found');
this.selectedIndex=0; this.focus();
return false;
}
config.quickEdit.setSelection(this.button,txt);
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s2.style.width=s.offsetWidth+'px';
s.focus();
return config.quickEdit.processed(event);"
>insert</a></html>
/%
|Name|QuickEdit_link|
|Source|http://www.TiddlyTools.com/#QuickEdit_link|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|toolbar button that inserts a ~PrettyTiddlyLink to a tiddler or external file|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_link>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_link'></span>
**** INSERT LINK ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="add a link to a tiddler or external file - [[link text|TiddlerName]]"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s2=createTiddlyElement(p,'select'); s2.title='filter by tag';
s2.options[0]=new Option('filter by tag...','');
s2.options[s2.length]=new Option('[all tiddlers]','');
var tags=store.getTags();
for (var t=0; t<tags.length; t++) s2.options[s2.length]=new Option(tags[t][0],tags[t][0]);
s2.onchange=function(){
var tag=this.value;
var tids=tag.length?store.reverseLookup('tags',tag,true):store.reverseLookup('tags','excludeLists');
var list=this.nextSibling.nextSibling;
while (list.length) list.options[0]=null;
var prompt='select a tiddler or file...';
if (tag.length) prompt='select a tagged tiddler ['+tids.length+' matches]...';
list.options[0]=new Option(prompt,'');
if (!tag.length) list.options[list.length]=new Option('[browse for file...]','_file');
for (var t=0; t<tids.length; t++) {
list.options[list.length]=new Option(tids[t].title,tids[t].title);
list.options[list.length-1].title=tids[t].getSubtitle();
}
list.size=Math.min(list.length,10);
list.selectedIndex=0; list.focus();
this.style.width=list.offsetWidth+'px';
if (!tag.length) this.selectedIndex=0;
};
createTiddlyElement(p,'br');
var s=createTiddlyElement(p,'select'); s.button=this;
s.title='select a tiddler or file';
s.options[0]=new Option('select a tiddler or file...','');
s.options[s.length]=new Option('[browse for file...]','_file');
var tids=store.reverseLookup('tags','excludeLists');
for (var t=0; t<tids.length; t++) {
s.options[s.length]=new Option(tids[t].title,tids[t].title);
s.options[s.length-1].title=tids[t].getSubtitle();
}
s.size=Math.min(s.length,10);
s.onclick=function(){ if (!this.value.length) return false;
var title=this.value; var txt=title;
if (title=='_file') {
title=config.quickEdit.promptForFilename('Select a file',
getLocalPath(document.location.href),'');
if (!title) { this.selectedIndex=0; this.focus(); return false; }
var txt=title.substr(title.lastIndexOf('/')+1);
}
var txt=prompt('Enter the text to display for this link',txt);
if (!txt) { this.selectedIndex=0; this.focus(); return false; }
config.quickEdit.setSelection(this.button,'[['+txt+'|'+title+']]');
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s2.style.width=s.offsetWidth+'px';
s.focus();
return config.quickEdit.processed(event);"
>link</a></html>
/%
|Name|QuickEdit_macro|
|Source|http://www.TiddlyTools.com/#QuickEdit_macro|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button that inserts macros with guide text|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_macro>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_macro'></span>
**** INSERT MACRO ****
The "macro" command can include optional "guideText" for any given macro, as an aide to entering macro parameters, by embedding placeholders or recommended default values into the macro syntax that is inserted into your tiddler content. For built-in TW core macros, this guideText is defined below. You can add guideText to your own plugin-defined macros by using the following javascript syntax: config.macros.macroName.guideText="guide text goes here";
%/<<tiddler {{
/* SET MACRO GUIDE TEXT (for built-in core macros) (11/17 - TBD - incomplete list) */
config.macros.edit.guideText="fieldname #rows";
config.macros.view.guideText="fieldname (link,wikified,date) format";
config.macros.slider.guideText="cookie TiddlerName label tooltip";
config.macros.option.guideText="(txtCookieName,chkCookieName)";
config.macros.tiddler.guideText="TiddlerName with: params...";
""; /* must return blank to suppress output */ }}>>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="add a macro - \<\<macroName ...\>\>"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select a macro...','');
var macros=[]; for (var m in config.macros) if (config.macros[m].handler) macros.push(m); macros.sort();
for (var i=0; i<macros.length; i++) { var m=macros[i];
var help=config.macros[m].guideText; if (!help) help=''; else help=' '+help;
s.options[s.length]=new Option(m,m+help);
s.options[s.length-1].title='\<\<'+m+help+'\>\>';
}
s.size=Math.min(s.length,15);
s.onclick=function(){ if (!this.value.length) return;
config.quickEdit.setSelection(this.button,'\<\<'+this.value+'\>\>');
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>macro</a></html>
/%
|Name|QuickEdit_replace|
|Source|http://www.TiddlyTools.com/#QuickEdit_replace|
|Version|2.2.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for find/replace toolbar button|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_replace>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_replace'></span>
**** FIND/REPLACE/NEXT/ALL ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="find/replace selected text with replacement text"
onclick="var here=story.findContainingTiddler(this); if (!here) return false;
var e=config.quickEdit.getField(here);
var s=config.quickEdit.getSelection(e);
var p=Popup.create(this,null,'popup sticky smallform'); if (!p) return false;
var t=createTiddlyElement(p,'input'); t.onfocus=function(){this.select()};
t.value=s.length?s:'enter target text';
var r=createTiddlyElement(p,'input'); r.onfocus=function(){this.select()};
r.value='enter replacement text';
var tid=here.getAttribute('tiddler');
var b=createTiddlyElement(p,'button',null,null,'?',{tid:tid});
b.style.width='2em';
b.title='FIND/FIND NEXT target text';
b.onclick=function(ev) { /* FIND */
var e=story.getTiddlerField(this.getAttribute('tid'),'text');
if (!e||e.getAttribute('edit')!='text') return;
var t=this.previousSibling.previousSibling;
e.focus();
if (e.setSelectionRange) { /* MOZ */
var newstart=e.value.indexOf(t.value,e.selectionStart+1);
if (newstart==-1) newstart=e.value.indexOf(t.value); /* wrap around */
if (newstart==-1) { alert('\u0022'+t.value+'\u0022 not found'); t.focus(); return; }
e.setSelectionRange(newstart,newstart+t.value.length);
var linecount=e.value.split('\n').length;
var thisline=e.value.substr(0,e.selectionStart).split('\n').length;
e.scrollTop=Math.floor((thisline-1-e.rows/2)*e.scrollHeight/linecount);
} else if (document.selection) { /* IE */
var range=document.selection.createRange();
if(range.parentElement()==e) {
range.collapse(false);
var found=false; try{found=range.findText(t.value,e.value.length,4)}catch(e){}
if (found) range.select();
else { alert('\u0022'+t.value+'\u0022 not found'); t.focus(); }
}
}
};
b=createTiddlyElement(p,'button',null,null,'=',{tid:tid});
b.style.width='2em';
b.title='REPLACE selected text';
b.onclick=function(ev) { /* REPLACE */
var e=story.getTiddlerField(this.getAttribute('tid'),'text');
if (!e||e.getAttribute('edit')!='text') return;
var t=this.previousSibling.previousSibling.previousSibling;
var r=this.previousSibling.previousSibling;
if ( (e.selectionStart!==undefined && e.selectionEnd==e.selectionStart)
|| (document.selection && document.selection.createRange().text==''))
this.previousSibling.click(); /* no selection... do FIND first */
if ( (e.selectionStart!==undefined && e.selectionEnd==e.selectionStart)
|| (document.selection && document.selection.createRange().text==''))
{ t.focus(); return; } /* still no selection... goto target input */
e.focus(); replaceSelection(e,r.value);
};
b=createTiddlyElement(p,'button',null,null,'+',{tid:tid});
b.style.width='2em';
b.title='REPLACE selected text AND FIND NEXT target text';
b.onclick=function(ev) { /* REPLACE and FIND NEXT */
this.previousSibling.click();
this.previousSibling.previousSibling.click();
};
b=createTiddlyElement(p,'button',null,null,'!',{tid:tid});
b.style.width='2em';
b.title='REPLACE ALL occurrences of target text';
b.onclick=function(ev) { /* REPLACE ALL */
var e=story.getTiddlerField(this.getAttribute('tid'),'text');
if (!e||e.getAttribute('edit')!='text') return;
var t=this.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
var r=this.previousSibling.previousSibling.previousSibling.previousSibling;
if (!t.value.length) { alert('Please enter the target text'); t.focus(); return; }
var m='This will replace all occurences of:\n\n';
m+='\''+t.value+'\'\n\nwith:\n\n\''+r.value+'\'\n\nAre you sure?';
if (!confirm(m)) { r.focus(); r.select(); return; }
e.value=e.value.replace(new RegExp(t.value.escapeRegExp(),'gm'),r.value);
e.focus(); e.select(); Popup.remove();
};
Popup.show(p,false);
if (!s.length) {t.focus();t.select()} else {r.focus();r.select()}
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>replace</a></html>
/%
|Name|QuickEdit_sort|
|Source|http://www.TiddlyTools.com/#QuickEdit_sort|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar "sort" button|
Usage:
QuickEditToolbar: <<tiddler QuickEdit_sort>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_sort'></span>
**** SORT LINES ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="sort lines of text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select sort order...','');
s.options[s.length]=new Option('ascending','A');
s.options[s.length-1].title='ascending';
s.options[s.length]=new Option('descending','D');
s.options[s.length-1].title='descending';
s.size=s.length;
s.onclick=function(){ if (!this.value.length) return;
var e=config.quickEdit.getField(this.button); if (!e) return false;
var lines=config.quickEdit.getSelection(e).split('\n').sort();
if (this.value=='D') lines=lines.reverse();
replaceSelection(e,lines.join('\n'));
e.focus();
Popup.remove(); return false;
};
s.onkeyup=function(ev){
var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
};
Popup.show(p,false);
s.focus();
return config.quickEdit.processed(event);"
>sort</a></html>
/%
|Name|QuickEdit_split|
|Source|http://www.TiddlyTools.com/#QuickEdit_split|
|Version|2.2.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|toolbar button: split selected content into separate tiddler|
Based on ideas originally developed by YannPerrin
(http://yann.perrin.googlepages.com/twkd.html#easySlicer)
Usage
QuickEditToolbar: <<tiddler QuickEdit_split>>
OR
EditTemplate:
<div class='toolbar'>
<span macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></span>
<span macro='tiddler QuickEdit_split'></span>
</div>
**** SPLIT TIDDLER ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1"
title="move selection to new tiddler and insert link, embedded tiddler, or slider"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
p.style.whiteSpace='nowrap';
var i=createTiddlyElement(p,'input');
i.defaultValue='Enter a new tiddler title';
i.onfocus=function(){this.select()};
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select type...','');
s.options[0].title='select split type';
s.options[1]=new Option('link','link');
s.options[1].title='replace with [[TiddlerName]]';
s.options[2]=new Option('embed','embed');
s.options[2].title='replace with \<\<tiddler TiddlerName\>\>';
s.options[3]=new Option('slider','slider');
s.options[3].title='replace with \<\<slider \u0022\u0022 [[TiddlerName]] [[label]] [[tooltip]]\>\>';
s.onchange=function(){
if (s.previousSibling.value==s.previousSibling.defaultValue)
{ alert('A tiddler title is required'); s.selectedIndex=0; s.previousSibling.focus(); return false; }
var tid=s.previousSibling.value;
if (store.tiddlerExists(tid) && !confirm(config.messages.overwriteWarning.format([tid])))
{ s.previousSibling.focus(); return false; }
switch(s.value) {
case 'link':
var newtxt='[['+tid+']]';
break;
case 'embed':
var newtxt='\<\<tiddler [['+tid+']]\>\>';
break;
case 'slider':
var label=prompt('Enter a slider label',tid);
if (!label) { Popup.remove(); return false; }
var tip=prompt('Enter a slider tooltip',label);
if (!tip) { Popup.remove(); return false; }
var newtxt='\<\<slider \u0022\u0022 [['+tid+']] [['+label+']] [['+tip+']]\>\>';
break;
}
var txt=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
store.saveTiddler(tid,tid,txt,config.options.txtUserName,new Date(),[],{});
story.displayTiddler(story.findContainingTiddler(this.button),tid);
config.quickEdit.setSelection(this.button,newtxt);
Popup.remove(); return false;
};
Popup.show(p,false);
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>split</a></html>
<<getTiddlerPassword "Skriv det password du har modtaget pr mail">>
Hej Torben
Tak for svaret.
Det lyder godt - med jeres planer om samarbejde med ~Edb-Brugsen og overgangen til ~MySql.
Jeg forstår godt dine indvendinger mod at bruge ukendt værktøj - dog vil jeg pointere at der er fuld kontrol over alle dele af ~TiddlyWiki
- alt kan udskiftes og er tilgængeligt i dokumentet...
Jeg forstår også "ægte flerbrugermulighed" som et must når der skal laves webinterfaces - Min ide er kun en midlertidig container for noget andet, der kunne være iframede programinterfaces etc... - med den ekstra mulighed at brugerne får "ægte ejerskab" for deres egen ene htmlfil (~TiddlyWiki) med mulighed for at lave egne systemer som ikke nødvendigvis skal have nogen indflydelse på hvad der ellers sker i programmet - eller deles med andre..
Her er et eksempel på en ~TiddlyWiki, der er lavet til at hente data fra en eller flere ~MediaWikis: [[mediaWikiUnplugged|http://mediawikiunplugged.com/]]
En TiddlyWiki kan bruges offline - og er perfekt til personlige notater.
Efter web2.0 er kommet ind i billedet, er det ikke kun centrale databasers sikkerhed der skal overvejes, men også de enkelte brugeres. Beskyttelse af private oplysninger - ikke kun på serveren - men også på den enkelte pc.
Det er en STOR udfordring at følge med i udviklingen af Social Learning muligheder - og finde de løsninger som giver brugerne den frihed som de forventer fra deres erfaringer på nettet i øvrigt...
En nystartet wikiengine (igen ~OpenSource) er [[Wagn|http://wagn.org]] (ægte flerbrugermulighed!). Den har et gui som på mange måder ligner TiddlyWikis. I stedet for "Tiddlers" kaldes de forskellige entries for "cards". Disse kort kan kategoriseres, sorteres - og leverer en slags "organisk database" der er også er selve wikien. Den er utroligt enkel (ligefrem smuk - efter min mening) og viser nye veje for brugervenlighed og interaktion. Check den ud her: http://wagn.org
Jeg overvejer i øvrigt at opsætte [[Elgg|http://elgg.org/]], der er en slags ~FaceBook-klon (igen ~OpenSource) som en lokal netværkstjeneste på skolen. Det ville nok ikke være helt tosset at tænke i muligheder for integration - men det skal jeg nok selv overveje (simple links - og genindlogning er fint nok i denne forbindelse...)
Mvh Måns Mårtensson - 25344884
SkolePlan wrote:
> Hej Måns!
>
> Det er korrekt, at SkolePlan efter sommerferien kommer i ny version, hvor
> databasen overgår til en SQL database. Det er dog i første omgang ikke
> MySql, men Microsoft Sql (den gratis express version).
>
> Det er ligeledes korrekt, at der er indledt et samarbejde med EDB Brugsen,
> som ifølge hensigtserklæring skal munde ud i datamæssig integration mellem
> de to systemer inden årsskiftet, således at data indtastet i det ene system
> umiddelbart kan genbruges i det andet system uden yderligere indtastning for
> brugernes vedkommende. Da EDB Brugsen har valgt MySql, er det også på
> projektet at benytte denne database til SkolePlan. Integrationen til EDB
> Brugsen samt udvikling af diverse webmoduler står dog forrest på
> prioritetslisten.
>
> Den nuværende version af SkolePlan må installeres på et vilkårligt antal af
> skolens pc'er, og det samme gælder naturligvis også den næste version.
>
> Den nuværende version er ikke en flerbrugerversion, men den kan dog anvendes
> på flere pc'er samtidigt - blot er det kun muligt at redigere på én maskine
> adgangen. Et vilkårligt antal pc'er kan således fint læse i SkolePlans data
> samtidigt.
>
> Når SkolePlan anvendes på en pc, skal den pågældende windowsbrugerkonto have
> fuld redigeringsret til den mappe, hvor SkolePlan er installeret, samt til
> brugerens egen "document and settings" mappe. Udover dette er der ikke
> særlige krav for anvendelse af SkolePlan.
>
>
> Jeg takker også for de tilsendte inspirationer, som ser meget spændende ud,
> og som også læner sig fint op af de ideer, som er på tegnebrættet. Som
> udgangspunkt vil udviklingen dog ske i velkendte værktøjer, hvor der er fuld
> kontrol over alle dele af løsningerne, og hvor der vil være ægte
> flerbrugermulighed.
>
>
> med venlig hilsen
> Torben Bjerg
> DataGiraffen
>
> mail mail@datagiraffen.dk
> web skoleplan.dk
>
> -----Oprindelig meddelelse-----
> Fra: Måns Mårtensson [mailto:mama@himmerlands-ungdomsskole.dk]
> Sendt: 11. juni 2009 08:27
> Til: mail@skoleplan.dk
> Emne: ang.Licensen til skoleplan
>
> Hej SkolePlan
>
> Vi overvejer at købe licens til Skoleplan.
> Det skyldes bl.a. at vi har hørt at SkolePlan har planer om at overgå
> til et databasesystem (MySql) og derved via et interface vil kunne dele
> oplysninger med Edb-brugsen. Vi har også hørt at SkolePlan vil udbygges
> til også at omfatte webmoduler med infotavler til brug for
> Administration, lærere, elever med flere - indenfor en overskuelig
> fremtid. Dette er vigtige præmisser for vores valg af skemaprogram - og
> det faktum at vores nye skemalægger er godt kendt med programmet i
> forvejen, spiller naturligvis også en rolle.
>
> Mit første spørgsmål går på hvad licensen indebærer. Der står på jeres
> side at licensen giver ret til at installere SkolePlan på skolens pc'er.
> Er der tale om 1 valgfri pc- installation, som kan flyttes til en anden
> efter behov - eller kan vi frit installere programmet på så mange
> maskiner vi har lyst til?
>
> Er det nogen god ide at installere programmet på flere maskiner, når det
> reelt er "standalone" - eller kan det bruge en delt database fra vores
> server - således at flere brugere kan tilgå de samme data fra
> forskellige pc'er? (en ad gangen eller på samme tid) Hvis det sidste er
> tilfældet, findes der så et brugersystem, der administrerer det således
> at forskellige brugere ikke kommer til at overskrive hinandens arbejde?
>
> Mit spørgsmål er vigtigt at få besvaret, eftersom vi har en skemalægger
> som ikke har sit eget kontor, og dermed egen "stationære" opkobling til
> skolens netværk. Han har dog en jobbærbar og adgang til flere
> stationære pc'er på arbejdet. De deles med andre brugere, med
> forskellige rettigheder på netværket.
> Ingen af netværksbrugerne har ret til at "se" den lokale pc's harddisk
> (bortset fra skrivebordet). Spiller det nogen rolle for afviklingen af
> SkolePlan?
>
> Mvh Måns Mårtensson, IT-ansvarlig på Himmerlands-Ungdomsskole,
> privat:25344884 eller job: 98664060
>
>
>
>
>
>
>
>
>
<script label="redigér 1 tiddler">
var title=prompt("Skriv titlen på den tiddler, der skal redigeres (store og små bogstaver)");
while (title && title.length && !store.tiddlerExists(title)) {
displayMessage("The tiddler '%0' doesn't exist".format([title]));
var title=prompt("Please enter a tiddler title",title);
}
if (!title||!title.length) return; /* afbrudt af bruger */
story.displayTiddler(null,title,2);
</script>
For at fjerne tagget HU fra tiddlere - skal du først markere alle tiddlere tagget med HU :
Klik på tags i øverste menulinie - skriv: HU.
Derefter skal der skrives -HU i boksen nederst th.
Andre tags fjernes ikke.
Vil du tilføje et andet tag til samme tiddlere i samme ombæring skriver du blot +~TagNavn i samme boks..
Husk at opdatér tiddlerne med knappen nederst til højre.
<<tiddlerTweaker>>
<html><input type="button" value="Refresh Styles" onClick="javascript:refreshStyles('StyleSheet');" name="button" class="btn" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/></html>
/%
|Name|RefreshTiddler|
|Source|http://www.TiddlyTools.com/#RefreshTiddler|
|Version|0.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|link that forces a refresh of the current tiddler|
usage: <<tiddler RefreshTiddler with: "label" "tooltip">>
where label and tooltip are optional and default to "refresh" and "redisplay tiddler content", respectively.
%/<script label="refresh" title="redisplay tiddler content">
var here=story.findContainingTiddler(place); if (!here) return false;
story.refreshTiddler(here.getAttribute("tiddler"),null,true);
return false;
</script><script>
if ("$1"!="$"+"1") place.lastChild.innerHTML="$1";
if ("$2"!="$"+"2") place.lastChild.title="$2";
</script>
/***
|Name|RelatedTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#RelatedTiddlersPlugin|
|Version|1.1.7|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|InlineJavascriptPlugin, NestedSlidersPlugin, StyleSheetShortcuts|
|Overrides||
|Options|##Configuration|
|Description|starting from a selected tiddler, display a list and/or tree of linked or transcluded tiddlers|
Given a starting tiddler (default is the current tiddler), this plugin recursively follows the internal links[] data that is associated with each tiddler and constructs a list of all tiddlers that are related to the starting tiddler by being referenced in a TiddlyLink (e.g., {{{[[TiddlerName]]}}}) or used as macro parameter (e.g., {{{<<tiddler TiddlerName>>}}}) within the tiddler content.
Using the terminology of Graph Theory, the plugin's recursive algorithm finds what is called a 'minimal spanning tree' from any specific starting 'root node'. The results can be displayed as a simple flat list of related tiddler titles, or as an indented tree diagram that shows the specific connections between the related tiddlers, and can be helpful for identifying clusters of interdependent tiddlers or simply generating an on-the-fly site map for quick discovery and navigation through complex or unfamiliar document content.
!!!!!Usage
<<<
//{{{
<<relatedTiddlers TiddlerName hideform "exclude list">>
//}}}
where:
*TiddlerName (optional)<br>sets the initial "root" to the specified tiddler (and hides the 'select a tiddler' form controls). You can use keyword 'here' to specify the current tiddler.
*'hideform' (optional) or 'showform' (default)<br>keyword value to suppress display of 'select tiddler' droplist and buttons.
*"exclude list" (optional)<br>space-separated list of tiddlers whose links should not be followed. use quotes or double-square brackets to ensure list is processed as a single parameter
The plugin also defines two functions that can be called externally (from other plugins or scripts) to generate and retrieve either a list of links or a formatted "tree view":
>{{{var list=config.macros.relatedTiddlers.getList(start,exclude,callback);}}}
>{{{var tree=config.macros.relatedTiddlers.getTree(start,exclude,callback);}}}
These functions accept parameters to specify the starting tiddler, and a list of tiddlers to exclude, as well as an optional callback function that takes any specified tiddler as input and returns a custom-defined array of links related to that tiddler:
>{{{var list=callback(tiddler);}}}
Use of the callback function enables you to generate an alternative list/tree, based on application-specific data (such tiddler references contained in tags or custom fields), rather than using the default "links" list.
<<<
!!!!!Configuration
<<<
<<option chkRelatedTiddlersShowList>> show list display
<<option chkRelatedTiddlersShowTree>> show tree display
<<option chkRelatedTiddlersZoom>> enable autosizing of tree display //(aka, "zoom" or "shrink-and-grow")//
don't follow links contained in these tiddlers: <<option txtRelatedTiddlersExclude>>
<<<
!!!!!Examples
<<<
{{smallform{<<relatedTiddlers>>}}}
Using getList()/getTree() public API from other scripts/plugins:
><script show>
var start="About";
var exclude=config.options.txtRelatedTiddlersExclude.readBracketedList();
var callback=null;
var list=config.macros.relatedTiddlers.getList(start,exclude,callback);
var tree=config.macros.relatedTiddlers.getTree(start,exclude,callback);
return "There are "+list.length+" tiddlers related to [["+start+"]]...\n"+tree;
</script>
<<<
!!!!!Revisions
<<<
2007.11.11 [1.1.7] in findRelatedTiddlers(), refactored into separate getlinks(),<br>and added param for optional callback function that can be used to return an alternative set of links.<br>Also added API functions, getTree() and getList() for use by other scripts
2007.07.13 [1.1.6] performance optimizations, more code cleanup
2007.07.10 [1.1.5] extensive code cleanup
2007.07.08 [1.1.0] converted from inline script
2007.06.29 [1.0.0] started (as inline script)
<<<
!!!!!Code
***/
//{{{
version.extensions.RelatedTiddlersPlugin={major: 1, minor: 1, revision: 7, date: new Date(2007,11,11)};
// initialize 'autozoom' and 'exclude' tree options (defaults are not to zoom, and to follow all links)
if (config.options.chkRelatedTiddlersZoom===undefined)
config.options.chkRelatedTiddlersZoom=false;
if (config.options.txtRelatedTiddlersExclude===undefined)
config.options.txtRelatedTiddlersExclude='GettingStarted DefaultTiddlers';
if (config.options.chkRelatedTiddlersShowList===undefined)
config.options.chkRelatedTiddlersShowList=true;
if (config.options.chkRelatedTiddlersShowTree===undefined)
config.options.chkRelatedTiddlersShowTree=false;
config.macros.relatedTiddlers={
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
// create form with unique DOM element ID (using current timestamp)... permits multiple form instances
var now=new Date().getTime();
var span=createTiddlyElement(place,"span");
span.innerHTML=this.form.format(["relatedTiddlers_form"+now]);
var form=span.getElementsByTagName("form")[0]; // find form that we just created
var target=createTiddlyElement(span,"div"); // create target block in which generated output will be placed
// initialize droplist contents (all tiddlers except hidden ones)
var tids=store.getTiddlers('title','excludeLists');
for (i=0; i<tids.length; i++) form.list.options[form.list.options.length]=new Option(tids[i].title,tids[i].title,false,false);
// initialize exclude field (space-separated list)
if (config.options.txtRelatedTiddlersExclude) form.exclude.value=config.options.txtRelatedTiddlersExclude;
// set starting tiddler, form display, and/or exclude list from macro params (if present) and then show the results!
var root="";
var hide=false;
var exclude=config.options.txtRelatedTiddlersExclude;
if (params[0]) root=params[0]; // TiddlerName
if (params[1]) hide=(params[1].toLowerCase()=="hideform"); // keyword: "hideform" or "showform" (default)
if (params[2]) exclude=params[2]; // list of tiddlers whose links should not be followed
if (root=="here") { var tid=story.findContainingTiddler(place); if (tid) root=tid.getAttribute("tiddler"); }
if (store.tiddlerExists(root)) {
// NOTE: don't hide form when running IE, where putting initial focus on hidden form creates an error
if (!config.browser.isIE) form.style.display=hide?"none":"block"; // show/hide the controls
form.list.value=root; // set the root
form.exclude.value=exclude; // set 'exclude' field
form.get.click(); // DISPLAY INITIAL RESULTS (if tiddler is selected)
}
},
form:
"<form id='%0' action='javascript:;' style='display:inline;margin:0;padding:0;' onsubmit='return false'><!-- \
--><span class='fine' style='float:left;vertical-align:bottom;width:39.5%;'><i>find all tiddlers related to:</i></span><!-- \
--><span class='fine' style='float:left;vertical-align:bottom;'><i>exclude links contained in:</i></span><!-- \
--><div style='clear:both'><!-- \
--><select name=list size=1 style='width:39.5%' onchange='this.form.get.click()'><!-- \
--><option value=''>select a tiddler...</option><!-- \
--></select><!-- \
--><input type='text' option='txtRelatedTiddlersExclude' name='exclude' value='' style='width:40%' \
title='enter the names of tiddlers whose links should NOT be followed' \
onkeyup='if (event.keyCode==13) { this.blur(); this.form.get.click(); }' \
onchange='config.options[this.getAttribute(\"option\")]=this.value;saveOptionCookie(this.getAttribute(\"option\"));'><!-- \
--><input type=button name=get value='get related' style='width:10%' \
onclick='config.macros.relatedTiddlers.show(this.form,this.form.nextSibling);'><!-- \
--><input type=button name=done value='done' disabled style='width:10%' \
onclick='this.form.list.selectedIndex=0; this.form.get.click();'><!-- \
--></div><!-- \
--></form>",
styles:
".relatedTiddlers blockquote \
{ border-left:1px dotted #999; margin:0 25px; padding-left:.5em; font-size:%0%; line-height:115%; } \
.relatedTiddlers .borderleft \
{ margin:0; padding:0; margin-left:1em; border-left:1px dotted #999; padding-left:.5em; } \
.relatedTiddlers .fourcolumns \
{ display:block; -moz-column-count:4; -moz-column-gap:1em; -moz-column-width:25%} \
.relatedTiddlers a \
{ font-weight:normal; } \
.relatedTiddlers .bold, .relatedTiddlers .bold a \
{ font-weight:bold; } \
.relatedTiddlers .floatright \
{ float:right; } \
.relatedTiddlers .clear \
{ clear:both; } ",
toggleform:
"{{floatright{<html><a href='javascript:;' class='button' title='show/hide tiddler selection droplist and buttons' \
onclick='var here=story.findContainingTiddler(this); var tid=here?here.getAttribute(\"tiddler\"):\"\"; \
var f=document.getElementById(\"%0\"); var hide=(f.style.display!=\"none\"); \
f.style.display=hide?\"none\":\"inline\"; this.innerHTML=hide?\"show form\":\"hide form\"; return false;'>%1</a></html>}}}",
treecheck:
"{{floatright{@@display:none;<<option chkRelatedTiddlersShowTree>>@@<html><a href='javascript:;' class='button' onclick='this.parentNode.previousSibling.firstChild.click(); return false;'>tree view</a></html>}}}",
tree:
"{{clear{\n----\n}}} \
{{floatright small{<<option chkRelatedTiddlersZoom>>autosize tree display}}} \
{{fine{\n''tiddlers linked from or included by'' [[%0]]\n}}}%1",
listcheck:
"{{floatright{@@display:none;<<option chkRelatedTiddlersShowList>>@@<html><a href='javascript:;' class='button' onclick='this.parentNode.previousSibling.firstChild.click(); return false;'>list view</a></html>}}}",
list:
"{{clear{\n----\n}}} \
{{fine{\n''tiddlers containing links to'' [[%0]]\n}}} \
{{small fourcolumns borderleft{\n%1}}} \
{{fine{\n''tiddlers linked from or included by'' [[%0]]\n}}} \
{{borderleft{\n \
{{fine{\n''bold''=//direct links//, plain=//indirect links//, ''...''=//links not followed//}}} \
{{small fourcolumns{\n%2}}} \
}}}",
skipped:
"<html><span title='links from %0 have NOT been followed'>...</span></html>",
mouseover: function(ev) {
this.saveSize=this.style.fontSize;
this.style.fontSize='100%';
this.style.borderLeftStyle='solid';
},
mouseout: function(ev) {
this.style.fontSize=this.saveSize;
this.style.borderLeftStyle='dotted';
},
findRelatedTiddlers: function(tid,tids,treeout,level,exclude,callback) {
// recursively build list of related tids (links and includes FROM the root tiddler) and generate treeview output
var t=store.getTiddler(tid);
if (!t || tids.contains(tid)) return tids; // tiddler already in results (or missing tiddler)... just return current results
tids.push(t.title); // add tiddler to results
var skip=exclude && exclude.contains(tid);
treeout.text+=level+"[["+tid+"]]"+(skip?this.skipped.format([tid]):"")+"\n";
if (skip) return tids; // branch is pruned... don't follow links
var links=callback?callback(t):this.getLinks(t);
for (var i=0; i<links.length; i++) tids=this.findRelatedTiddlers(links[i],tids,treeout,level+">",exclude);
return tids;
},
getLinks: function(tiddler) {
if (!tiddler.linksUpdated) tiddler.changed();
return tiddler.links;
},
getTree: function(start,exclude,callback) {
// get related tiddlers and generate blockquote-indented tree output
var list=[]; var tree={text:""}; var level="";
list=this.findRelatedTiddlers(start,list,tree,level,exclude,callback);
return tree.text;
},
getList: function(start,exclude,callback) {
// get related tiddlers and generate blockquote-indented tree output
var list=[]; var tree={text:""}; var level="";
list=this.findRelatedTiddlers(start,list,tree,level,exclude,callback);
return list;
},
show: function(form,target) {
removeChildren(target); form.done.disabled=true; // clear any existing output and disable 'done' button
var start=form.list.value; if (!start.length) return; // get selected starting tiddler. If blank value (heading), do nothing
// get related tiddlers and generate blockquote-indented tree output
var rels=[]; var treeview={text:""}; var level="";
var exclude=config.options.txtRelatedTiddlersExclude.readBracketedList();
var rels=this.findRelatedTiddlers(start,rels,treeview,level,exclude);
rels.shift(); // remove self from list
rels.sort(); // sort titles alphabetically
// generate list output
var tid=store.getTiddler(start);
var relsview=""; for (t=0; t<rels.length; t++) {
relsview+=tid.links.contains(rels[t])?("{{bold{[["+rels[t]+"]]}}}"):("[["+rels[t]+"]]");
if (exclude && exclude.contains(rels[t])) relsview+=this.skipped.format([rels[t]]);
relsview+="\n";
}
// get references TO the root tiddler, add to related tiddlers and generate refsview output
var refs=[]; var referers=store.getReferringTiddlers(start);
for(var r=0; r<referers.length; r++)
if(referers[r].title!=start && !referers[r].tags.contains("excludeLists")) refs.push(referers[r].title);
var refcount=refs.length; var relcount=rels.length; // remember individual counts
for (var r=0; r<refs.length; r++) rels.pushUnique(refs[r]); // combine lists without duplicates
var total=rels.length; // get combined total
var refsview="[["+refs.sort().join("]]\n[[")+"]]\n";
// set custom blockquote styles for treeview
setStylesheet(this.styles.format([config.options.chkRelatedTiddlersZoom?80:100]),'relatedTiddlers_styles');
// assemble and render output
var summary=(total?(total+" tiddler"+(total==1?" is":"s are")):"There are no tiddlers")+" related to: [["+start+"]]";
var list=this.list.format([start,refsview.length?refsview:"//none//",relsview.length?relsview:"//none//"]);
var tree=this.tree.format([start,treeview.text]);
var toggle=this.toggleform.format([form.id,(form.style.display=='none'?'show form':'hide form')]);
var sep="{{floatright{ | }}}";
var showList=total && config.options.chkRelatedTiddlersShowList;
var showTree=relcount && config.options.chkRelatedTiddlersShowTree;
var out="{{relatedTiddlers{"+toggle+(relcount?sep+this.treecheck:"")+(total?sep+this.listcheck:"")+summary+(showList?list:"")+(showTree?tree:"")+"}}}";
wikify(out,target);
form.done.disabled=false; // enable 'done' button
// add mouseover/mouseout handling to blockquotes (for autosizing)
var blocks=target.getElementsByTagName("blockquote");
for (var b=0; b<blocks.length; b++)
{ blocks[b].onmouseover=this.mouseover; blocks[b].onmouseout=this.mouseout; }
// add side-effect to checkboxes so that display is refreshed when a checkbox state is changed
var checks=target.getElementsByTagName("input");
for (var c=0; c<checks.length; c++) {
if (checks[c].type.toLowerCase()!="checkbox") continue;
checks[c].coreClick=checks[c].onclick; // save standard click handler
checks[c].formID=form.id; // link checkbox with correponding form
checks[c].onclick=function() { this.coreClick.apply(this,arguments); document.getElementById(this.formID).get.click(); }
}
}
}
//}}}
config.renameTags = {
prompts: {
rename: "Rename the tag '%0' to '%1' in %2 tidder%3?",
remove: "Remove the tag '%0' from %1 tidder%2?"
},
removeTag: function(tag,tiddlers) {
for (var i=0;i<tiddlers.length;i++) {
store.setTiddlerTag(tiddlers[i].title,false,tag);
}
},
renameTag: function(oldTag,newTag,tiddlers) {
for (var i=0;i<tiddlers.length;i++) {
store.setTiddlerTag(tiddlers[i].title,false,oldTag); // remove old
store.setTiddlerTag(tiddlers[i].title,true,newTag); // add new
}
},
storeMethods: {
saveTiddler_orig_renameTags: TiddlyWiki.prototype.saveTiddler,
saveTiddler: function(title,newTitle,newBody,modifier,modified,tags,fields) {
if (title != newTitle) {
var tagged = this.getTaggedTiddlers(title);
if (tagged.length > 0) {
// then we are renaming a tag
if (confirm(config.renameTags.prompts.rename.format([title,newTitle,tagged.length,tagged.length>1?"s":""])))
config.renameTags.renameTag(title,newTitle,tagged);
if (!this.tiddlerExists(title) && newBody == "")
// dont create unwanted tiddler
return null;
}
}
return this.saveTiddler_orig_renameTags(title,newTitle,newBody,modifier,modified,tags,fields);
},
removeTiddler_orig_renameTags: TiddlyWiki.prototype.removeTiddler,
removeTiddler: function(title) {
var tagged = this.getTaggedTiddlers(title);
if (tagged.length > 0)
if (confirm(config.renameTags.prompts.remove.format([title,tagged.length,tagged.length>1?"s":""])))
config.renameTags.removeTag(title,tagged);
return this.removeTiddler_orig_renameTags(title);
}
},
init: function() {
merge(TiddlyWiki.prototype,this.storeMethods);
}
}
config.renameTags.init();
----
{{invisibletable{
|<<tiddler Lokaler>>|<<tiddler AV>>|
----
<script label="Reset">
var tag="HU";
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.setTiddlerTag(t.title,false,tag);
store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}
store.resumeNotifications();
</script>
<script label="Reset">
var tag="Syg";
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.setTiddlerTag(t.title,false,tag);
store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}
store.resumeNotifications();
</script>
<script label="Reset">
var tag="Elev";
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.setValue(t.title,"hjem",false)
store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}
store.resumeNotifications();
</script>
[[►|RollYourOwn]]''To put Treeview in you own existing ~TiddlyWiki'' you will need a version of TW that incorporates the jQuery library, __TW version 2.5.0__ . (Existing [[TW Notes|http://twnotes.tiddlyspot.com/]] and [[TWT-Notes|http://twt-notes.tiddlyspot.com/]] menus can be incorporated into your new Treemenu.)
<<<
''To start a new'' ~TiddlyWiki with Treemenu you will need:
# ~TreeviewPluginPlugin from http://treeview.tiddlyspot.com/
# The code in MarkupPostBody
# The tiddler JqueryTreeviewCSS inserted into your ~StyleSheet
# The jQuery cookie plugin [[Cookie plugin]]
# The EmbeddedImages requires AttachFilePluginFormatters
# TaggerPlugin this requires DeprecatedFunctionsPlugin
# InlineJavascriptPlugin
# NewHerePlugin
<<<
{{center{If this seems too hard <html><a href='http://twt-treeview.tiddlyspot.com/download' class='button'>''Download TWT Treeview''</a></html>it is already set up.}}}
''Additional''
<<<
The [[NewHerePlugin]] requires this in ViewTemplate:
|{{{<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'> <span style="padding-right:0em;" macro='tagger'></span ><span macro='newHere label:"add:subtopic" tag:"eureeka"'></span></div>}}}|
PageTemplate requires this:
|{{{<div id='mainMenu' refresh='content' force='true' tiddler='MainMenu'></div>}}}|
<<<
<<wikify [[%0]] fuldenavn@here>>
/***
|Name|SaveAsPlugin|
|Source|http://www.TiddlyTools.com/#SaveAsPlugin|
|Documentation|http://www.TiddlyTools.com/#SaveAsPlugin|
|Version|1.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Save current document to a different path/filename|
!!!!!Documentation
<<<
Syntax: {{{<<saveAs>>}}}
<<saveAs>>
<<<
!!!!!Revisions
<<<
2008.04.12 [1.0.1] automatically add "saveAs" to backstage commands
2008.04.12 [1.0.0] initial release - derived from [[NewDocumentPlugin]]
<<<
!!!!!Code
***/
//{{{
version.extensions.SaveAsPlugin= {major: 1, minor: 0, revision: 1, date: new Date(2008,4,12)};
config.macros.saveAs = {
label: "save as...",
prompt: "Save current document to a different path/file",
filePrompt: "Please select or enter a target path/filename",
defaultFilename: "new.html",
okmsg: "%0 tiddlers written to %1",
failmsg: "An error occurred while creating %0",
handler: function(place,macroName,params)
{ var btn=createTiddlyButton(place,this.label,this.prompt,this.go); },
go: function() {
// make sure we are local
if (window.location.protocol!="file:") {
alert(config.messages.notFileUrlError);
if (store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null,config.messages.saveInstructions);
return;
}
// get current saved file
var currPath=getLocalPath(window.location.href);
var original=loadFile(currPath);
if (!original) {
alert(config.messages.cantSaveError);
if (store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null,config.messages.saveInstructions);
return;
}
// get new target path/filename
var newPath=currPath;
var slashpos=newPath.lastIndexOf("/"); if (slashpos==-1) slashpos=newPath.lastIndexOf("\\");
if (slashpos!=-1) newPath=newPath.substr(0,slashpos+1); // trim filename
var newFile=currPath.substr(newPath.length); // trim path
if (!newFile.length) newFile=config.macros.saveAs.defaultFilename;
var target=config.macros.saveAs.ask(config.macros.saveAs.filePrompt,newPath,newFile);
if (!target) return; // cancelled by user
// if specified file does not include a path, assemble fully qualified path and filename
var slashpos=target.lastIndexOf("/"); if (slashpos==-1) slashpos=target.lastIndexOf("\\");
if (slashpos==-1) target=target+config.macros.saveAs.defaultFilename;
var link="file:///"+target.replace(/\\/g,'/'); // link for message text
// write target
if (saveFile(target,updateOriginal(original)))
var msg=config.macros.saveAs.okmsg.format([store.getTiddlers("title").length,target]);
else
var msg=config.macros.saveAs.failmsg.format([target]);
clearMessage(); displayMessage(msg,link);
},
ask: function(msg,path,file) {
if(window.Components) { // moz
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='html';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
}
catch(e) { alert('error during local file access: '+e.toString()) }
}
else { // IE
try { // XP/Vista only
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
s.FilterIndex=3; // default to HTML files;
s.InitialDir=path;
s.FileName=file;
if (s.showOpen()) var result=s.FileName;
}
catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
}
return result;
}
};
//}}}
//{{{
// automatically add saveAs to backstage
config.tasks.saveAs = {
text: "saveAs",
tooltip: config.macros.saveAs.prompt,
action: function(){ clearMessage(); config.macros.saveAs.go(); }
}
config.backstageTasks.splice(config.backstageTasks.indexOf("save")+1,0,"saveAs");
//}}}
/***
|Name:|SaveCloseTiddlerPlugin|
|Description:|Provides two extra toolbar commands, saveCloseTiddler and cancelCloseTiddler|
|Version:|3.0 ($Rev: 5502 $)|
|Date:|$Date: 2008-06-10 23:31:39 +1000 (Tue, 10 Jun 2008) $|
|Source:|http://mptw.tiddlyspot.com/#SaveCloseTiddlerPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
To use these you must add them to the tool bar in your EditTemplate
***/
//{{{
merge(config.commands,{
saveCloseTiddler: {
text: 'færdig/luk',
tooltip: 'Gem ændringer til denne tiddler og luk den',
handler: function(ev,src,title) {
var closeTitle = title;
var newTitle = story.saveTiddler(title,ev.shiftKey);
if (newTitle)
closeTitle = newTitle;
return config.commands.closeTiddler.handler(ev,src,closeTitle);
}
},
cancelCloseTiddler: {
text: 'fortryd/luk',
tooltip: 'Fortryd ændringer til denne tiddler og luk den',
handler: function(ev,src,title) {
// the same as closeTiddler now actually
return config.commands.closeTiddler.handler(ev,src,title);
}
}
});
//}}}
/%
|Name|ScrollBox|
|Source|http://www.TiddlyTools.com/#ScrollBox|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|transcluded wiki syntax|
|Requires||
|Overrides||
|Description|display the contents of a tiddler in a fixed-height scrolling area|
%//%
Usage: <<tiddler ScrollBox with: TiddlerName height>>
%/@@display:block;height:$2;overflow:auto;<<tiddler $1>>@@@@display:block;text-align:right;^^rul ned for at se mere...^^@@
/***
|Name|SearchOptionsPlugin|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Documentation|http://www.TiddlyTools.com/#SearchOptionsPluginInfo|
|Version|2.9.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.search, TiddlyWiki.prototype.search, config.macros.search.onKeyPress|
|Options|##Configuration|
|Description|extend core search function with additional user-configurable options|
Extend core search function with additional user-configurable options including selecting which data items to search, enabling/disabling incremental key-by-key searches, and generating a ''list of matching tiddler'' instead of immediately displaying all matches. This plugin also adds syntax for rendering 'search links' within tiddler content to embed one-click searches using pre-defined 'hard-coded' search terms.
!!!!!Documentation
>see [[SearchOptionsPluginInfo]]
!!!!!Configuration
<<<
Search in:
<<option chkSearchTitles>> titles <<option chkSearchText>> text <<option chkSearchTags>> tags <<option chkSearchFields>> fields <<option chkSearchShadows>> shadows
<<option chkSearchList>> Show list of matches
<<option chkSearchListTiddler>> Write list to [[SearchResults]] tiddler
<<option chkIncrementalSearch>> Incremental (key-by-key) searching
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by date
<<<
!!!!!Revisions
<<<
2008.08.25 [2.9.2] added animation to #searchResults DIV. Also, DIV is only auto-created if it does not exist ... and when closed, the DIV is simply hidden rather than removed. This allows custom placement of search results report in the PageTemplate definition.
|please see [[SearchOptionsPluginInfo]] for additional revision details|
2005.10.18 [1.0.0] Initial Release
<<<
!!!!!Code
***/
//{{{
version.extensions.searchOptions = {major: 2, minor: 9, revision: 2, date: new Date(2008,8,25)};
if (config.options.chkSearchTitles===undefined) config.options.chkSearchTitles=true;
if (config.options.chkSearchText===undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags===undefined) config.options.chkSearchTags=true;
if (config.options.chkSearchFields===undefined) config.options.chkSearchFields=true;
if (config.options.chkSearchTitlesFirst===undefined) config.options.chkSearchTitlesFirst=true;
if (config.options.chkSearchList===undefined) config.options.chkSearchList=true;
if (config.options.chkSearchListTiddler===undefined) config.options.chkSearchListTiddler=false;
if (config.options.chkSearchByDate===undefined) config.options.chkSearchByDate=false;
if (config.options.chkIncrementalSearch===undefined) config.options.chkIncrementalSearch=true;
if (config.options.chkSearchShadows===undefined) config.options.chkSearchShadows=true;
if (config.macros.search.reportTitle==undefined)
config.macros.search.reportTitle="SearchResults"; // note: not a cookie!
//}}}
//{{{
// searchLink formatter:
// syntax: [search[text to find]] OR [search[text to display|text to find]]
config.formatters.push( {
name: "searchLink",
match: "\\[search\\[",
lookaheadRegExp: /\[search\[(.*?)(?:\|(.*?))?\]\]/mg,
prompt: "search for: '%0'",
handler: function(w)
{
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var label=lookaheadMatch[1];
var text=lookaheadMatch[2]||label;
var prompt=this.prompt.format([text]);
var btn=createTiddlyButton(w.output,label,prompt,
function(){story.search(this.getAttribute("searchText"))},"searchLink");
btn.setAttribute("searchText",text);
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
});
//}}}
//{{{
config.macros.search.searchOptions_onKeyPress = config.macros.search.onKeyPress;
config.macros.search.onKeyPress = function(e)
{
if(!e) var e = window.event;
if (config.options.chkIncrementalSearch || e.keyCode==13 || e.keyCode==10 || e.keyCode==27)
config.macros.search.searchOptions_onKeyPress.apply(this,arguments);
}
//}}}
//{{{
Story.prototype.search = function(text,useCaseSensitive,useRegExp)
{
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack,config.options.chkSearchByDate?"modified":"title","excludeSearch");
if (config.options.chkSearchByDate) matches=matches.reverse(); // most recent changes first
var q = useRegExp ? "/" : "'";
clearMessage();
if (!matches.length) {
if (config.options.chkSearchListTiddler) discardSearchResults();
displayMessage(config.macros.search.failureMsg.format([q+text+q]));
} else {
if (config.options.chkSearchList||config.options.chkSearchListTiddler)
reportSearchResults(text,matches);
else {
var titles = []; for(var t=0; t<matches.length; t++) titles.push(matches[t].title);
this.closeAllTiddlers(); story.displayTiddlers(null,titles);
displayMessage(config.macros.search.successMsg.format([matches.length, q+text+q]));
}
}
highlightHack = null;
}
//}}}
//{{{
TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)
{
var candidates = this.reverseLookup("tags",excludeTag,false,sortField);
// scan for matching titles first...
var results = [];
if (config.options.chkSearchTitles) {
for(var t=0; t<candidates.length; t++)
if(candidates[t].title.search(searchRegExp)!=-1)
results.push(candidates[t]);
if (config.options.chkSearchShadows)
for (var t in config.shadowTiddlers)
if ((t.search(searchRegExp)!=-1) && !store.tiddlerExists(t))
results.push((new Tiddler()).assign(t,config.shadowTiddlers[t]));
}
// then scan for matching text, tags, or field data
for(var t=0; t<candidates.length; t++) {
if (config.options.chkSearchText && candidates[t].text.search(searchRegExp)!=-1)
results.pushUnique(candidates[t]);
if (config.options.chkSearchTags && candidates[t].tags.join(" ").search(searchRegExp)!=-1)
results.pushUnique(candidates[t]);
if (config.options.chkSearchFields && store.forEachField!=undefined) // requires TW2.1 or above
store.forEachField(candidates[t],
function(tid,field,val) {
if (val.search(searchRegExp)!=-1) results.pushUnique(candidates[t]);
},
true); // extended fields only
}
// then check for matching text in shadows
if (config.options.chkSearchShadows)
for (var t in config.shadowTiddlers)
if ((config.shadowTiddlers[t].search(searchRegExp)!=-1) && !store.tiddlerExists(t))
results.pushUnique((new Tiddler()).assign(t,config.shadowTiddlers[t]));
// if not 'titles first', or sorting by modification date, re-sort results to so titles, text, tag and field matches are mixed together
if(!sortField) sortField = "title";
var bySortField=function (a,b) {if(a[sortField] == b[sortField]) return(0); else return (a[sortField] < b[sortField]) ? -1 : +1; }
if (!config.options.chkSearchTitlesFirst || config.options.chkSearchByDate) results.sort(bySortField);
return results;
}
//}}}
//{{{
// SearchResults REPORT GENERATOR
// hijack core <<search>> macro to add "report" and "simple inline" output
config.macros.search.SOP_handler=config.macros.search.handler;
config.macros.search.handler = function(place,macroName,params)
{
// if "report", use SearchOptionsPlugin report generator for inline output
if (params[1]&¶ms[1].substr(0,6)=="report") {
var keyword=params[0];
var options=params[1].split("=")[1]; // split "report=option+option+..."
var heading=params[2]?params[2].unescapeLineBreaks():"";
var matches=store.search(new RegExp(keyword.escapeRegExp(),"img"),"title","excludeSearch");
if (matches.length) wikify(heading+window.formatSearchResults(keyword,matches,options),place);
} else if (params[1]) {
var keyword=params[0];
var heading=params[1]?params[1].unescapeLineBreaks():"";
var seperator=params[2]?params[2].unescapeLineBreaks():", ";
var matches=store.search(new RegExp(keyword.escapeRegExp(),"img"),"title","excludeSearch");
if (matches.length) {
var out=[];
for (var m=0; m<matches.length; m++) out.push("[["+matches[m].title+"]]");
wikify(heading+out.join(seperator),place);
}
} else
config.macros.search.SOP_handler.apply(this,arguments);
};
if (!window.reportSearchResults) window.reportSearchResults=function(text,matches)
{
// create/update the tiddler
var body=window.formatSearchResults(text,matches);
if (config.options.chkSearchListTiddler) {
var title=config.macros.search.reportTitle;
var who=config.options.txtUserName;
var when=new Date();
var tags="excludeLists excludeSearch temporary";
var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
tiddler.set(title,body,who,when,tags);
store.addTiddler(tiddler);
story.closeTiddler(title);
story.displayTiddler(null,title);
store.notify(title,true);
} else {
var sr=document.getElementById("searchResults");
if (!sr) {
sr=createTiddlyElement(null,"div","searchResults","tiddler");
var da=document.getElementById("displayArea");
da.insertBefore(sr,da.firstChild);
}
addClass(sr,"tiddler");
sr.onmouseover = function(e){ addClass(this,"selected"); }
sr.onmouseout = function(e){ removeClass(this,"selected"); }
sr.style.zIndex = "1000";
removeChildren(sr);
if (config.macros.moveablePanel) wikify("<<moveablePanel>>",sr); /* see MoveablePanelPlugin */
var tb=createTiddlyElement(sr,"div",null,"toolbar");
var b=createTiddlyButton(tb, "open all", "open all matching tiddlers", function() {
story.displayTiddlers(null,this.getAttribute("list").readBracketedList());
},"button");
var list=""; for(var t=0;t<matches.length;t++) list+='[['+matches[t].title+']] ';
b.setAttribute("list",list);
var b=createTiddlyButton(tb, "close", "dismiss search results", function() {
var sr=document.getElementById("searchResults");
if(!config.options.chkAnimate) {
sr.style.display="none";
removeChildren(sr);
} else {
var s=new Slider(sr,false,false,"children");
anim.startAnimating(s);
}
}, "button");
createTiddlyText(createTiddlyElement(sr,"div",null,"title"),"Search Results");
wikify(body,createTiddlyElement(sr,"div",null,"viewer"));
if (sr.style.display!="block") {
if(!config.options.chkAnimate)
sr.style.display="block";
else {
var s=new Slider(sr,true,false,"none");
s.callback=function(e,p){e.style.overflow="visible";}
anim.startAnimating(s);
}
}
window.scrollTo(0,ensureVisible(sr));
}
}
if (!window.formatSearchResults) window.formatSearchResults=function(text,matches,opt)
{
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
var body="";
if (!opt) var opt="all";
var parts=opt.split("+");
for (var i=0; i<parts.length; i++) { var p=parts[i].toLowerCase();
if (p=="summary"||p=="all")
body+=window.formatSearchResults_summary(text,matches);
if (p=="list"||p=="all")
body+=window.formatSearchResults_list(text,matches);
if (p=="buttons"||p=="all")
body+=window.formatSearchResults_buttons(text,matches);
if (p=="again"||p=="all")
body+=window.formatSearchResults_again(text,matches);
}
return body;
}
if (!window.formatSearchResults_summary) window.formatSearchResults_summary=function(text,matches)
{
// summary: nn tiddlers found matching '...', options used
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
var body="";
body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\n";
body+="^^//searched in:// ";
body+=(config.options.chkSearchTitles?"''titles'' ":"");
body+=(config.options.chkSearchText?"''text'' ":"");
body+=(config.options.chkSearchTags?"''tags'' ":"");
body+=(config.options.chkSearchFields?"''fields'' ":"");
body+=(config.options.chkSearchShadows?"''shadows'' ":"");
if (config.options.chkCaseSensitiveSearch||config.options.chkRegExpSearch) {
body+=" //with options:// ";
body+=(config.options.chkCaseSensitiveSearch?"''case sensitive'' ":"");
body+=(config.options.chkRegExpSearch?"''text patterns'' ":"");
}
body+="^^\n";
return body;
}
if (!window.formatSearchResults_list) window.formatSearchResults_list=function(text,matches)
{
// bullet list of links to matching tiddlers
var body="";
for(var t=0;t<matches.length;t++) {
var date=config.options.chkSearchByDate?(matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" "):"";
body+="* "+date+"[["+matches[t].title+"]]\n";
}
return body;
}
if (!window.formatSearchResults_buttons) window.formatSearchResults_buttons=function(text,matches)
{
// embed buttons only if writing SearchResults to tiddler
if (!config.options.chkSearchListTiddler) return "";
// open all matches button
var body="";
var title=config.macros.search.reportTitle;
body+="@@diplay:block;<html><input type=\"button\" href=\"javascript:;\" ";
body+="onclick=\"story.displayTiddlers(null,["
for(var t=0;t<matches.length;t++)
body+="'"+matches[t].title.replace(/\'/mg,"\\'")+"'"+((t<matches.length-1)?", ":"");
body+="],1);\" accesskey=\"O\" value=\"open all matching tiddlers\"></html> ";
// discard search results button
body+="<html><input type=\"button\" href=\"javascript:;\" ";
body+="onclick=\"discardSearchResults()\" value=\"discard "+title+"\"></html>";
body+="@@\n";
return body;
}
if (!window.formatSearchResults_again) window.formatSearchResults_again=function(text,matches)
{
var title=config.macros.search.reportTitle
var body="";
// search again
body+="!!!Search again:\n";
body+="<<search \""+text+"\">>\n";
body+="<<option chkSearchTitles>>titles ";
body+="<<option chkSearchText>>text ";
body+="<<option chkSearchTags>>tags";
body+="<<option chkSearchFields>>fields";
body+="<<option chkSearchShadows>>shadows";
body+="<br>";
body+="<<option chkCaseSensitiveSearch>>case-sensitive ";
body+="<<option chkRegExpSearch>>text patterns";
body+="<<option chkSearchByDate>>sort by date";
body+="<br>";
return body;
}
if (!window.discardSearchResults) window.discardSearchResults=function()
{
// remove the tiddler
story.closeTiddler(config.macros.search.reportTitle);
store.deleteTiddler(config.macros.search.reportTitle);
store.notify(config.macros.search.reportTitle,true);
}
//}}}
<<forEachTiddler
where 'tiddler != context.inTiddler &&
tiddler.tags.contains(context.inTiddler.title)'
sortBy 'GroupTitle = tiddler.data("notetopic")
+"###"+tiddler.data("booktitle")'
script 'function getGroupTitle(tiddler, context) {
if ( (context.lastGroup != "no subtopics") && (!context.lastGroup
|| context.lastGroup != tiddler.data("notetopic")))
{
context.lastGroup = tiddler.data("notetopic");
if (!context.lastGroup || context.lastGroup == "")
context.lastGroup = "no subtopics";
return "!! "+context.lastGroup+"\n";
} else return "";}'
write
'getGroupTitle(tiddler, context)+"** [["+tiddler.title+"]]\n"'
>>
<<snapshot print label:Udskrift prompt:Udskriv id:viewer>><<fontSize>>
/***
|Name|SetUserNamePlugin|
|Source|http://www.TiddlyTools.com/#SetUserNamePlugin|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|prompt for TiddlyWiki username|
!!!!!Usage
<<<
{{{
<<setUserName force>>
}}}
This macro prompts for a new username if the default username ("YourName") is currently set. Use optional 'force' keyword to trigger a prompt even if username has already been set.
If you are using the default (shadow) EditTemplate definition, it will be updated to invoke this macro, via the following template syntax:
{{{
<span macro='setUserName'></span>
}}}
so that whenever a user attempts to edit/create a tiddler AND have not yet entered a username, they will be automatically prompted to enter a new username. If you are using a customized EditTemplate, you will need to edit it yourself to add the above.
<<<
!!!!!Revisions
<<<
2006.12.01 [1.0.0] initial release - converted from SetUserName inline script
<<<
!!!!!Code
***/
//{{{
version.extensions.SetUserNamePlugin= {major: 1, minor: 0, revision: 0, date: new Date(2006,12,1)};
config.macros.setUserName = {
msg: "Skriv venligst dit brugernavn",
handler: function(place,macroName,params) {
// only prompt when needed or forced
var force=params[0]&¶ms[0].toLowerCase()=="force";
if (!force && (readOnly || config.options.txtUserName!="DitNavn")) return;
var opt="txtUserName";
var who=prompt(this.msg,config.options[opt]);
if (!who||!who.trim().length) return; // cancelled by user
config.options[opt]=who;
saveOptionCookie(opt);
config.macros.option.propagateOption(opt,"value",config.options[opt],"input");
}
}
// add trigger to default shadow EditTemplate (custom templates: add this by hand)
config.shadowTiddlers.EditTemplate+="<span macro='setUserName'></span>";
//}}}
@@color:#800;Tiddlers tagged with TreeviewPackage (plugins, macros and tweaks)@@
<<tiddler ToggleRightSidebar with: "Sidebar »">>
{{twocolumns{
<script>
// get all tiddlers tagged with "TreeviewPackage"
var tids=store.getTaggedTiddlers("TreeviewPackage");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("TreeviewPackage")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
}}}
/%
|Name|ShowUserName|
|Source|http://www.TiddlyTools.com/#ShowUserName|
|Version|0.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|Displays current username, Click for prompt box to change name|
%//%
usage: <<tiddler ShowUserName>>
%/<script label="username">
var opt="txtUserName";
var who=prompt("Skriv venligst dine initialer",config.options[opt]);
if (!who||!who.trim().length) return false;
config.options[opt]=who;
saveOptionCookie(opt);
var tid=story.findContainingTiddler(place);
if (tid) story.refreshTiddler(tid.getAttribute("tiddler"),null,true); // sync containing tiddler
config.macros.option.propagateOption(opt,"value",config.options[opt],"input");
return false;
</script><script>
place.lastChild.title="Klik for at skrive dit brugernavn (initialer)";
place.lastChild.innerHTML=config.options.txtUserName;
</script>
@@padding-left:0.7em;font-size:9px;color:#aaa;TW Ver:<<version>>@@
@@padding-left:0.7em;@@{{button{gå til}}}
<<gotoTiddler>>@@padding-left:0.2em;+++[skift tema]<<switchTheme BlueTheme>><br><<switchTheme GreenTheme>><br><<switchTheme TWHelpTheme>>
===<<slider chkSliderFlereNye FlereNye "flere nye »" "Opret flere typer tiddlere efter skabeloner">><<saveChanges>><<doBackup>>+++[kontrol »]
<<attach>><br><<permaview>><br><<tiddler OnlineRedigering>>===<<slider chkSliderOptionsPanel OptionsPanel "muligheder »" "Lav om på TiddlyWikis avancerede muligheder">>
@@padding:0.3em;@@<<slider chkSliderSideBarTabs SideBarTabsSlider 'indeks »' 'tiddlere, tidslinie, alle, tags'>>
<<tabs txtMainTab "Tidslinie" "Tidslinie" TabTimeline "Alle" "Alle tiddlere" TabAll "Tags" "Alle tags" TabTags "Flere" "Flere lister" TabMore>>
[img(5%+,+)[Himmerlands Ungdomsskole på nettet|http://xn--mns-ula.dk/Billeder/images/HULOGOLILLE.png][http://h-u.dk]]
Kræver password for at kunne læses:
<<getTiddlerPassword "Skriv det password du har modtaget pr mail">>
<html><div lang="x-western" class="moz-text-html">Vi har haft en introduktion til IT-udfordringer på efterskoler og vore muligheder mht. udbyggelse af et netværk, der understøtter det - v. Allan fredslund.<br /> Vi har haft et møde med bestyrelsen(tremandsudvalget) og Allan Fredslund.<br /> <br /> 1. møde: Deltagere: Allan, Lone,Dorthe, Dan, Jakob og MM<br /> Kort resume:<br /> Allan gav os en god indsigt i mulighederne ang. sektornet,(Uni-C) netværksbaserede social-communities, Edb-Brugsens kommende samarbejde med SkolePlan - forventet udvikling databasebaseret SkolePlansprogram med webinterfaces i nær fremtid - og forklarede os det tekniske i opbygningen af et velfungerende netværk. Allan forklarede os hvad det er eleverne forventer i forhold til tilgængelighed og services.<br /> <br /> 2. møde: Deltagere: Allan, Lone og MM<br /> Det samme som første møde - borset fra at Allan blev en kende mere teknisk (Gik i detaljer omkring det tekniske udstyr - og prisoverslag)<br /> Et samlet budget - på nødvendig fornyelse - nye servermoduler (Opdeling i "pinde": Administration, Elever, "rent internet" etc), et fuldt udbygget trådløst net med flere "kanaler" - ca 40 routere med styret roaming - kabling af det hele - etc... ca.: 800.000,-<br /> Det skal siges at det hele er baseret på at vi har allerede har fået lov til at købe en fibernetforbindelse af TDC for 16.000(incl indsættelse i "huset"). Internetforbindelsen giver 50/50 mb og al kabling på skolen skal skiftes ud - og udbygges, før det kan tages i brug.<br /> <br /> Udsigterne for hvornår vi kan have et trådløst netværk, der dækker hele skolen, ligger omkring oktober -09.<br /> SkolePlans webmoduler (i første omgang for lærere og administration) kommer nok ikke til at ramme os før først i 2010 (SkolePlan skal have lavet sig om til et databasebaseret (MySql) system først).<br /> <br /> Indtil da synes jeg alligevel vi skal "øve os" i at bruge andre og mere digitale (nemmere tilgængelige) måder at kommunikere på.<br /> Mail er ikke godt nok til meget af det vi laver - udvalgsarbejder, bilag, skemaer, lister etc etc.<br /> Vedhæftninger til mails er at betragte som multikopierede originaler - hvis man i stedet linker til ET fælles dokument - enten på internettet eller på skolens netværk - så vil man kunne udvikle en kultur, hvor man kan forvente at se sidste nyt - et og samme sted.<br /> Linket kunne være via skolens hjemmeside - MEN! hjemmesiden kan det ikke selv. <br /> Hjemmesiden er en web.1.0 applikation og er lavet til at der er 1 person som administrerer indholdet.<br /> I dag bruges web.2.0 applikationer til at dele indhold - eks. FaceBook, WikiPedia - etc etc...<br /> <br /> Man behøver ikke engang en (egen) server for at dele filer/dokumenter fra et og samme sted (evt. ens lokale dokumentmappe).<br /> DropBox - løser det ganske enkelt ved at man synkroniserer de filer man vil dele offentligt (dem man lægger i "public-mappen") med en internettjeneste - derefter kan man højreklikke på en fil og vælge "copy public link". Linket sætter man ind i en mail - og sender til dem som skal se/have filen.<br /> Laver du ændringer til dokumentet vil det automatisk blive opdateret og linket peger altid på det sidste nye...<br /> Man skal blot gøre folk opmærksom på at de skal se om der er sket ændringer selv....<br /> <br /> Jeg er lidt utålmodig - og kan ikke falde helt til ro over evt at skulle vente til 2010 - for at få et sted at kunne læse mit skema, følge med i sygemeldinger, lave weekendlister etc etc - Derfor arbejder jeg ufortrødent videre med mine ElevListeWikis.<br /> Mit mål er at lave et dokument, der er så nemt at navigere i og bruge (helst også HURTIGT!) at alle kan anvende det uden videre.<br /> <br /> TiddlyWiki er en genial web.2.0 applikation, som kan bruges til alt muligt forskelligt - (det har jeg også forsøgt ;-))<br /> <br /> Indtil videre har jeg lavet 3 ElevListe versioner<br /> 1) Den mobile elevliste (<a href="http://måns.dk/weekend">0809</a>)(<a href="http://måns.dk/0910">0910</a>) <br /> 2) Den Store elevliste m. indbygget projekt/mål og opgave management for alle fag (<a href="http://gdsskole.tiddlyspot.com/">0809</a>)<br /> 3) Sidste nye: EfterSkoleLister (ESL) - den mest overskuelige til dato og virker også i InternetExplorer (<a href="../../../">0809</a>)(<a href="http://el0910.tiddlyspot.com/">0910 (ikke helt færdig endnu</a>))<br /> <br /> Hver af de ovenstående applikationer, er "bundtede" anvendelsesmuligheder samlet i een html-fil. NB: Der er både faglister, weekendlister, sygelister, hjemmelister - links til - billeder af alle elever og lærere<br /> Det betyder at hvis (især den sidste side nr. 3) virker lidt langsom - så kan hastigheden altså skrues kraftigt op ved at fjerne nogle af alle de ekstra muligheder jeg har indbygget...<br /> Vil man have et dokument/program som KUN er til sygemelding eller KUN til weekendlister- så bliver dokumenterne meget mindre og meget hurtigere - <br /> <br /> Det ville være fint med noget feedback på anvendelsesmuligheder for ElivListerne - så kunne jeg lave dem nøjagtig som vi vil have dem... (Hvis vi vil have dem)<br /> <br /> Mvh Måns</div></html>
/***
!!!SimonsNiceTable /%==================================================%/
***/
.title { color:[[ColorPalette::SecondaryDark]]; }
.niceTable td, .niceTable th, .niceTable tr {
border-style:none;
}
.niceTable td, .niceTable th {
vertical-align:top;
padding:0.5em;
}
.niceTable table {
border:1px #aaa solid;
background-color:#f8f8f8;
}
.niceTable td img {
border:1px solid #555;
text-align:center;
margin:0 1em 1em 0;
}
.niceTable th {
background-color:#f8f8f8;
color:#555;
font-size:90%;
font-weight:bold;
text-align:right;
}
/***
| Name:|SiteMapMacro|
| Author:|Simon Baird|
| Location:|http://simonbaird.com/mptw/#SiteMapMacro|
| Version:|1.0.3, 15-Mar-06|
!!Examples
See SiteMap and SliderSiteMap for example usage.
!!Parameters
* Name of tiddler to start at
* Max depth (a number)
* Format (eg, nested, see formats below)
* Don't show root flag (anything other than null turns it on)
* Tags - a string containing a bracketed list of tags that we are interested in
!!History
* 1.0.3 (15-Mar-06)
** added tag filtering
* 1.0.2 (15-Mar-06)
** Added json format and dontshowroot option
* 1.0.1 (9-Mar-06)
** Added selectable formats and fixed nested slider format
* 1.0.0 (8-Mar-06)
** first release
***/
//{{{
version.extensions.SiteMapMacro = {
major: 1,
minor: 0,
revision: 3,
date: new Date(2006,3,15),
source: "http://simonbaird.com/mptw/#SiteMapMacro"
};
config.macros.siteMap = {
formats: {
bullets: {
formatString: "%0[[%1]]\n%2",
indentString: "*"
},
// put this in your StyleSheet to make it look good.
// .sliderPanel { margin-left: 2em; }
sliders: {
formatString: "[[%1]]+++\n%2===\n\n",
formatStringLeaf: "[[%1]]\n"
},
openSliders: {
formatString: "[[%1]]++++\n%2===\n\n",
formatStringLeaf: "[[%1]]\n"
},
popups: {
formatString: "[[%1]]+++^\n%2===\n\n",
formatStringLeaf: "[[%1]]\n"
},
// these don't work too well
openPopups: {
formatString: "[[%1]]++++^\n%2===\n\n",
formatStringLeaf: "[[%1]]\n"
},
// this is a little nuts but it works
json: {
formatString: '\n%0{"%1":[%2\n%0]}',
formatStringLeaf: '\n%0"%1"',
indentString: " ",
separatorString: ","
}
},
defaultFormat: "bullets",
treeTraverse: function(title,depth,maxdepth,format,dontshowroot,tags,excludetags) {
var tiddler = store.getTiddler(title);
var tagging = store.getTaggedTiddlers(title);
if (dontshowroot)
depth = 0;
var indent = "";
if (this.formats[format].indentString)
for (var j=0;j<depth;j++)
indent += this.formats[format].indentString;
var childOutput = "";
if (!maxdepth || depth < parseInt(maxdepth))
for (var i=0;i<tagging.length;i++)
if (tagging[i].title != title) {
if (this.formats[format].separatorString && i != 0)
childOutput += this.formats[format].separatorString;
childOutput += this.treeTraverse(tagging[i].title,depth+1,maxdepth,format,null,tags,excludetags);
}
if (childOutput == "" && (
(tags && tags != "" && !tiddler.tags.containsAll(tags.readBracketedList())) ||
(excludetags && excludetags != "" && tiddler.tags.containsAny(excludetags.readBracketedList()))
)
) {
// so prune it cos it doesn't have the right tags and neither do any of it's children
return "";
}
if (dontshowroot)
return childOutput;
if (this.formats[format].formatStringLeaf && childOutput == "") {
// required for nestedSliders
return this.formats[format].formatStringLeaf.format([indent,title,childOutput]);
}
return this.formats[format].formatString.format([indent,title,childOutput]);
},
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
wikify(this.treeTraverse(
params[0] && params[0] != '.' ? params[0] : tiddler.title, 1,
params[1] && params[1] != '.' ? params[1] : null, // maxdepth
params[2] && params[2] != '.' ? params[2] : this.defaultFormat, // format
params[3] && params[3] != '.' ? params[3] : null, // dontshowroot
params[4] && params[4] != '.' ? params[4] : null, // tags
params[5] && params[5] != '.' ? params[5] : null // excludetags
),place);
}
}
//}}}
@@color:#ffc;font-weight:normal;<<tiddler DigitalClock>>@@
@@font-size:1.8em;color:#ffc;font-weight:normal;~EfterSkoleLister@@
<html><div align="center"><iframe src="http://xn--mns-ula.dk/download/totalskema1.pdf" frameborder="0" width="100%" height="600"></iframe></div></html>
<<forEachTiddler
where 'tiddler != context.inTiddler &&
tiddler.tags.contains(context.inTiddler.title)'
sortBy 'GroupTitle = tiddler.data("notetopic")
+"###"+tiddler.data("booktitle")'
script 'function getGroupTitle(tiddler, context) {
if ( (context.lastGroup != "no subtopics") && (!context.lastGroup
|| context.lastGroup != tiddler.data("notetopic")))
{
context.lastGroup = tiddler.data("notetopic");
if (!context.lastGroup || context.lastGroup == "")
context.lastGroup = "no subtopics";
return "!! "+context.lastGroup+"\n";
} else return "";}'
write
'getGroupTitle(tiddler, context)+"** [["+tiddler.title+"]]\n"'
>>
<<snapshot print label:Udskrift prompt:Udskriv id:viewer>><<fontSize>>
<<slideShow tag:slide auto:6 toc:titles header:" Præsentation " footer:"Stop: Escape - eller X her »" cycle clock:'+' >>
/***
|''Name:''|SlideShowPlugin|
|''Description:''|Creates a slide show from a group of tiddlers|
|''Author:''|Paulo Soares|
|''Version:''|2.0.3|
|''Date:''|2009-03-29|
|''Source:''|http://www.math.ist.utl.pt/~psoares/addons.html|
|''Documentation:''|[[SlideShowPlugin Documentation|SlideShowPluginDoc]]|
|''License:''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.5.0|
***/
//{{{
if(!version.extensions.SlideShowPlugin) { //# ensure that the plugin is only installed once
version.extensions.SlideShowPlugin = {installed: true};
(function($) {
config.macros.slideShow = {};
config.macros.slideShow.text = {
label: "slide show", tooltip: "Start slide show",
quit: {label: "x", tooltip: "Quit the slide show"},
firstSlide: {label: "<<", tooltip: "Go to first slide"},
previous: {label: "<", tooltip: "Go back"},
next: {label: ">", tooltip: "Advance"},
lastSlide: {label: ">>", tooltip: "Go to last slide"},
goto: {label: "Go to slide:"},
resetClock: {tooltip: "Reset the clock"},
clockFormat: "0hh:0mm:0ss",
overlay: "overlay"
};
config.macros.slideShow.handler = function(place,macroName,params,wikifier,paramString,tiddler){
var args = paramString.parseParams(null,null,true);
this.label = getParam(args,"label",this.text.label);
this.tooltip = getParam(args,"tooltip",this.text.tooltip);
var onclick = function(){config.macros.slideShow.onClick(tiddler,paramString);};
createTiddlyButton(place,this.label,this.tooltip,onclick);
}
config.macros.slideShow.onClick = function(tiddler,paramString) {
var cm = config.macros.slideShow;
var args = paramString.parseParams(null,null,true);
var argsArray = paramString.readMacroParams();
this.clicks = ($.inArray('noClicks',argsArray) < 0);
this.keyboard = ($.inArray('noKeyboard',argsArray) < 0);
this.showAll = ($.inArray('showAll',argsArray) > -1);
this.cycle = ($.inArray('cycle',argsArray) > -1);
this.overlays = ($.inArray('noOverlays',argsArray) < 0);
this.theme = getParam(args,"theme");
this.tag = getParam(args,"tag");
this.toc = getParam(args,"toc","headers");
this.sort = getParam(args,"sort");
this.auto = getParam(args,"auto",0);
this.header = getParam(args,"header",tiddler.title);
this.footer = getParam(args,"footer","");
this.clock = getParam(args,"clock");
this.blocked = 0;
if(this.clock){
var startTime = new Date(0);
this.clockCorrection=startTime.getTimezoneOffset()*60000;
startTime = new Date();
this.clockMultiplier = 1;
this.clockInterval = 0;
var clockType= parseFloat(this.clock);
if(clockType < 0) {
this.clockMultiplier = -1;
this.clockInterval = -clockType*60000;
} else if(clockType == 0){
this.clockCorrection = 0;
startTime = new Date(0);
}
this.clockStartTime=startTime.getTime();
}
this.slides = [];
this.openTiddlers = [];
$("#tiddlerDisplay > *").each(function(){cm.openTiddlers.push($(this).attr('tiddler'))});
var count = 0;
this.slideTOC=[];
if(this.tag){
var content = store.getTaggedTiddlers(this.tag,this.sort);
$.each(content, function(){
count++;
cm.buildTOC(count,this.title);
cm.slides.push(this.title);
});
} else {
var content = tiddler.text.readBracketedList();
$.each(content, function(){
if(store.tiddlerExists(this)){
count++;
cm.buildTOC(count,this);
cm.slides.push(this);
}
});
}
this.nSlides = this.slides.length;
if(this.nSlides==0) return;
clearMessage();
this.toggleSlideStyles();
if(!this.showAll){
//Attach the key and mouse listeners
if(this.keyboard && !$("#tiddlerDisplay").hasClass("noKeyboard")) $(document).keyup(cm.keys);
if(this.clicks){
$("#displayArea").mouseup(cm.clicker);
document.oncontextmenu = function(){return false;}
}
if(this.clock) this.slideClock=setInterval(this.setClock, 1000);
if(this.auto>0){
this.autoAdvance=setInterval(cm.next, this.auto*1000);
}
this.showSlide(1);
} else {
story.closeAllTiddlers();
story.displayTiddlers(null,this.slides);
$(".tiddler").attr("ondblclick",null);
$(document).keyup(cm.endSlideShow);
}
return false;
}
config.macros.slideShow.buildNavigator = function() {
//Create the navigation bar
var i, slidefooter = $("#controlBar")[0];
if(!slidefooter) return;
$(slidefooter).addClass("slideFooterOff noClicks");
var navigator = createTiddlyElement(slidefooter,"SPAN","navigator");
//Make it so that when the footer is hovered over the class will change to make it visible
$(slidefooter).bind("mouseenter mouseleave", function(e){$(this).toggleClass("slideFooterOff");});
//Create the control buttons for the navigation
createTiddlyButton(navigator,this.text.firstSlide.label,this.text.firstSlide.tooltip,this.firstSlide,"button");
createTiddlyButton(navigator,this.text.previous.label,this.text.previous.tooltip,this.previous,"button");
createTiddlyButton(navigator,this.text.quit.label,this.text.quit.tooltip,this.endSlideShow,"button");
createTiddlyButton(navigator,this.text.next.label,this.text.next.tooltip,this.next,"button");
createTiddlyButton(navigator,this.text.lastSlide.label,this.text.lastSlide.tooltip,this.lastSlide,"button");
if(this.clock){
if(this.clock == 0){
createTiddlyElement(navigator,"SPAN","slideClock");
} else {
createTiddlyButton(navigator," ",this.text.resetClock.tooltip,this.resetClock,"button","slideClock");
}
this.setClock();
}
var index = createTiddlyElement(slidefooter,"SPAN","slideCounter");
index.onclick = this.toggleTOC;
var toc = createTiddlyElement(slidefooter,"SPAN","toc");
var tocLine;
for(i=0; i<this.slideTOC.length; i++){
$(toc).append(this.slideTOC[i][2]);
tocLine = toc.lastChild;
$(tocLine).addClass("tocLevel"+this.slideTOC[i][1]).css("cursor", "pointer").hover(function () {
$(this).addClass("highlight");}, function () {
$(this).removeClass("highlight");});
tocLine.setAttribute("slide",this.slideTOC[i][0]);
$(tocLine).click(config.macros.slideShow.showSlideFromTOC);
}
//Input box to jump to specific slide
var tocItem = createTiddlyElement(toc,"DIV","jumpItem",null,this.text.goto.label);
var tocJumpInput = createTiddlyElement(tocItem,"INPUT","jumpInput");
tocJumpInput.type="text";
$(tocJumpInput).keyup(config.macros.slideShow.jumpToSlide);
}
config.macros.slideShow.buildTOC = function(count,title) {
switch(this.toc){
case "headers":
var frag = wikifyStatic(store.getTiddlerText(title));
var text = frag.replace(/<div class="comment">.*<\/div>/mg,"");
var matches = text.match(/<h[123456]>.*?<\/h[123456]>/mgi);
if(matches){
for (var j=0; j<matches.length; j++){
this.slideTOC.push([count,matches[j].charAt(2),matches[j].replace(/H[123456]/gi,"div")]);
}
}
break;
case "titles":
this.slideTOC.push([count,1,"<div>"+title+"</div>"]);
}
}
config.macros.slideShow.showSlideFromTOC = function(e) {
var cm = config.macros.slideShow;
var slide = parseInt(e.target.getAttribute('slide'));
$("#toc").hide();
cm.showSlide(slide);
return false;
}
config.macros.slideShow.toggleTOC = function(){
$("#toc").toggle();
$("#jumpInput").focus().val('');
}
config.macros.slideShow.isInteger = function(s){
for (var i = 0; i < s.length; i++){
// Check that current character is number
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers
return true;
}
config.macros.slideShow.jumpToSlide = function(e){
var cm = config.macros.slideShow;
if(e.which==13){
var input= $("#jumpInput").val();
if(cm.isInteger(input) && input>0 && input<=cm.nSlides){
$("#toc").hide();
cm.showSlide(input);
} else {$("#jumpInput").val('');}
}
return false;
}
config.macros.slideShow.toggleSlideStyles = function(){
var contentWrapper = $('#contentWrapper');
if(contentWrapper.hasClass("slideShowMode")){
refreshPageTemplate();
removeStyleSheet("SlideShowStyleSheet");
if(this.theme) removeStyleSheet(this.theme);
} else {
$("#displayArea").prepend('<div id="slideBlanker" style="display:none"></div><div id="slideHeader">'+this.header+'</div><div id="slideFooter">'+this.footer+'</div><div id="controlBar"></div>');
setStylesheet(store.getRecursiveTiddlerText("SlideShowStyleSheet"),"SlideShowStyleSheet");
if(this.theme && store.tiddlerExists(this.theme)){setStylesheet(store.getRecursiveTiddlerText(this.theme),this.theme);}
this.buildNavigator();
}
contentWrapper.toggleClass("slideShowMode");
}
config.macros.slideShow.showSlide = function(n){
if(this.cycle) {
if(n>this.nSlides) {
n = 1;
} else if(n<1) {
n = this.nSlides;
}
} else {
if(n>this.nSlides || n<1) return;
}
story.closeAllTiddlers();
story.displayTiddler(null,this.slides[n-1]);
$(".tiddler").attr("ondblclick",null);
this.curSlide = n;
$("#slideCounter").text(this.curSlide+"/"+this.nSlides);
if(this.overlays){
var contents = $(".viewer *");
this.numOverlays = 1;
while(1){
if(contents.hasClass(this.text.overlay+this.numOverlays)){
this.numOverlays++;
} else {break;}
}
this.numOverlays--;
this.showOverlay(0);
}
}
config.macros.slideShow.showOverlay = function(n){
var i, set, cm = config.macros.slideShow;
if(!cm.overlays || cm.numOverlays == 0 || n<0 || n>cm.numOverlays){return;}
for(i=1; i<n; i++){
set = $(".viewer "+"."+cm.text.overlay+i);
set.removeClass("currentOverlay nextOverlay");
set.addClass("previousOverlay");
}
set = $(".viewer "+"."+cm.text.overlay+n);
set.removeClass("previousOverlay nextOverlay");
set.addClass("currentOverlay");
for(i=n; i<config.macros.slideShow.numOverlays; i++){
set = $(".viewer "+"."+cm.text.overlay+(i+1));
set.removeClass("previousOverlay currentOverlay");
set.addClass("nextOverlay");
}
cm.curOverlay = n;
}
config.macros.slideShow.firstSlide = function(){
config.macros.slideShow.showSlide(1);
}
config.macros.slideShow.lastSlide = function(){
config.macros.slideShow.showSlide(config.macros.slideShow.nSlides);
}
config.macros.slideShow.next = function(){
var cm = config.macros.slideShow;
if(!cm.overlays || cm.numOverlays == 0 || cm.curOverlay == cm.numOverlays) {
cm.showSlide(cm.curSlide+1);
} else {
cm.showOverlay(cm.curOverlay+1);
}
}
config.macros.slideShow.previous = function(){
var cm = config.macros.slideShow;
if(!cm.overlays || cm.numOverlays == 0 || cm.curOverlay == 0) {
cm.showSlide(cm.curSlide-1);
cm.showOverlay(cm.numOverlays);
} else {
cm.showOverlay(cm.curOverlay-1);
}
}
config.macros.slideShow.endSlideShow=function(){
var cm = config.macros.slideShow;
if(cm.autoAdvance) {clearInterval(cm.autoAdvance);}
if(this.clock) clearInterval(this.slideClock);
story.closeAllTiddlers();
cm.toggleSlideStyles();
story.displayTiddlers(null,cm.openTiddlers);
$(document).unbind();
document.oncontextmenu = function(){};
}
// 'keys' code adapted from S5 which in turn was adapted from MozPoint (http://mozpoint.mozdev.org/)
config.macros.slideShow.keys = function(key) {
var cm = config.macros.slideShow;
switch(key.which) {
case 32: // spacebar
if(cm.auto>0 && cm.blocked==0){
if(cm.autoAdvance){
clearInterval(cm.autoAdvance);
cm.autoAdvance = null;
} else {
cm.autoAdvance=setInterval(cm.next, cm.auto*1000);
}
} else {
if(cm.blocked==0) cm.next();
}
break;
case 34: // page down
if(cm.blocked==0) cm.showSlide(cm.curSlide+1);
break;
case 39: // rightkey
if(cm.blocked==0) cm.next();
break;
case 40: // downkey
if(cm.blocked==0) cm.showOverlay(cm.numOverlays);
break;
case 33: // page up
if(cm.blocked==0) cm.showSlide(cm.curSlide-1);
break;
case 37: // leftkey
if(cm.blocked==0) cm.previous();
break;
case 38: // upkey
if(cm.blocked==0) cm.showOverlay(0);
break;
case 36: // home
if(cm.blocked==0) cm.firstSlide();
break;
case 35: // end
if(cm.blocked==0) cm.lastSlide();
break;
case 27: // escape
cm.endSlideShow();
break;
case 66: // B
$("#slideBlanker").toggle();
cm.blocked = (cm.blocked +1)%2;
break;
}
return false;
}
config.macros.slideShow.clicker = function(e) {
var cm = config.macros.slideShow;
if(cm.blocked==1 || $(e.target).attr('href') || $(e.target).parents().andSelf().hasClass('noClicks')){
return true;
}
if((!e.which && e.button == 1) || e.which == 1) {
cm.next();
}
if((!e.which && e.button == 2) || e.which == 3) {
cm.previous();
}
return false;
}
config.macros.slideShow.setClock = function(){
var cm = config.macros.slideShow;
var actualTime = new Date();
var newTime = actualTime.getTime() - cm.clockStartTime;
newTime = cm.clockMultiplier*newTime+cm.clockInterval+cm.clockCorrection;
actualTime.setTime(newTime);
newTime = actualTime.formatString(cm.text.clockFormat);
$("#slideClock").text(newTime);
}
config.macros.slideShow.resetClock = function(){
var cm = config.macros.slideShow;
if(cm.clock == 0) return;
var time = new Date(0);
if(cm.clockStartTime>time){
var startTime = new Date();
cm.clockStartTime=startTime.getTime();
}
}
config.shadowTiddlers.SlideShowStyleSheet="/*{{{*/\n.header, #mainMenu, #sidebar, #backstageShow, .toolbar, .title, .subtitle, .tagging, .tagged, .tagClear, .comment{\n display:none !important\n}\n\n#slideBlanker{\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 90; \n background-color: #000;\n opacity: 0.9;\n filter: alpha(opacity=90)\n}\n\n.nextOverlay{\n visibility: hidden\n}\n\n.previousOverlay,.currentOverlay{\n visibility: visible\n}\n\n#displayArea{\n font-size: 250%;\n margin: 0 !important;\n padding: 0\n}\n\n#controlBar{\n position: fixed;\n bottom: 2px;\n right: 2px;\n width: 100%;\n text-align: right\n}\n\n#controlBar .button{\n margin: 0 0.25em;\n padding: 0 0.25em\n}\n\n#slideHeader{\n font-size: 200%;\n font-weight: bold\n}\n\n#slideFooter{\n position: fixed;\n bottom: 2px\n}\n\n.slideFooterOff #navigator{\n visibility: hidden\n}\n\n#slideClock{\n margin: 0 5px 0 5px\n}\n\n#slideCounter{\n cursor: pointer;\n color: #aaa\n}\n\n#toc{\n display: none;\n position: absolute;\n font-size: .75em;\n bottom: 2em;\n right: 0;\n background: #fff;\n border: 1px solid #000;\n text-align: left\n}\n\n#jumpItem{\n padding-left:0.25em\n}\n\n#jumpInput{\n margin-left: 0.25em;\n width: 3em\n}\n\n.tocLevel1{\n font-size: .8em\n}\n\n.tocLevel2{\n margin-left: 1em;\n font-size: .75em\n}\n\n.tocLevel3{\n margin-left: 2em;\n font-size: .7em\n}\n\n.tocLevel4{\n margin-left: 3em;\n font-size: .65em\n}\n\n.tocLevel5{\n margin-left: 4em;\n font-size: .6em\n}\n\n.tocLevel6{\n margin-left: 5em;\n font-size: .55em\n}\n/*}}}*/";
config.shadowTiddlers.SlideShowPluginDoc="The documentation is available [[here|http://www.math.ist.utl.pt/~psoares/addons.html#SlideShowPluginDoc]].";
})(jQuery)
}
//}}}
!Description
This plugin turns a set of tiddlers into a slide show. A single macro provides a flexible way to present a set of tiddlers, including:
#a full screen presentation that hides the TiddlyWiki structure (header, sidebar, main menu);
#a way to navigate through a set of tiddlers keeping the TiddlyWiki structure (similar to the [[NavigationMacro|http://tw.lewcid.org/#NavigationMacro]] by Saq Imtiaz);
#a display of all the selected tiddlers ready to be printed.
!Main features
Most features that are usually found in presentation software are available.
*Build a slide show from a list of tiddlers' titles or selecting a specific tag with optional sort
*Fully customizable presentations (CSS knowledge required)
*Auto-advancing slide show (kiosk mode) and looping (circular mode)
*Incremental display (several overlays or layers in a slide)
*Optional clock with 3 different modes:
**local time
**elapsed time of presentation
**countdown clock for a given period
*Screen blanking for pauses
!Installation
To install this plugin copy the tiddler SlideShowPlugin to your TiddlyWiki, label it with the ''systemConfig'' tag, save the TW and refresh the browser.
Optionally, you can also copy this documentation tiddler. If you don't, a link to the original one in my site is provided.
!Quick start
The simplest way to make a slide show is to create a new tiddler with references to all the tiddlers you want to include in your presentation and add {{{<<slideShow>>}}} anywhere in the tiddler. Close the edit form, click the ''slide show'' button and there you are. Move forward/backward in the presentation with the mouse left/right button. If you move the mouse pointer over the bottom of the browser window you will see a few navigation buttons. Click the ''x'' button or press the ''Escape'' key to exit.
!Options
{{{
<<slideShow tag:tag sort:field noClicks noKeyboard noOverlays cycle showAll theme:tiddler toc: string auto:time clock:type header:string footer:string>>
}}}
''tag''
Use this option to create a slide show with the tiddlers with the provided tag instead of providing a list of tiddlers.
''sort''
If the ''tag'' option is used you can use this other option to sort the tiddlers according to a specific field. Valid values are: //created// (default), //modified//, //title// and //text//.
''noClicks''
Disables navigation through mouse clicks on the tiddlers. This is useful when there are lots of clickable elements in the presentation.
If you want to keep using the mouse to move around the presentation and there are occasional elements that require mouse clicking, these can be formatted with a {{{noClicks}}} class (read more [[here|http://www.tiddlywiki.com/#CustomCssClass]]).
''noKeyboard''
Disables keyboard navigation.
''noOverlays''
Disables the incremental display of overlays.
''cycle''
The slide shows runs in a continuous loop.
''showAll''
To print a presentation all the selected tiddlers are opened in the specified order. Press any key to return to the default TiddlyWiki layout.
''theme''
A user provided tiddler containing CSS rules that define the style of the slide show. To redefine the default style, edit the SlideShowStyleSheet shadow tiddler.
''toc''
Choose the type of table of contents. Possible values: ''titles'' will enable the use of the tiddlers titles, ''headers'' (default) to choose html headers (h1, h2,...), anything else will disable the table of contents.
''auto''
The slide show auto advances after the defined number of seconds. The slide show can be paused by pressing the ''space bar''.
''clock''
Displays a clock near the navigation buttons at the bottom of the screen. Three types of clocks can be defined:
#''clock:0'' -- shows the local time in the format defined by the //config.macros.slideShow.text.clockFormat// parameter.
#''clock:'+''' -- displays the elapsed time of the presentation. Click the clock display to reset the time.
#''clock:-20'' -- displays a countdown clock for the given (negative) number of minutes. Click the clock display to reset the time.
''header''
A string to be used as a permanent header for the slide show. By default it's used the title of tiddler that defines the slide show.
''footer''
A string to be used as a permanent footer slide show.
!Incremental display
A succession of overlays (or layers) can be defined in each slide by marking blocks of text with
{{{
{{overlay1{...some text...}}}, {{overlay2{...some text...}}}, {{overlay3{...some text...}}}, ...
}}}
The default name of the classes (//overlay//) can be redefined with //config.macros.slideShow.text.overlay = "layer"//, for example.
To costumize the way overlays are shown you can redefine the following CSS classes
*.previousOverlay
*.currentOverlay
*.nextOverlay
in a ~StyleSheet. The default style simply hides the next overlays and shows the current and the previous ones as normal text.
!Slide show navigation
You can navigate through a slide show using the keyboard or the mouse.
!!Mouse navigation
Left (right) clicking on a slide jumps to the next (previous) slide or overlay. To move to the first or last slides you must use the navigation bar at the bottom of the browser's window.
!!Keyboard
The following keys are defined:
*Home - first slide
*~PageUp - previous slide
*~PageDown - next slide
*End - last slide
*Escape - exit slide show
*Up arrow - first overlay
*Left arrow - previous overlay/slide
*Pause/Right arrow - next overlay/slide
*Down arrow - last overlay
*Spacebar - pause/resume slide show in auto advance mode
*B - blank screen and block the slide show
!Miscellaneous
Any block of text marked as
{{{
{{comment{For my eyes only!}}}
}}}
will not be displayed in the slide show.
All translatable strings are defined in //config.macros.slideShow.text// parameter. See SlideShowPluginMsgPT with the portuguese translation as an example.
/*{{{*/
.header, #mainMenu, #sidebar, #backstageShow, .toolbar, .title, .subtitle, .tagging, .tagged, .tagClear, .comment, .tagglyTagging{
display:none !important
}
#slideBlanker{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 90;
background-color: #000;
opacity: 0.9;
filter: alpha(opacity=90)
}
.nextOverlay{
visibility: hidden
}
.previousOverlay,.currentOverlay{
visibility: visible
}
#displayArea{
font-size: 250%;
margin: 0 !important;
padding: 0
}
#controlBar{
position: fixed;
bottom: 2px;
right: 2px;
width: 100%;
text-align: right
}
#controlBar .button{
margin: 0 0.25em;
padding: 0 0.25em
}
#slideHeader{
font-size: 200%;
font-weight: bold
}
#slideFooter{
position: fixed;
bottom: 2px
}
.slideFooterOff #navigator{
visibility: hidden
}
#slideClock{
margin: 0 5px 0 5px
}
#slideCounter{
cursor: pointer;
color: #aaa
}
#toc{
display: none;
position: absolute;
font-size: .75em;
bottom: 2em;
right: 0;
background: #fff;
border: 1px solid #000;
text-align: left
}
#jumpItem{
padding-left:0.25em
}
#jumpInput{
margin-left: 0.25em;
width: 3em
}
.tocLevel1{
font-size: .8em
}
.tocLevel2{
margin-left: 1em;
font-size: .75em
}
.tocLevel3{
margin-left: 2em;
font-size: .7em
}
.tocLevel4{
margin-left: 3em;
font-size: .65em
}
.tiddler{border: none}
#tiddlersBar{display: none}
}
.tocLevel5{
margin-left: 4em;
font-size: .6em
}
.tocLevel6{
margin-left: 5em;
font-size: .55em
}
/*}}}*/
<<siteMap [[Skriv også titlen på dit nye hovedemne her]] . sliders>>
<<tabs txtMainTab "Tidslinie" "Tidslinie" TabTimeline "Alle" "Alle tiddlere" TabAll "Tags" "Alle tags" TabTags "Flere" "Flere lister" TabMore>>
// //''Name:'' InsertSmiley
// //''Version:'' <<getversion smiley>> (<<getversiondate smiley "DD MMM YYYY">>)
// //''Author:'' AlanHecht
// //''Type:'' [[Macro|Macros]]
// //''Description:'' Inserts a small smiley graphic at the location of the macro and does not require any external graphics. The method used should work on most current browser platforms.
// //''Syntax:'' << {{{smiley ;-)}}}>>
// //Examples: <<smiley>> <<smiley :-(>> <<smiley ;-)>> <<smiley :-|>> <<smiley :-D>>
// //''Directions:'' <<tiddler MacroDirections>>
// //''Notes:'' A regular smiley <<smiley>> will be displayed if no smiley string is provided. Most smileys will work with or without the "nose" -- e.g. {{{;-)}}} is the same as {{{;)}}}
// //''Revision History:''
// // v0.1.0 (20 July 2005): initial release
// // v0.1.1 (20 July 2005): << {{{smiley}}}>> with no parameter displays a standard smiley
// //''Code section:''
version.extensions.smiley = {major: 0, minor: 1, revision: 1, date: new Date("Jul 20, 2005")};
config.macros.smiley = {}
config.macros.smiley.handler = function(place,macroName,params)
{
var palette = ["transparent","#000000","#1a1507","#352e18","#464646","#666666","#a3141e","#b06b63","#cc9900","#dd9030","#dddddd","#e89d00","#edc32a","#f3cb3c","#fdf201","#fdf526","#ff3149","#ffac00","#ffbf06","#ffc846","#ffcc66","#ffd758","#ffdd01","#ffea7b","#ffed55","#ffffff"];
var data = params;
var imageMap = null;
if(!data[0] || data[0] == ":-)" || data[0] == ":)")
imageMap = "aaaaabbbbbaaaaaaaabdtyyvtdbaaaaabnyxxxxxujbaaabmyyffyffuujbaadyyyeeyeetttdabppppddyddpmmlbbwoooooooowsrlbbwwpooooowwmrlbbwwboooowwwbllbbwwwboooowbrllbacwwwbbbbbrllcaablswwwwsrrlibaaablsssrrllibaaaaabcrrlllcbaaaaaaaabbbbbaaaaa";
else if(data[0] == ":-(" || data[0] == ":(")
imageMap = "aaaaabbbbbaaaaaaaabdtyyvtdbaaaaabnyxxxxxujbaaabmyyyyyyyuujbaadyyyeeyeetttdabppppddyddpmmlbbwoooooooowsrlbbwwpooooowwmrlbbwwoooooowwrllbbwwwwbbbbbsrllbacwwbwwwwsbllcaablswwwwsrrlibaaablsssrrllibaaaaabcrrlllcbaaaaaaaabbbbbaaaaa";
else if(data[0] == ";-)" || data[0] == ";)")
imageMap = "aaaaabbbbbaaaaaaaabdtyyvtdbaaaaabnyxxxxxujbaaabmyyxxxxxuujbaadyyyxxxeetttdabppphddyddpmmlbbwoooooooowsrlbbwwpooooowwmrlbbwwboooowwwbllbbwwwboooowbrllbacwwwbbbbbrllcaablswwwwsrrlibaaablsssrrllibaaaaabcrrlllcbaaaaaaaabbbbbaaaaa";
else if(data[0] == ":-|" || data[0] == ":|")
imageMap = "aaaaabbbbbaaaaaaaabdtyyvtdbaaaaabnyxxxxxujbaaabmyyffyffuujbaadyyyeeyeetttdabppppddyddpmmlbbwoooooooowsrlbbwwpooooowwmrlbbwwoooooowwrllbbwwwwbbbbbsrllbacwwwwwwwsrllcaablswwwwsrrlibaaablsssrrllibaaaaabcrrlllcbaaaaaaaabbbbbaaaaa";
else if(data[0] == ":-D" || data[0] == ":D")
imageMap = "aaaaabbbbbaaaaaaaabdtyyvtdbaaaaabnyxxxxxujbaaabmyyeeyeeuujbaadyyyeeyeetttdabppppyyyyypmmlbbwbbbbbbbbbbblbbwbkzzzzzzzkbwbbwbfzzzzzzzfbwbbwbkzzzzzzzkbwbacwbkzzzzzkblcaablsbkzzzkblibaaablsbbbbblibaaaaabcrrlllcbaaaaaaaabbbbbaaaaa";
else
createTiddlyElement(place,"span",null,"errorNoSuchMacro","unknown smiley");
if(imageMap)
{
var box = createTiddlyElement(place,"span",null,"smiley",String.fromCharCode(160));
box.style.position = "relative";
box.style.width = "15px";
box.style.height = "15px";
box.style.marginLeft = "1px";
box.style.marginRight = "1px";
box.style.paddingRight = "12px";
box.style.verticalAlign = "top";
//now divide into 15x15 grid and create each pixel
// rows
for(r=0; r<15; r++)
{
// columns
for(c=0; c<15; c++)
{
//create each pixel with the correct background
var pix = document.createElement("img");
pix.className = "smileyPixel";
pix.style.position = "absolute";
pix.border = 0;
pix.style.top = r + "px";
pix.style.left = c + "px";
pix.style.width = "1px";
pix.style.height = "1px";
pix.style.backgroundColor = palette[imageMap.charCodeAt((r*15)+c)-97];
pix.src = "data:image/gif,GIF89a%01%00%01%00%91%FF%00%FF%FF%FF%00%00%00%C0%C0%C0%00%00%00!%F9%04%01%00%00%02%00%2C%00%00%00%00%01%00%01%00%40%02%02T%01%00%3B";
box.appendChild(pix);
}
}
}
}
/***
|Name|SnapshotPlugin|
|Source|http://www.TiddlyTools.com/#SnapshotPlugin|
|Documentation|http://www.TiddlyTools.com/#SnapshotPluginInfo|
|Version|1.2.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|save or print HTML+CSS image of rendered document content|
|Status|ALPHA - DO NOT DISTRIBUTE|
This plugin provides a macro as well as tiddler toolbar commands to create a file or browser window containing the //rendered// CSS-and-HTML that is currently being displayed for selected elements of the current document.
!!!!!Documentation
>see [[SnapshotPluginInfo]]
!!!!!Configuration
<<<
<<option chkSnapshotHTMLOnly>> output HTML only (omit CSS)
<<<
!!!!!Revisions
<<<
2009.06.04 [1.2.0] added handling in getSnap() so current form input values are shown in snapshots
|please see [[SnapshotPluginInfo]] for additional revision details|
2008.04.21 [1.0.0] initial release - derived from [[NewDocumentPlugin]] with many improvements...
<<<
!!!!!Code
***/
//{{{
version.extensions.SnapshotPlugin= {major: 1, minor: 2, revision: 0, date: new Date(2009,6,4)};
if (config.options.chkSnapshotHTMLOnly===undefined) config.options.chkSnapshotHTMLOnly=false;
config.macros.snapshot = {
snapLabel: "save a snapshot",
printLabel: "print a snapshot",
snapPrompt: "save an HTML image of rendered content",
printPrompt: "print an HTML image of rendered content",
hereID: "here",
viewerID: "viewer",
storyID: "story",
allID: "all",
askID: "ask",
askTiddlerID: "askTiddler",
askDOMID: "askDOM",
askMsg: "select an element...",
hereItem: "tiddler: '%0'",
viewerItem: "tiddler: '%0' (content only)",
storyItem: "story column",
allItem: "entire document",
tiddlerItem: "select a tiddler...",
IDItem: "select a DOM element by ID...",
HTMLItem: "[%0] output HTML only (omit CSS)",
fileMsg: "select or enter a target path/filename",
defaultFilename: "snapshot.html",
okmsg: "snapshot written to %0",
failmsg: "An error occurred while creating %0",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var printing=params[0]&¶ms[0]=="print"; if (printing) params.shift();
params = paramString.parseParams("anon",null,true,false,false);
var id=getParam(params,"id","here");
var label=getParam(params,"label",printing?this.printLabel:this.snapLabel);
var prompt=getParam(params,"prompt",printing?this.printPrompt:this.snapPrompt);
var btn=createTiddlyButton(place,label,prompt, function(ev){
this.setAttribute("snapID",this.getAttribute("startID"));
config.macros.snapshot.go(this,ev)
});
btn.setAttribute("startID",id);
btn.setAttribute("snapID",id);
btn.setAttribute("printing",printing?"true":"false");
btn.setAttribute("HTMLOnly",config.options.chkSnapshotHTMLOnly?"true":"false");
},
go: function(here,ev) {
var cms=config.macros.snapshot; // abbreviation
var id=here.getAttribute("snapID");
var printing=here.getAttribute("printing")=="true";
var HTMLOnly=here.getAttribute("HTMLOnly")=="true";
if (id==cms.askID||id==cms.askTiddlerID||id==cms.askDOMID) {
cms.askForID(here,ev);
} else {
// get element
if (id==cms.storyID) id="tiddlerDisplay";
if (id==cms.allID) id="contentWrapper";
var snapElem=document.getElementById(id);
if (id==cms.hereID || id==cms.viewerID)
var snapElem=story.findContainingTiddler(here);
if (snapElem && hasClass(snapElem,"tiddler") && (id==cms.viewerID || HTMLOnly)) {
// find viewer class element within tiddler element
var nodes=snapElem.getElementsByTagName("*");
for (var i=0; i<nodes.length; i++)
if (hasClass(nodes[i],"viewer")) { snapElem=nodes[i]; break; }
}
if (!snapElem) // not in a tiddler or no viewer element or unknown ID
{ e.cancelBubble=true; if(e.stopPropagation)e.stopPropagation(); return(false); }
// write or print snapshot
var out=cms.getsnap(snapElem,id,printing,HTMLOnly);
if (printing) cms.printsnap(out); else cms.savesnap(out);
}
return false;
},
askForID: function(here,ev) {
var ev = ev ? ev : window.event;
var cms=config.macros.snapshot; // abbreviation
var id=here.getAttribute("snapID");
var indent='\xa0\xa0\xa0\xa0';
var p=Popup.create(here); if (!p) return false; p.className+=' sticky smallform';
var s=createTiddlyElement(p,'select'); s.button=here;
if (id==cms.askID) {
s.options[s.length]=new Option(cms.askMsg,cms.askID);
var tid=story.findContainingTiddler(here);
if(tid) {
var title=tid.getAttribute("tiddler");
if (here.getAttribute("HTMLOnly")!="true")
s.options[s.length]=new Option(indent+cms.hereItem.format([title]),cms.hereID);
s.options[s.length]=new Option(indent+cms.viewerItem.format([title]),cms.viewerID);
}
s.options[s.length]=new Option(indent+cms.tiddlerItem,cms.askTiddlerID);
s.options[s.length]=new Option(indent+cms.IDItem,cms.askDOMID);
s.options[s.length]=new Option(indent+cms.storyItem,"tiddlerDisplay");
s.options[s.length]=new Option(indent+cms.allItem,"contentWrapper");
}
if (id==cms.askDOMID) {
s.options[s.length]=new Option(cms.IDItem,cms.askDOMID);
var elems=document.getElementsByTagName("*");
var ids=[];
for (var i=0;i<elems.length;i++)
if (elems[i].id.length && elems[i].className!="animationContainer")
ids.push(elems[i].id);
ids.sort();
for (var i=0;i<ids.length;i++) s.options[s.length]=new Option(indent+ids[i],ids[i]);
}
if (id==cms.askTiddlerID) {
s.options[s.length]=new Option(cms.tiddlerItem,cms.askTiddlerID);
var elems=document.getElementsByTagName("div");
var ids=[];
for (var i=0;i<elems.length;i++) { var id=elems[i].id;
if (id.length && id.substr(0,story.idPrefix.length)==story.idPrefix && id!="tiddlerDisplay")
ids.push(id);
}
ids.sort();
for (var i=0;i<ids.length;i++) s.options[s.length]=new Option(indent+ids[i].substr(story.idPrefix.length),ids[i]);
}
s.options[s.length]=new Option(cms.HTMLItem.format([here.getAttribute("HTMLOnly")=="true"?"\u221a":"_"]),cms.HTMLItem);
s.onchange=function(ev){
var ev = ev ? ev : window.event;
var cms=config.macros.snapshot; // abbreviation
var here=this.button;
if (this.value==cms.HTMLItem) {
config.options.chkSnapshotHTMLOnly=!config.options.chkSnapshotHTMLOnly;
here.setAttribute("HTMLOnly",config.options.chkSnapshotHTMLOnly?"true":"false");
config.macros.option.propagateOption("chkSnapshotHTMLOnly","checked",
config.options.chkSnapshotHTMLOnly,"input");
} else
here.setAttribute("snapID",this.value);
config.macros.snapshot.go(here,ev);
return false;
};
Popup.show();
ev.cancelBubble=true;
if(ev.stopPropagation)ev.stopPropagation();
return false;
},
getpath: function() {
// get current path
var path=getLocalPath(window.location.href);
var slashpos=path.lastIndexOf("/");
if (slashpos==-1) slashpos=path.lastIndexOf("\\");
if (slashpos!=-1) path=path.substr(0,slashpos+1); // trim filename
return path;
},
getsnap: function(snapElem,id,printing,HTMLOnly) {
var cms=config.macros.snapshot; // abbreviation
var out='<head>\n';
if (printing)
out+='<base href="file:///'+cms.getpath().replace(/\\/g,'/')+'"></base>\n';
if (!HTMLOnly) {
var styles=document.getElementsByTagName('style');
var fmt='<style>\n/* stylesheet=%0 */\n%1\n\n</style>\n';
for(var i=0; i < styles.length; i++)
out+=fmt.format([styles[i].getAttribute('id'),styles[i].innerHTML]);
}
out+='</head>\n';
var elems=snapElem.getElementsByTagName('input');
for (var i=0; i<elems.length; i++) { var e=elems[i];
if (e.type=='text') e.defaultValue=e.value;
if (e.type=='checkbox') e.defaultChecked=e.checked;
if (e.type=='radiobutton') e.defaultChecked=e.checked;
}
var elems=snapElem.getElementsByTagName('textarea');
for (var i=0; i<elems.length; i++) elems[i].defaultValue=elems[i].value;
var fmt='<body>\n\n<div class="%0">%1</div>\n\n</body>\n';
out+=fmt.format([(id==cms.viewerID?'tiddler viewer':''),snapElem.innerHTML]);
return '<html>\n'+out+'</html>';
},
printsnap: function(out) {
var win=window.open("","_blank","");
win.document.open();
win.document.writeln(out);
win.document.close();
win.focus(); // bring to front
win.print(); // trigger print dialog
},
savesnap: function(out) {
var cms=config.macros.snapshot; // abbreviation
// make sure we are local
if (window.location.protocol!="file:")
{ alert(config.messages.notFileUrlError); return; }
var target=cms.askForFilename(cms.fileMsg,cms.getpath(),cms.defaultFilename);
if (!target) return; // cancelled by user
// if specified file does not include a path, assemble fully qualified path and filename
var slashpos=target.lastIndexOf("/");
if (slashpos==-1) slashpos=target.lastIndexOf("\\");
if (slashpos==-1) target=target+cms.defaultFilename;
var link="file:///"+target.replace(/\\/g,'/'); // link for message text
var ok=saveFile(target,convertUnicodeToUTF8(out));
var msg=ok?cms.okmsg.format([target]):cms.failmsg.format([target]);
clearMessage(); displayMessage(msg,link);
},
askForFilename: function(msg,path,file) {
if(window.Components) { // moz
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='html';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
}
catch(e) { alert('error during local file access: '+e.toString()) }
}
else { // IE
try { // XP/Vista only
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
s.FilterIndex=3; // default to HTML files;
s.InitialDir=path;
s.FileName=file;
if (s.showOpen()) var result=s.FileName;
}
catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
}
return result;
}
};
//}}}
// // TOOLBAR DEFINITIONS
//{{{
config.commands.snapshotSave = {
text: "snap",
tooltip: config.macros.snapshot.snapPrompt,
handler: function(ev,src,title) {
src.setAttribute("snapID","ask");
src.setAttribute("printing","false");
src.setAttribute("HTMLOnly",config.options.chkSnapshotHTMLOnly?"true":"false");
config.macros.snapshot.go(src,ev);
return false;
}
};
config.commands.snapshotPrint = {
text: "print",
tooltip: config.macros.snapshot.printPrompt,
handler: function(ev,src,title) {
src.setAttribute("snapID","ask");
src.setAttribute("printing","true");
src.setAttribute("HTMLOnly",config.options.chkSnapshotHTMLOnly?"true":"false");
config.macros.snapshot.go(src,ev);
return false;
}
};
//}}}
// // COPIED FROM [[StickyPopupPlugin]] TO ELIMINATE PLUGIN DEPENDENCY
//{{{
if (config.options.chkStickyPopups==undefined) config.options.chkStickyPopups=false;
Popup.stickyPopup_onDocumentClick = function(ev)
{
// if click is in a sticky popup, ignore it so popup will remain visible
var e = ev ? ev : window.event; var target = resolveTarget(e);
var p=target; while (p) {
if (hasClass(p,"popup") && (hasClass(p,"sticky")||config.options.chkStickyPopups)) break;
else p=p.parentNode;
}
if (!p) // not in sticky popup (or sticky popups disabled)... use normal click handling
Popup.onDocumentClick(ev);
return true;
};
try{removeEvent(document,"click",Popup.onDocumentClick);}catch(e){};
try{addEvent(document,"click",Popup.stickyPopup_onDocumentClick);}catch(e){};
//}}}
/***
''Inspired by [[TiddlyPom|http://www.warwick.ac.uk/~tuspam/tiddlypom.html]]''
|Name|SplashScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#SplashScreenPlugin|
|Version|0.21 |
|Requires|~TW2.08+|
!Description:
Provides a simple splash screen that is visible while the TW is loading.
!Installation
Copy the source text of this tiddler to your TW in a new tiddler, tag it with systemConfig and save and reload. The SplashScreen will now be installed and will be visible the next time you reload your TW.
!Customizing
Once the SplashScreen has been installed and you have reloaded your TW, the splash screen html will be present in the MarkupPreHead tiddler. You can edit it and customize to your needs.
!History
* 20-07-06 : version 0.21, modified to hide contentWrapper while SplashScreen is displayed.
* 26-06-06 : version 0.2, first release
!Code
***/
//{{{
var old_lewcid_splash_restart=restart;
restart = function()
{ if (document.getElementById("SplashScreen"))
document.getElementById("SplashScreen").style.display = "none";
if (document.getElementById("contentWrapper"))
document.getElementById("contentWrapper").style.display = "block";
old_lewcid_splash_restart();
if (splashScreenInstall)
{if(config.options.chkAutoSave)
{saveChanges();}
displayMessage("TW SplashScreen has been installed, please save and refresh your TW.");
}
}
var oldText = store.getTiddlerText("MarkupPreHead");
if (oldText.indexOf("SplashScreen")==-1)
{var siteTitle = store.getTiddlerText("SiteTitle");
var splasher='\n\n<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>'+siteTitle +'</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>';
if (! store.tiddlerExists("MarkupPreHead"))
{var myTiddler = store.createTiddler("MarkupPreHead");}
else
{var myTiddler = store.getTiddler("MarkupPreHead");}
myTiddler.set(myTiddler.title,oldText+splasher,config.options.txtUserName,null,null);
store.setDirty(true);
var splashScreenInstall = true;
}
//}}}
<html><div align="center"><iframe src="http://resubj.com/inboxes/1349?login_ticket=1489+0yvghlev" frameborder="0" width="100%" height="750"></iframe></div></html>
/***
|Name|StickyPopupPlugin|
|Source|http://www.TiddlyTools.com/#StickyPopupPlugin|
|Version|1.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Popup.onDocumentClick|
|Options|##Configuration|
|Description|allow mouse interactions inside popups without automatically closing them|
Usually, when a TW popup is displayed, it is automatically closed whenever a click occurs //anywhere// in the document, either //inside// or //outside// the popup itself. This plugin makes popups persistent (a.k.a, "sticky"), allowing you to perform multiple mouse interactions on content //inside// the popup (e.g., entering form fields, opening links, selecting text, etc.), remaining visible until you click //outside// the popup or perform an action that opens another popup (only one popup can be displayed at any given time).
!!!!!Configuration
<<<
You can cause popups to behave in a persistent ("sticky") manner simply by selecting the option checkbox below. The selected popup display behavior will be applied to ALL popups in the document automatically.
><<option chkStickyPopups>> make all popups "sticky"
>{{{usage: <<option chkStickyPopups>>}}}
<<<
!!!!!Usage
<<<
If you are developing your own plugins or inline scripts that create popups programmatically using the core function:
{{{
Popup.create(this)
}}}
you can provide additional parameters that specify the desired CSS classname(s) to assign to the popup DOM element. The default class when none is specified is simply "popup". To create a //sticky// popup, simply enter a custom class combination like this:
{{{
Popup.create(this,null,"sticky popup")
}}}
<<<
!!!!!Revisions
<<<
2008.05.16 [1.0.1] added try..catch around addEvent/removeEvent calls to avoid error in Opera
2007.11.25 [1.0.0] initial release - moved from [[CoreTweaks]]
<<<
!!!!!Code
***/
//{{{
version.extensions.StickyPopupPlugin= {major: 1, minor: 0, revision: 1, date: new Date(2008,5,16)};
if (config.options.chkStickyPopups==undefined) config.options.chkStickyPopups=false;
Popup.stickyPopup_onDocumentClick = function(ev)
{
// if click is in a sticky popup, ignore it so popup will remain visible
var e = ev ? ev : window.event; var target = resolveTarget(e);
var p=target; while (p) {
if (hasClass(p,"popup") && (hasClass(p,"sticky")||config.options.chkStickyPopups)) break;
else p=p.parentNode;
}
if (!p) // not in sticky popup (or sticky popups disabled)... use normal click handling
Popup.onDocumentClick(ev);
return true;
};
try{removeEvent(document,"click",Popup.onDocumentClick);}catch(e){};
try{addEvent(document,"click",Popup.stickyPopup_onDocumentClick);}catch(e){};
//}}}
/***
|StyleSheet|StyleSheetTheme|
***/
/***
|PageTemplate|BluePageTemplate|
|ViewTemplate|MyViewTemplate|
|EditTemplate|MyEditTemplate|
***/
/***
!!<<gradient horiz #fff #999>> STYLESHEET>>/%==================================================%/
***/
/***There are extra nested stylesheets at the end of this stylesheet***/
/*{{{*/
body {background-color:#ffffea; color:#030;font-size:0.75em; font-family:arial,helvetica; margin:0; padding:0;auto;}
.tabContents {background-color:#ffe; color #f3f; overflow: auto;}
.tabset a:hover {background:#ffd; color:#f00;}
.viewer {color:#050;line-height: 1.6em;}
.button {border: solid 0px;}
#mainMenu a {color:#077;}
#mainMenu a:hover {background:#333;color:#ffd;}
.mmheading {color:#600;font-weight:bold;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> HEADER >>/%==================================================%/
***/
/*{{{*/
#displayArea {margin-top:0.0em;padding:0em;}
.header {position:relative; height:73px;}
.headerShadow {padding: 1.4em 0em 1em 1em;}
.headerForeground {padding: 1.4em 0em 1em 1em;}
.siteTitle {font-size:1.0em;}
.siteSubtitle {font-size:1em;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> TOOLBAR>>/%==================================================%/
***/
/*{{{*/
.toolbar {color:#900;}
.toolbar a {color:#077;}
.selected .toolbar a {color:#077;}
.selected .toolbar a:hover {color:#090;;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> MAINMENU>>/%==================================================%/
***/
/*{{{*/
#mainMenu {width: 16.5em; text-align: left; font-size: .95em;}
#displayArea {margin: 0em 14em 0em 17em;}
#mainMenu .sliderPanel { margin-left: 1.2em; }
#mainMenu .tiddlyLinkExisting {font-weight: bold;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> SIDEBAR OPTIONS>>/%==================================================%/
***/
/*{{{*/
#sidebarOptions .sliderPanel {background:#eff;font-size:1em;}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebar a:hover {color: #F00;background: #ffd /*#ef9*/;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> VIEWER OPTIONS>>/%==================================================%/
***/
/*{{{*/
.viewer hr {
border: 0px;
border-top: solid 1px #c06;
color: #c06;
}
.viewer blockquote {
border-left: 2px solid #c06;
}
.viewer a:h3 {
color:#600;
text-decoration:underline;
}
.viewer {color:#050;line-height: 1.6em;}
.viewer a.button{color:#04b;
border: solid 1px #008;
background:url([[mainmenugray7ef.gif]]) repeat-x top left;top left;-moz-border-radius: .2em;}
.button {border: solid 0px;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> MISCELLANEOUS>>/%==================================================%/
***/
/*{{{*/
.viewer hr {border: 0px;border-top: solid 1px #c06;color: #c06;width:100%;}
.makeborder {border: solid 1px #008;padding-left: 2px;padding-right: 2px; background:url([[mainmenugray7ef.gif]]) repeat-x top left;top left;-moz-border-radius: .2em;}
/*HR*/
hr {height:1px;width:80%;}
#mainMenu hr {height:1px;color:#c06;width:80%;}
.viewer .popup li .tagger a {display:inline;}
.popup {
max-height:275px;
min-height:auto;
width: 160px;
overflow: auto;
margin:auto;
-moz-border-radius : 0.65em 0.2em 0.2em 0.65em;
background:#eee;
color:#900;
}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> TABS>>/%==================================================%/
***/
/*{{{*/
[[GreenTabsCSS]]
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> GIFFMEX TWEAKS TO STYLESHEETPRINT>>/%==================================================%/
***/
/*{{{*/
/* (so that nothing but tiddler title and text are printed) */
@media print {#tiddlersBar {display: none ! important;}}
@media print {#mainMenu {display: none ! important;}}
@media print {#topMenu {display: none ! important;}}
@media print {#sidebar {display: none ! important;}}
@media print {#messageArea {display: none ! important;}}
@media print {#toolbar {display: none ! important;}}
@media print {.header {display: none ! important;}}
@media print {.tiddler .subtitle {display: none ! important;}}
@media print {.tiddler .toolbar {display; none ! important; }}
@media print {.tiddler .tagging {display; none ! important; }}
@media print {.tiddler .tagged {display; none ! important; }}
@media print {#displayArea {margin: 1em 1em 0em 1em;}}
@media print {.pageBreak {page-break-before: always;}}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> SPECIFIC TIDDLER CUSTOMIZING>>/%==================================================%/
***/
/*Invisible table*/
.viewer .invisibletable table {
border-color: white;
}
.viewer .invisibletable table td {
font-size: 1em;
font-family: Verdana;
border-color: white;
padding: 10px 20px 10px 0px;
text-align: left;
vertical-align: top;
}
.viewer .invisibletable table th {
color: #005566;
background-color: white;
border-color: white;
font-family: Verdana;
font-size: 1.2em;
font-weight: bold;
padding: 10px 20px 10px 0px;
text-align: left;
vertical-align: top;
}
/*{{{*/
#tiddlerTWHelp-SearchResults .viewer {
overflow: auto;
}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> NESTED STYLESHEETS>>/%==================================================%/
***/
/*{{{*/
[[JqueryTreeviewCSS-G]]
[[StyleSheetShortcuts]]
[[TopMenuStyle]]
[[StyleSheetTiddlersBar-G]]
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> ROUNDED CORNERS AND BORDERS>>/%==================================================%/
***/
/*{{{*/
.tiddler {
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
border-bottom: 3px solid #ccc;
border-right: 3px solid #ccc;
margin: 0.5em;
background:#fff;
padding: 0.5em;
-moz-border-radius: 1em; }
#messageArea {
background-color: #eee;
border-color: #8ab;
border-width: 4px;
border-style: dotted;
font-size: 90%;
padding: 0.5em;
-moz-border-radius: 1em; }
#contentFooter {
background: transparent;
padding: 1em 2em;
font-weight:normal;
}
#contentFooter a {
color:#009;
}
.applyNow a, .applyNow .button, .applyNow .tiddlyLinkExisting
{ color:#390 !important; font-weight:bold !important; font-size:150%;
border:1px solid #999; -moz-border-radius:.4em;
padding:.2em .3em; background-color:#fff; }
.applyNow .tiddlyLinkExisting:hover, .applyNow a:hover, .applyNow .button:hover,
{ border:1px solid #69c !important; background:#006 !important; color:#fff !important; }
.bubble a, .bubble .button, .bubble .tiddlyLinkExisting
{ border:1px solid #999; -moz-border-radius:.4em;
padding:.1em .2em; background-color:#fff; }
.bubble .tiddlyLinkExisting:hover, .bubble a:hover, .bubble .button:hover,
{ border:1px solid #69c !important; background:#006 !important; color:#fff !important; }
.formSignature input
{ width:60%; font-size:90%; }
/***
|Name|StyleSheetShortcuts|
|Source|http://www.TiddlyTools.com/#StyleSheetShortcuts|
|Version||
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|CSS|
|Requires||
|Overrides||
|Description|'convenience' classes for common formatting, alignment, boxes, tables, etc.|
These 'style tweaks' can be easily included in other stylesheet tiddler so they can share a baseline look-and-feel that can then be customized to create a wide variety of 'flavors'.
***/
/*{{{*/
/* text alignments */
.left
{ display:block;text-align:left; }
.center
{ display:block;text-align:center; }
.center table
{ margin:auto !important; }
.right
{ display:block;text-align:right; }
.justify
{ display:block;text-align:justify; }
.indent
{ display:block;margin:0;padding:0;border:0;margin-left:2em; }
.floatleft
{ float:left; }
.floatright
{ float:right; }
.valignTop, .valignTop table, .valignTop tbody, .valignTop th, .valignTop tr, .valignTop td
{ vertical-align:top; }
.valignBottom, .valignBottom table, .valignBottom tbody, .valignBottom th, .valignBottom tr, .valignBottom td
{ vertical-align:bottom; }
.clear
{ clear:both; }
.wrap
{ white-space:normal; }
.nowrap
{ white-space:nowrap; }
.hidden
{ display:none; }
.show
{ display:inline !important; }
.span
{ display:span; }
.block
{ display:block; }
.relative
{ position:relative; }
.absolute
{ position:absolute; }
/* font sizes */
.big
{ font-size:14pt;line-height:120% }
.medium
{ font-size:12pt;line-height:120% }
.normal
{ font-size:9pt;line-height:120% }
.small
{ font-size:8pt;line-height:120% }
.fine
{ font-size:7pt;line-height:120% }
.tiny
{ font-size:6pt;line-height:120% }
.larger
{ font-size:120%; }
.smaller
{ font-size:80%; }
/* font styles */
.bold
{ font-weight:bold; }
.italic
{ font-style:italic; }
.underline
{ text-decoration:underline; }
/* plain list items (no bullets or indent) */
.nobullets li { list-style-type: none; margin-left:-2em; }
/* multi-column tiddler content (not supported in Internet Explorer) */
.twocolumns { display:block;
-moz-column-count:2; -moz-column-gap:1em; -moz-column-width:50%; /* FireFox */
-webkit-column-count:2; -webkit-column-gap:1em; -webkit-column-width:50%; /* Safari */
column-count:2; column-gap:1em; column-width:50%; /* Opera */
}
.threecolumns { display:block;
-moz-column-count:3; -moz-column-gap:1em; -moz-column-width:33%; /* FireFox */
-webkit-column-count:3; -webkit-column-gap:1em; -webkit-column-width:33%; /* Safari */
column-count:3; column-gap:1em; column-width:33%; /* Opera */
}
.fourcolumns { display:block;
-moz-column-count:4; -moz-column-gap:1em; -moz-column-width:25%; /* FireFox */
-webkit-column-count:4; -webkit-column-gap:1em; -webkit-column-width:25%; /* Safari */
column-count:4; column-gap:1em; column-width:25%; /* Opera */
}
/* show/hide browser-specific content for InternetExplorer vs. non-IE ("moz") browsers */
*[class="ieOnly"]
{ display:none; } /* hide in moz (uses CSS selector) */
* html .mozOnly, *:first-child+html .mozOnly
{ display: none; } /* hide in IE (uses IE6/IE7 CSS hacks) */
/* borderless tables */
.borderless, .borderless table, .borderless td, .borderless tr, .borderless th, .borderless tbody
{ border:0 !important; margin:0 !important; padding:0 !important; }
.widetable, .widetable table
{ width:100%; }
/* thumbnail images (fixed-sized scaled images) */
.thumbnail img { height:5em !important; }
/* stretchable images (auto-size to fit tiddler) */
.stretch img { width:95%; }
/* grouped content */
.outline
{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; }
.menubox
{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#fff; color:#000; }
.menubox .button, .menubox .tiddlyLinkExisting, .menubox .tiddlyLinkNonExisting
{ color:#009 !important; }
.groupbox
{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#ffe; color:#000; }
.groupbox a, .groupbox .button, .groupbox .tiddlyLinkExisting, .groupbox .tiddlyLinkNonExisting
{ color:#009 !important; }
.groupbox code
{ color:#333 !important; }
.borderleft
{ margin:0;padding:0;border:0;margin-left:1em; border-left:1px dotted; padding-left:.5em; }
.borderright
{ margin:0;padding:0;border:0;margin-right:1em; border-right:1px dotted; padding-right:.5em; }
.borderbottom
{ margin:0;padding:1px 0;border:0;border-bottom:1px dotted; margin-bottom:1px; padding-bottom:1px; }
.bordertop
{ margin:0;padding:0;border:0;border-top:1px dotted; margin-top:1px; padding-top:1px; }
/* scrolled content */
.scrollbars { overflow:auto; }
.height10em { height:10em; }
.height15em { height:15em; }
.height20em { height:20em; }
.height25em { height:25em; }
.height30em { height:30em; }
.height35em { height:35em; }
.height40em { height:40em; }
/* compact form */
.smallform
{ white-space:nowrap; }
.smallform input, .smallform textarea, .smallform button, .smallform checkbox, .smallform radio, .smallform select
{ font-size:8pt; }
/* stretchable edit fields and textareas (auto-size to fit tiddler) */
.stretch input { width:99%; }
.stretch textarea { width:99%; }
/* compact input fields (limited to a few characters for entering percentages and other small values) */
.onechar input { width:1em; }
.twochar input { width:2em; }
.threechar input { width:3em; }
.fourchar input { width:4em; }
.fivechar input { width:5em; }
/* text colors */
.white { color:#fff !important }
.gray { color:#999 !important }
.black { color:#000 !important }
.red { color:#f66 !important }
.green { color:#0c0 !important }
.blue { color:#99f !important }
/* rollover highlighting */
.mouseover
{color:[[ColorPalette::TertiaryLight]] !important;}
.mouseover a
{color:[[ColorPalette::TertiaryLight]] !important;}
.selected .mouseover
{color:[[ColorPalette::Foreground]] !important;}
.selected .mouseover .button, .selected .mouseover a
{color:[[ColorPalette::PrimaryDark]] !important;}
/* rollover zoom text */
.zoomover
{ font-size:80% !important; }
.selected .zoomover
{ font-size:100% !important; }
/* [[ColorPalette]] text colors */
.Background { color:[[ColorPalette::Background]]; }
.Foreground { color:[[ColorPalette::Foreground]]; }
.PrimaryPale { color:[[ColorPalette::PrimaryPale]]; }
.PrimaryLight { color:[[ColorPalette::PrimaryLight]]; }
.PrimaryMid { color:[[ColorPalette::PrimaryMid]]; }
.PrimaryDark { color:[[ColorPalette::PrimaryDark]]; }
.SecondaryPale { color:[[ColorPalette::SecondaryPale]]; }
.SecondaryLight { color:[[ColorPalette::SecondaryLight]];}
.SecondaryMid { color:[[ColorPalette::SecondaryMid]]; }
.SecondaryDark { color:[[ColorPalette::SecondaryDark]]; }
.TertiaryPale { color:[[ColorPalette::TertiaryPale]]; }
.TertiaryLight { color:[[ColorPalette::TertiaryLight]]; }
.TertiaryMid { color:[[ColorPalette::TertiaryMid]]; }
.TertiaryDark { color:[[ColorPalette::TertiaryDark]]; }
.Error { color:[[ColorPalette::Error]]; }
/* [[ColorPalette]] background colors */
.BGBackground { background-color:[[ColorPalette::Background]]; }
.BGForeground { background-color:[[ColorPalette::Foreground]]; }
.BGPrimaryPale { background-color:[[ColorPalette::PrimaryPale]]; }
.BGPrimaryLight { background-color:[[ColorPalette::PrimaryLight]]; }
.BGPrimaryMid { background-color:[[ColorPalette::PrimaryMid]]; }
.BGPrimaryDark { background-color:[[ColorPalette::PrimaryDark]]; }
.BGSecondaryPale { background-color:[[ColorPalette::SecondaryPale]]; }
.BGSecondaryLight { background-color:[[ColorPalette::SecondaryLight]]; }
.BGSecondaryMid { background-color:[[ColorPalette::SecondaryMid]]; }
.BGSecondaryDark { background-color:[[ColorPalette::SecondaryDark]]; }
.BGTertiaryPale { background-color:[[ColorPalette::TertiaryPale]]; }
.BGTertiaryLight { background-color:[[ColorPalette::TertiaryLight]]; }
.BGTertiaryMid { background-color:[[ColorPalette::TertiaryMid]]; }
.BGTertiaryDark { background-color:[[ColorPalette::TertiaryDark]]; }
.BGError { background-color:[[ColorPalette::Error]]; }
/*}}}*/
!!!StyleSheetTiddlersBar
#tiddlersBar .button {border:1px; color:#000;}
#tiddlersBar .tab {white-space:nowrap;}
#tiddlersBar {padding :0.35em 0.5em 0.0em 1.0em;margin-left:0em;margin-right:0em}
#tiddlersBar {margin-bottom:0px;}
.tabSelected .button:hover {font-size:0.95em;font-weight:bold;color: #f00;background: #fff;padding : 0px 0px 0px 2px;}
.tabUnselected .button:hover {font-size:0.95em;color: #f00;background: #fff; padding : 0px 0px 0px 2px;}
.tabUnselected .button {font-size:0.95em;font-weight:bold;color: #080; padding : 0px 0px 0px 2px;}
.tabSelected .button {font-size:0.95em;font-weight:bold;color: #008;padding : 0px 0px 0px 2px;}
.tabUnselected {
background:url([[navbargrayhw1.gif]]) repeat-x top left;top left;
background-color:#EFFFE7;
border:0px #eee solid; border-bottom:0px;font-size:0.95em; }
.tabSelected {
background:url([[navbarred.gif]]) repeat-x top left;top left;
background-color:#fcb;
color: #800;border: 0px #c06 solid;border-bottom:0px; font-size:0.95em;}
.tabUnselected .tabButton {font-weight:bold;font-size:0.75em;color:#333;background:transparent; padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton {font-weight:bold;font-size:0.75em;color:#000;background:transparent;padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tabUnselected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tiddler, .tabContents {border-top:0px #fa0 solid;margin-left:0.5em;margin-right:0.5em;}
#tiddlersBar .tab {-moz-border-radius : 0.4em 0.4em 0 0;}
#tiddlersBar {background:#abf;line-height: 1.45em;}
#tiddlersBar {background: url([[leftbackdrkgreenqu9.jpg]]); background-repeat: repeat;line-height: 1.45em;}
!!!StyleSheetTiddlersBar
#tiddlersBar .button {border:1px; color:#000;}
#tiddlersBar .tab {white-space:nowrap;}
#tiddlersBar {padding : 0.35em 0.5em 0.0em 1.0em;margin-left:0em;margin-right:0em}
#tiddlersBar {margin-bottom:0px;}
.tabSelected .button:hover {font-size:0.95em;font-weight:bold;color: #f00;background: #fff;padding : 0px 0px 0px 2px;}
.tabUnselected .button:hover {font-size:0.95em;color: #f00;background: #fff; padding : 0px 0px 0px 2px;}
.tabUnselected .button {font-size:0.95em;font-weight:bold;color: #008; padding : 0px 0px 0px 2px;}
.tabSelected .button {font-size:0.95em;font-weight:bold;color: #008;padding : 0px 0px 0px 2px;}
.tabUnselected {
background:url([[navbargrayhw1.gif]]) repeat-x top left;top left;
background-color:#eee;
border:0px #eee solid; border-bottom:0px;font-size:0.95em; }
.tabSelected {
background:url([[navbarred.gif]]) repeat-x top left;top left;
background-color:#fcb;
color: #a00;border: 0px #c06 solid;border-bottom:0px; font-size:0.95em;}
.tabUnselected .tabButton {font-weight:bold;font-size:0.75em;color:#333;background:transparent; padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton {font-weight:bold;font-size:0.75em;color:#000;background:transparent;padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tabUnselected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tiddler, .tabContents {border-top:0px #fa0 solid;margin-left:0.5em;margin-right:0.5em;}
#tiddlersBar .tab {-moz-border-radius : 0.4em 0.4em 0 0;}
#tiddlersBar {background:#abf;line-height: 1.45em;}
#tiddlersBar {background: url([[leftbackdo6.gif]]); background-repeat: repeat;line-height: 1.45em;}
<html><div align="center"><iframe src="http://resubj.com/inboxes/1349?login_ticket=1490+6sk2td8d" frameborder="0" width="100%" height="750"></iframe></div></html>
<html><div align="center"><iframe src="http://resubj.com/inboxes/1349?login_ticket=1495+qwulocm7" frameborder="0" width="100%" height="750"></iframe></div></html>
<<getTiddlerPassword "Skriv det password du har modtaget pr mail">>
Hej Måns!
Det er korrekt, at SkolePlan efter sommerferien kommer i ny version, hvor
databasen overgår til en SQL database. Det er dog i første omgang ikke
MySql, men Microsoft Sql (den gratis express version).
Det er ligeledes korrekt, at der er indledt et samarbejde med EDB Brugsen,
som ifølge hensigtserklæring skal munde ud i datamæssig integration mellem
de to systemer inden årsskiftet, således at data indtastet i det ene system
umiddelbart kan genbruges i det andet system uden yderligere indtastning for
brugernes vedkommende. Da EDB Brugsen har valgt MySql, er det også på
projektet at benytte denne database til SkolePlan. Integrationen til EDB
Brugsen samt udvikling af diverse webmoduler står dog forrest på
prioritetslisten.
Den nuværende version af SkolePlan må installeres på et vilkårligt antal af
skolens pc'er, og det samme gælder naturligvis også den næste version.
Den nuværende version er ikke en flerbrugerversion, men den kan dog anvendes
på flere pc'er samtidigt - blot er det kun muligt at redigere på én maskine
adgangen. Et vilkårligt antal pc'er kan således fint læse i SkolePlans data
samtidigt.
Når SkolePlan anvendes på en pc, skal den pågældende windowsbrugerkonto have
fuld redigeringsret til den mappe, hvor SkolePlan er installeret, samt til
brugerens egen "document and settings" mappe. Udover dette er der ikke
særlige krav for anvendelse af SkolePlan.
Jeg takker også for de tilsendte inspirationer, som ser meget spændende ud,
og som også læner sig fint op af de ideer, som er på tegnebrættet. Som
udgangspunkt vil udviklingen dog ske i velkendte værktøjer, hvor der er fuld
kontrol over alle dele af løsningerne, og hvor der vil være ægte
flerbrugermulighed.
med venlig hilsen
Torben Bjerg
DataGiraffen
mail mail@datagiraffen.dk
web skoleplan.dk
-----Oprindelig meddelelse-----
Fra: Måns Mårtensson [mailto:mama@himmerlands-ungdomsskole.dk]
Sendt: 11. juni 2009 08:27
Til: mail@skoleplan.dk
Emne: ang.Licensen til skoleplan
Hej SkolePlan
Vi overvejer at købe licens til Skoleplan.
Det skyldes bl.a. at vi har hørt at SkolePlan har planer om at overgå
til et databasesystem (MySql) og derved via et interface vil kunne dele
oplysninger med Edb-brugsen. Vi har også hørt at SkolePlan vil udbygges
til også at omfatte webmoduler med infotavler til brug for
Administration, lærere, elever med flere - indenfor en overskuelig
fremtid. Dette er vigtige præmisser for vores valg af skemaprogram - og
det faktum at vores nye skemalægger er godt kendt med programmet i
forvejen, spiller naturligvis også en rolle.
Mit første spørgsmål går på hvad licensen indebærer. Der står på jeres
side at licensen giver ret til at installere SkolePlan på skolens pc'er.
Er der tale om 1 valgfri pc- installation, som kan flyttes til en anden
efter behov - eller kan vi frit installere programmet på så mange
maskiner vi har lyst til?
Er det nogen god ide at installere programmet på flere maskiner, når det
reelt er "standalone" - eller kan det bruge en delt database fra vores
server - således at flere brugere kan tilgå de samme data fra
forskellige pc'er? (en ad gangen eller på samme tid) Hvis det sidste er
tilfældet, findes der så et brugersystem, der administrerer det således
at forskellige brugere ikke kommer til at overskrive hinandens arbejde?
Mit spørgsmål er vigtigt at få besvaret, eftersom vi har en skemalægger
som ikke har sit eget kontor, og dermed egen "stationære" opkobling til
skolens netværk. Han har dog en jobbærbar og adgang til flere
stationære pc'er på arbejdet. De deles med andre brugere, med
forskellige rettigheder på netværket.
Ingen af netværksbrugerne har ret til at "se" den lokale pc's harddisk
(bortset fra skrivebordet). Spiller det nogen rolle for afviklingen af
SkolePlan?
Mvh Måns Mårtensson, IT-ansvarlig på Himmerlands-Ungdomsskole,
privat:25344884 eller job: 98664060
/***
|Name|SwitchThemePlugin|
|Source|http://www.TiddlyTools.com/#SwitchThemePlugin|
|Documentation|http://www.TiddlyTools.com/#SwitchThemePluginInfo|
|Version|5.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.3|
|Type|plugin|
|Requires||
|Overrides||
|Description|Select alternative TiddlyWiki template/stylesheet 'themes' from a droplist|
!!!!!Documentation
>see [[SwitchThemePluginInfo]]
!!!!!Configuration
<<<
Current theme:<<switchTheme width:auto>>
<<option chkRandomTheme>> select a random theme at startup
//Note: to prevent a given theme from being chosen at random, tag it with <<tag noRandom>>//
<<<
!!!!!Installation Note
>As of 4/13/2008, a "core patch" function that provides backward-compatibility with TW2.3.x has been split into a separate [[SwitchThemePluginPatch]] tiddler to reduce installation overhead for //this// plugin. ''You should only install [[SwitchThemePluginPatch]] when using this plugin in documents based on a core version prior to TW2.4.0''
!!!!!Revisions
<<<
2008.04.23 [5.3.0] added option for chkRandomTheme (select random theme at startup)
2008.04.13 [5.2.0] moved TW2.3.x fixup for core's switchTheme() function to [[SwitchThemePluginPatch]] and simplified random theme handling. Also, changed "Web*" prefix to "*ReadOnly" suffix for compatibility with TW240 core convention.
| Please see [[SwitchThemePluginInfo]] for previous revision details |
2008.01.22 [5.0.0] Completely re-written and renamed from [[SelectStylesheetPlugin]] (now retired)
>//history for retired [[SelectStylesheetPlugin]] omitted//
2005.07.20 [1.0.0] Initial Release
<<<
!!!!!Code
***/
//{{{
version.extensions.SwitchThemePlugin= {major: 5, minor: 3, revision: 0, date: new Date(2008,4,23)};
config.macros.switchTheme = {
handler: function(place,macroName,params) {
setStylesheet(".switchTheme {width:100%;font-size:8pt;margin:0em}","switchThemePlugin");
if (params[0] && (params[0].substr(0,6)=="width:")) var width=(params.shift()).substr(6);
if (params[0] && (params[0].substr(0,6)=="label:")) var label=(params.shift()).substr(6);
if (params[0] && (params[0].substr(0,7)=="prompt:")) var prompt=(params.shift()).substr(7);
if (params[0] && params[0].trim().length) // create a link that sets a specific theme
createTiddlyButton(place,label?label:params[0],prompt?prompt:params[0],
function(){ config.macros.switchTheme.set(params[0]); return false;});
else { // create a select list of available themes
var theList=createTiddlyElement(place,"select",null,"switchTheme",null);
theList.size=1;
if (width) theList.style.width=width;
theList.onchange=function() { config.macros.switchTheme.set(this.value); return true; };
this.refresh(theList);
}
},
refresh: function(list) {
var indent = String.fromCharCode(160)+String.fromCharCode(160);
while(list.length > 0){list.options[0]=null;} // clear list
list.options[list.length] = new Option("select a theme:","",true,true);
list.options[list.length] = new Option(indent+"[default]","StyleSheet");
list.options[list.length] = new Option(indent+"[random]","*");
var themes=store.getTaggedTiddlers("systemTheme");
for (var i=0; i<themes.length; i++) if (themes[i].title!="StyleSheet")
list.options[list.length]=new Option(indent+themes[i].title,themes[i].title);
// show current selection
for (var t=0; t<list.options.length; t++)
if (list.options[t].value==config.options.txtTheme)
{ list.selectedIndex=t; break; }
},
set: function(theme) {
if (!theme||!theme.trim().length) return;
if (theme=="*") { // select a random theme (excluding themes tagged with "noRandom")
var themes=store.getTaggedTiddlers("systemTheme"); if (!themes.length) return false;
var which=Math.floor(Math.random()*themes.length);
while (themes[which].title==config.options.txtTheme||themes[which].isTagged("noRandom"))
which=Math.floor(Math.random()*themes.length);
theme=themes[which].title;
}
// apply and remember selected theme
story.switchTheme(theme);
config.options.txtTheme=theme;
saveOptionCookie("txtTheme");
// sync theme droplists
var elems=document.getElementsByTagName("select");
var lists=[]; for (var i=0; i<elems.length; i++)
if (hasClass(elems[i],"switchTheme")) lists.push(elems[i]);
for (var k=0; k<lists.length; k++)
for (var t=0; t<lists[k].options.length; t++)
if (lists[k].options[t].value==config.options.txtTheme)
{ lists[k].selectedIndex=t; break; }
return;
}
}
//}}}
// // select a random theme at startup (if enabled)
//{{{
if (config.options.chkRandomTheme===undefined)
config.options.chkRandomTheme=false;
if (config.options.chkRandomTheme)
config.macros.switchTheme.set("*");
//}}}
<<forEachTiddler
where
'tiddler.tags.contains("Syg") && tiddler.fields["k-gruppe"]'
sortBy 'tiddler.fields["title"]'
write
'(index < 200) ? "|!"+(index+1)+"|[["+tiddler.title+"]] | [["+tiddler.fields["k-gruppe"]+"]] | [["+tiddler.fields["kl"]+"]] | [["+tiddler.fields["gang"]+"]] | "+tiddler.fields["vaerelse"]+" | [x(seng@"+tiddler.title+")] | [x(mad@"+tiddler.title+")] | [x(hjem@"+tiddler.title+")] | [x(andet@"+tiddler.title+")] | <<toggleTag HU [["+tiddler.title+"]] - \>\> | [img(2em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>|>|>|>|>|>|>| [[Syge elever|Syg]] @@padding-left: 5%; <<tiddler [[Reset Syg]] \>\>@@@@padding-left: 45%;<<snapshot print label:print prompt:Udskriv id:viewer \>\>@@ |h\n"
+"|!#| !<<tag Elev Navn \>\> | !<<tag Lærere K-gr \>\>| !<<tag Kl \>\> | !<<tag GangOversigt G \>\>| !<<tag Værelser Værelse \>\> | !<<tag SengeLiggende Seng \>\> | !<<tag SkåneKost Mad \>\> | !<<tag Hjem \>\> | !<<tag Andet \>\> | !<<tag HU \>\> |!|h\n"'
end 'count+" syge elever på HU\n"'
none '"Ingen syge elever på HU\n"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Syg") && tiddler.fields["k-gruppe"]'
sortBy 'tiddler.fields["title"]'
write
'(index < 200) ? "|!"+(index+1)+"|[["+tiddler.title+"]] | [["+tiddler.fields["k-gruppe"]+"]] | [["+tiddler.fields["kl"]+"]] | [["+tiddler.fields["gang"]+"]] | "+tiddler.fields["vaerelse"]+" | [x(seng@"+tiddler.title+")] | [x(mad@"+tiddler.title+")] | [x(hjem@"+tiddler.title+")] | [x(andet@"+tiddler.title+")] | <<toggleTag HU [["+tiddler.title+"]] - \>\> | [img(2em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>|>|>|>|>|>|>| [[Syge elever|Syg]] @@padding-left: 5%; <<tiddler [[Reset Syg]] \>\>@@@@padding-left: 45%;<<snapshot print label:print prompt:Udskriv id:viewer \>\>@@ |h\n"
+"|!#| !<<tag Elev Navn \>\> | !<<tag Lærere K-gr \>\>| !<<tag Kl \>\> | !<<tag GangOversigt G \>\>| !<<tag Værelser Værelse \>\> | !<<tag SengeLiggende Seng \>\> | !<<tag SkåneKost Mad \>\> | !<<tag Hjem \>\> | !<<tag Andet \>\> | !<<tag HU \>\> |!|h\n"'
end 'count+" syge elever på HU\n"'
none '"Ingen syge elever på HU\n"'
>>
<<tiddler GenOpfrisk>>
<<tiddler Syg>>
Type the text for 'New Tiddler'
Vil du have tabeller/skemaer over søgeresultaterne, skal du fjerne fluebenet ved siden af søgeboksen:
<<search>><<option chkUseYourSearch>>
Du kan indstille søgningen på mange forskellige måder - (//med eller uden fluebenet//).
----
+++[Her er nogle parametre uden fluebenet:]
<<option chkUseYourSearch>>//Fjern fluebenet//
Demo søgning:
|>|>|>|<<search>> |
|>|>| Søg i |>|>|>|
| <<option chkSearchTitles>> | <<option chkSearchText>> | <<option chkSearchTags>> | <<option chkHoldSearches>> |
| titler | tekst | tags | hold |
===
----
+++[Her er nogle muligheder med fluebenet:]
<<search>><<option chkUseYourSearch>>//Tilføj fluebenet//
<<tiddler YourSearch>>
===
|>|bgcolor:#8af;@@color(#000080):''Der er fundet 4 tiddlere som matcher /{{{udtale}}}/''@@|bgcolor:#8af; @@color:#A00000; SearchHelp@@ |
|>|>|bgcolor:#E3FFE3;<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |
|bgcolor:#8af; |bgcolor:#8af; sort by:''Titles'' |bgcolor:#8af; ''Size'' |bgcolor:#8af; ''Tags'' |h
| 1|[[ElevUdtalelseEditTemplate]]| 4419|template|
| 2|[[ElevUdtalelseViewTemplate]]| 4991|template|
| 3|[[LærerTabel]]| 1659|template|
| 4|[[OpretNyElevUdtalelseKnap]]| 558|knap|
|sortable|k
/***
|StyleSheet|TWHelpTheme|
***/
/***
|PageTemplate|BluePageTemplate|
|ViewTemplate|MyViewTemplate|
|EditTemplate|MyEditTemplate|
***/
/***
!!<<gradient horiz #fff #999>> STYLESHEET>>/%==================================================%/
***/
/***There are extra nested stylesheets at the end of this stylesheet***/
/*{{{*/
body {background-image: url("http://www.symbex.net.au/Wiki/fistback_bg.jpg");background-repeat: repeat-x top-left;
color:#030;font-size:0.75em; font-family:arial,helvetica; margin:0; padding:0;auto;}
.menuname {color:#ffc;}
#sidebar .tabContents {background-color:#008; color #f3f; overflow: auto;}
.tabset a:hover {background:#ffd; color:#ffc;}
.tiddlerDisplay {margin-top:0em;}
.displayArea {margin-top:0em;}
#sidebar {color:#050;}
.viewer {color:#050;line-height: 1.6em;}
.button {border: solid 0px;}
#mainMenu a {color:#ffc;}
#sidebar a {color:#ffc;}
#sidebar .button {color:#ffc;}
#sidebar {color:#c06;}
#mainMenu a:hover {background:#333;color:#ffd;}
#mainMenu {background:transparent;}
.mmheading {color:#0ff;font-weight:bold;}
#sidebarTabs .tabContents {
color: #3CF;
background: #008;
border-top: 0px solid #666;
margin-bottom: 2em;}
#topMenu{font-size: 1.4em;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> HEADER >>/%==================================================%/
***/
/*{{{*/
#displayArea {margin-top:0.0em}
.header {position:relative; height:73px;}
.headerShadow {padding: 1.4em 0em 1em 1em;}
.headerForeground {padding: 1.4em 0em 1em 1em;}
.siteTitle {font-size:1.0em;}
.siteSubtitle {font-size:1em;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> TOOLBAR>>/%==================================================%/
***/
/*{{{*/
.toolbar {color:#900;}
.toolbar a {color:#077;}
.selected .toolbar a {color:#077;}
.selected .toolbar a:hover {color:#090;;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> MAINMENU>>/%==================================================%/
***/
/*{{{*/
#mainMenu {width: 16.5em; text-align: left; font-size: .95em;}
#displayArea {margin: 0em 14.5em 0em 17em;}
#mainMenu .sliderPanel { margin-left: 1.2em; }
#mainMenu .tiddlyLinkExisting {font-weight: bold;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> SIDEBAR OPTIONS>>/%==================================================%/
***/
/*{{{*/
#sidebarOptions .sliderPanel {background:#eff;font-size:1em;}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebar a:hover {color: #F00;background: #ffd /*#ef9*/;}
#sidebarOptions {color: #F00;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> VIEWER OPTIONS>>/%==================================================%/
***/
/*{{{*/
.viewer hr {
border: 0px;
border-top: solid 1px #c06;
color: #c06;
}
.viewer blockquote {
border-left: 2px solid #c06;
}
.viewer a:h3 {
color:#600;
text-decoration:underline;
}
.viewer {color:#050;line-height: 1.6em;}
.viewer a.button{color:#04b;
border: solid 1px #008;
background:url([[mainmenugray7ef.gif]]) repeat-x top left;top left;-moz-border-radius: .2em;}
.button {border: solid 0px;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> MISCELLANEOUS>>/%==================================================%/
***/
/*{{{*/
.viewer hr {border: 0px;border-top: solid 1px #c06;color: #c06;width:100%;}
.makeborder {border: solid 1px #008;padding-left: 2px;padding-right: 2px; background:url([[mainmenugray7ef.gif]]) repeat-x top left;top left;-moz-border-radius: .2em;}
/*HR*/
hr {height:1px;width:80%;}
#mainMenu hr {border: 0px;border-top: solid 1px #c06;color: #c06;width:90%;}
.viewer .popup li .tagger a {display:inline;}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> TABS>>/%==================================================%/
***/
/*{{{*/
[[GreenTabsCSS]]
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> GIFFMEX TWEAKS TO STYLESHEETPRINT>>/%==================================================%/
***/
/*{{{*/
/*Invisible table*/
.viewer .invisibletable table {
border-color: white;
}
.viewer .invisibletable table td {
font-size: 1em;
font-family: Verdana;
border-color: white;
padding: 10px 20px 10px 0px;
text-align: left;
vertical-align: top;
}
.viewer .invisibletable table th {
color: #005566;
background-color: white;
border-color: white;
font-family: Verdana;
font-size: 1.2em;
font-weight: bold;
padding: 10px 20px 10px 0px;
text-align: left;
vertical-align: top;
}
/* (so that nothing but tiddler title and text are printed) */
@media print {#tiddlersBar {display: none ! important;}}
@media print {#mainMenu {display: none ! important;}}
@media print {#topMenu {display: none ! important;}}
@media print {#sidebar {display: none ! important;}}
@media print {#messageArea {display: none ! important;}}
@media print {#toolbar {display: none ! important;}}
@media print {.header {display: none ! important;}}
@media print {.tiddler .subtitle {display: none ! important;}}
@media print {.tiddler .toolbar {display; none ! important; }}
@media print {.tiddler .tagging {display; none ! important; }}
@media print {.tiddler .tagged {display; none ! important; }}
@media print {#displayArea {margin: 1em 1em 0em 1em;}}
@media print {.pageBreak {page-break-before: always;}}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> SPECIFIC TIDDLER CUSTOMIZING>>/%==================================================%/
***/
/*{{{*/
#tiddlerTWHelp-SearchResults .viewer {
overflow: auto;
}
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> NESTED STYLESHEETS>>/%==================================================%/
***/
/*{{{*/
[[JqueryTreeviewCSS-T]]
[[StyleSheetShortcuts]]
[[TopMenuStyle2]]
[[StyleSheetTiddlersBarblue]]
/*}}}*/
/***
!!!<<gradient horiz #fff #999>> ROUNDED CORNERS AND BORDERS>>/%==================================================%/
***/
/*{{{*/
.tiddler {
border-top: 0px solid #ccc;
border-left: 1px solid #ccc;
border-bottom: 3px solid #ccc;
border-right: 3px solid #ccc;
margin: 0.5em;
background:#fff;
padding: 0.5em;
}
#messageArea {
background-color: #eee;
border-color: #8ab;
border-width: 4px;
border-style: dotted;
font-size: 90%;
padding: 0.5em;
-moz-border-radius: 1em; }
#contentFooter {
background: transparent;
padding: 1em 2em;
font-weight:normal;
}
#contentFooter a {
color:#009;
}
|>|bgcolor(#8af):@@color(#000080):''Der er fundet 1 tiddlere som matcher /{{{twhel}}}/''@@|bgcolor(#8af): @@color(#A00000): SearchHelp@@ |
|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titler <<option chkSearchText>> Tekst <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |
|bgcolor(#8af): |bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h
| 1|[[TwHelpSearchPlugin]]| 6445|@@noTitle,systemConfig@@|
|sortable|k
Type the text for 'New Tiddler'
<<forEachTiddler
where
'tiddler.tags.contains("AndreFag")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"andre hold\" er oprettede endnu//"'
>>
<<forEachTiddler where 'tiddler.tags.contains("NoteArkiv")'
sortBy 'tiddler.title'
write
'(index < 200)? "|!"+(index+1)+"| [["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"| | !<<tag NoteArkiv \>\> |h\n"
+"|!#| ~SygeDatoer & Noter |h\n"'
end 'count+"stk arkiverede notater\n"' none '"Ingen arkiverede notater\n"'>>
<<calendar thismonth>><<forEachTiddler where 'tiddler.tags.contains("Calendar")>><<newTiddler title: 'Nyt kalenderår - udskift XXXX herunder med det år du ønsker at se' text:{{store.getTiddlerText("CalendarYearSliderFrame")}} tag: 'Calendar' label:'Tilføj et nyt kalenderår'>>
----
[[Tilføj aftaler]]
[[Denne uges aftaler]]
[[Alle aftaler]] (365 dage}
[[Skema]]
[[Ugeskema]]
[[VagtPlan]]
ÅrsPlan
[[Årsplan 09/10]]
{{centeredmenu{<<newTiddler title: 'Skriv initialer på ny lærer her' tag: 'Lærere' label: '| Ny lærer ' text: 'klik på redigér og tilføj oplysninger på kortets bagside'>>}}}{{centeredmenu{<<newTiddler title: 'Indskriv navnet på en ny elev her' tag: 'Elev' label: '| Ny elev ' text: 'klik på redigér og tilføj oplysninger på kortets bagside'>>}}}<br>{{centeredmenu{<<newTiddler title: 'Indskriv navnet på din nye adressegruppe her' tag: 'adressegruppe' label: '| Ny adressegruppe ' text:{{store.getTiddlerText("ContactGroupSliderFrame")}}>>}}}{{centeredmenu{<<newTiddler title:'Skriv navn på din nye kontakt og klik færdig for at tilføje data' label:"| Ny kontakt" text:{{"<<formTiddler NewContactTemplate\>\>"}} tag:"Kontakt">>}}}
<<tabs txtMenuMenu
"Kontaktgrupper" "Kontakt grupper" TabKontaktGrupper
"Kontakter" "Kontakter" TabKontakter
"9" "9. klasse" Tab9
"10" "10. klasse" Tab10
>>
<<forEachTiddler
where
'tiddler.tags.contains("Dansk")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"dansk hold\" er oprettede endnu//"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Emne")'
script
'
function getFirstLine(s) {
var m = s.match(/\s*(.*)/);
return m != null && m.length >= 1 ? m[1] : "";
}
'
write
'"*<<siteMap [["+tiddler.title+"]] . sliders$))→ ~~//"+getFirstLine(tiddler.text)+"//~~\n"'
>>
+++[TagglyT] ... <<tagglyTagging Emne>>
<<forEachTiddler
where
'tiddler.tags.contains("Engelsk")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"engelskhold\" er oprettede endnu//"'
>>
<<tabs ""
"Hjælp" "Hjælp" TabHjælp
"IFrames" "IFrames" TabIFrames
"GTD" "GTD" TabGTD >>
<<tabs txtMenuMenu
Mapper "Mapper over alle fag" [[Timer & reservationer]]
"Da""Dansk" TabDansk
"Ty" "Tysk" TabTysk
"Eng" "Engelsk" TabEngelsk
"Mat" "Matematik" TabMatematik
"Fys" "FysikKemi" TabFysikKemi
"Valg" "Valgfag" TabValgFag
"Andre" "Andre fag" TabAndreFag >>
----
|<<tag FagType faghold>>|<<tag mål>>|<<tag projekt>>|
|<<tag opgave>>|<<tag Opgavetype type>>|<<tag status>>|
<<forEachTiddler
where
'tiddler.tags.contains("FysikKemi")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"fysikhold\" er oprettede endnu//"'
>>
<<forEachTiddler where 'tiddler.tags.contains("HU") && tiddler.fields["k-gruppe"] && tiddler.fields["gang"]'
sortBy 'tiddler.title'
write
'(index < 200)? "|!"+(index+1)+"| <<tag "+tiddler.fields["gang"]+" \>\> | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | [img(4em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>| ![[Weekenden|WeekendListen]] ||h\n"
+"|!| <<tag GangOversigt Gang \>\> | <<tag Lærere K-gruppe \>\> | |h\n"'
end 'count+"stk weeekendelever\n"' none '"Ingen weekendelever\n"'>>
<<forEachTiddler where 'tiddler.tags.contains("Elev")&& tiddler.fields["hjem"]=="true" '
sortBy 'tiddler.fields["gang"]'
write
'(index < 200)? "|!"+(index+1)+"| <<tag "+tiddler.fields["gang"]+" \>\> | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | [img(4em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>| <<tag Elev Elever \>\> [[hjemme|Hjemme]] ||h\n"
+"|!| <<tag GangOversigt Gang \>\> | <<tag Lærere K-gruppe \>\> | |h\n"'
end 'count+"elever hjemme\n"' none '"Ingen elever hjemme\n"'>>
[[Velkommen]]
[[Læs mere om TiddlyWiki|More info on TiddlyWiki]]
[[TiddlyDu3 layout|The TiddlyDu3 layout]]
[[Mål, projekter og opgaver|Goals, projects, and tasks]]
[[Status og opgavetyper|Statuses and tasktypes]]
[[Kontaktgrupper og kontakter|Contact groups and contacts]]
[[InfoTavlen|My Info]]
[[IFrames]]
[[Fjernelse af uønskede egenskaber|Removing unwanted features]]
----
<<forEachTiddler where 'tiddler.tags.contains("hjælp")'>>
<<editTiddler TabHjælp "redigér Hjælp eller tag med *hjælp*">>
<<newTiddler title: 'Ny IFrame - udskift XXXX herunder med den hjemmeside du ønsker adgang til' text: '<html><div align="center"><iframe src="http://XXXX" frameborder="0" width="100%" height="600"></iframe></div></html>' tag: 'iframe' label:'Ny IFrame'>>
<<forEachTiddler where 'tiddler.tags.contains("iframe")>>
<<newTiddler title: 'Ny information' tag: 'info' label:'Nyt til infoTavlen'>>
<<option txtUserName>>
<<forEachTiddler where 'tiddler.tags.contains("info")'>>
|<<slideShow tag:infok label:"infoKiosk" auto:7 header:"InfoKiosk" cycle clock:'+'>>|
- tag med *<<tag infok>>*
<<tabs txtMenuMenu
"Syge" "Syge" TabSyge
"Weekend" "Her i weekenden" TabHU
"Hjemme" "Hjemme" TabHjemme
"Arkiv" "Arkiv" TabArkiv
"JG" "JG" TabJG
"BI" "BI" TabBI>>
| ![[Jakobs|JG]] [[hjemmeside|Jakobs hjemmeside]] |[[HU|HUs hjemmeside]] |
| [[Mail|mailto:"jape@himmerlands-ungdomsskole.dk"]] | ![[Adr|Jakob Mols Græsborg]] |
<<forEachTiddler
where
'tiddler.tags.contains("kontaktgrupper")'
script
'
function getFirstLine(s) {
var m = s.match(/\s*(.*)/);
return m != null && m.length >= 1 ? m[1] : "";
}
'
write
'getFirstLine(tiddler.text)'
>><<tiddler Lærere>>
{{left{
<<tabs ""[[K-gruppe]] "Oversigt over K-gruppe elever" LærerTabel [[Meddelelser]] "Mine beskeder" MedDelelser [[Lister]] "Gå til direkte til listen for at kunne skrive ud"TiddlerSygHuPrint [[Mine Fag]] "Mine fag"LaererensFag [[Alle Fag]] "Alle oprettede fag på HU"TabFag [[Alle Noter]] "Alles noter" [[NoteArkiv]] [[Privat Note]] "Min egen private note" NoteSkabelonSlider [[Mail&data]] "Skriv mailtekst & rediger læreroplysninger" Mail&Tekst>>
<<forEachTiddler
where
'tiddler.tags.contains("Matematik")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"matematikhold\" er oprettede endnu//"'
>>
<<forEachTiddler where 'tiddler.tags.contains("Syg") && tiddler.fields["k-gruppe"] && tiddler.fields["gang"]'
sortBy tiddler.fields["gang"]
write
'(index < 200)? "|!"+(index+1)+"| <<tag "+tiddler.fields["gang"]+" \>\> | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | [img(4em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>| ![[SygeListen|Syg]]||h\n"
+"|!| <<tag GangOversigt Gang \>\> | <<tag Lærere K-gruppe \>\> | |h\n"'
end 'count+"stk syge elever\n"' none '"Ingen syge elever\n"'>>
<<forEachTiddler
where
'tiddler.tags.contains("Tysk")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"tyskhold\" er oprettede endnu//"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("ValgFag")'
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"valghold\" er oprettede endnu//"'
>>
/***
|''Name:''|TableSortingPlugin|
|''Description:''|Dynamically sort tables by clicking on column headers|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#TableSortingPlugin|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.02|
|''Date:''|25-01-2008|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.3|
!!Usage:
* Make sure your table has a header row
** {{{|Name|Phone Number|Address|h}}}<br> Note the /h/ that denote a header row
* Give the table a class of 'sortable'
** {{{
|sortable|k
|Name|Phone Number|Address|h
}}}<br>Note the /k/ that denotes a class name being assigned to the table.
* To disallow sorting by a column, place {{{<<nosort>>}}} in it's header
* To automatically sort a table by a column, place {{{<<autosort>>}}} in the header for that column
** Or to sort automatically but in reverse order, use {{{<<autosort reverse>>}}}
!!Example:
|sortable|k
|Name |Salary |Extension |Performance |File Size |Start date |h
|ZBloggs, Fred |$12000.00 |1353 |+1.2 |74.2Kb |Aug 19, 2003 21:34:00 |
|ABloggs, Fred |$12000.00 |1353 |1.2 |3350b |09/18/2003 |
|CBloggs, Fred |$12000 |1353 |1.200 |55.2Kb |August 18, 2003 |
|DBloggs, Fred |$12000.00 |1353 |1.2 |2100b |07/18/2003 |
|Bloggs, Fred |$12000.00 |1353 |01.20 |6.156Mb |08/17/2003 05:43 |
|Turvey, Kevin |$191200.00 |2342 |-33 |1b |02/05/1979 |
|Mbogo, Arnold |$32010.12 |2755 |-21.673 |1.2Gb |09/08/1998 |
|Shakespeare, Bill |£122000.00|3211 |6 |33.22Gb |12/11/1961 |
|Shakespeare, Hamlet |£9000 |9005 |-8 |3Gb |01/01/2002 |
|Fitz, Marvin |€3300.30 |5554 |+5 |4Kb |05/22/1995 |
***/
// /%
//!BEGIN-PLUGIN-CODE
config.tableSorting = {
darrow: "\u2193",
uarrow: "\u2191",
getText : function (o) {
var p = o.cells[SORT_INDEX];
return p.innerText || p.textContent || '';
},
sortTable : function (o,rev) {
SORT_INDEX = o.getAttribute("index");
var c = config.tableSorting;
var T = findRelated(o.parentNode,"TABLE");
if(T.tBodies[0].rows.length<=1)
return;
var itm = "";
var i = 0;
while (itm == "" && i < T.tBodies[0].rows.length) {
itm = c.getText(T.tBodies[0].rows[i]).trim();
i++;
}
if (itm == "")
return;
var r = [];
var S = o.getElementsByTagName("span")[0];
c.fn = c.sortAlpha;
if(!isNaN(Date.parse(itm)))
c.fn = c.sortDate;
else if(itm.match(/^[$|£|€|\+|\-]{0,1}\d*\.{0,1}\d+$/))
c.fn = c.sortNumber;
else if(itm.match(/^\d*\.{0,1}\d+[K|M|G]{0,1}b$/))
c.fn = c.sortFile;
for(i=0; i<T.tBodies[0].rows.length; i++) {
r[i]=T.tBodies[0].rows[i];
}
r.sort(c.reSort);
if(S.firstChild.nodeValue==c.darrow || rev) {
r.reverse();
S.firstChild.nodeValue=c.uarrow;
}
else
S.firstChild.nodeValue=c.darrow;
var thead = T.getElementsByTagName('thead')[0];
var headers = thead.rows[thead.rows.length-1].cells;
for(var k=0; k<headers.length; k++) {
if(!hasClass(headers[k],"nosort"))
addClass(headers[k].getElementsByTagName("span")[0],"hidden");
}
removeClass(S,"hidden");
for(i=0; i<r.length; i++) {
T.tBodies[0].appendChild(r[i]);
c.stripe(r[i],i);
for(var j=0; j<r[i].cells.length;j++){
removeClass(r[i].cells[j],"sortedCol");
}
addClass(r[i].cells[SORT_INDEX],"sortedCol");
}
},
stripe : function (e,i){
var cl = ["oddRow","evenRow"];
i&1? cl.reverse() : cl;
removeClass(e,cl[1]);
addClass(e,cl[0]);
},
sortNumber : function(v) {
var x = parseFloat(this.getText(v).replace(/[^0-9.-]/g,''));
return isNaN(x)? 0: x;
},
sortDate : function(v) {
return Date.parse(this.getText(v));
},
sortAlpha : function(v) {
return this.getText(v).toLowerCase();
},
sortFile : function(v) {
var j, q = config.messages.sizeTemplates, s = this.getText(v);
for (var i=0; i<q.length; i++) {
if ((j = s.toLowerCase().indexOf(q[i].template.replace("%0\u00a0","").toLowerCase())) != -1)
return q[i].unit * s.substr(0,j);
}
return parseFloat(s);
},
reSort : function(a,b){
var c = config.tableSorting;
var aa = c.fn(a);
var bb = c.fn(b);
return ((aa==bb)? 0 : ((aa<bb)? -1:1));
}
};
Story.prototype.tSort_refreshTiddler = Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function(title,template,force,customFields,defaultText){
var elem = this.tSort_refreshTiddler.apply(this,arguments);
if(elem){
var tables = elem.getElementsByTagName("TABLE");
var c = config.tableSorting;
for(var i=0; i<tables.length; i++){
if(hasClass(tables[i],"sortable")){
var x = null, rev, table = tables[i], thead = table.getElementsByTagName('thead')[0], headers = thead.rows[thead.rows.length-1].cells;
for (var j=0; j<headers.length; j++){
var h = headers[j];
if (hasClass(h,"nosort"))
continue;
h.setAttribute("index",j);
h.onclick = function(){c.sortTable(this); return false;};
h.ondblclick = stopEvent;
if(h.getElementsByTagName("span").length == 0)
createTiddlyElement(h,"span",null,"hidden",c.uarrow);
if(!x && hasClass(h,"autosort")) {
x = j;
rev = hasClass(h,"reverse");
}
}
if(x)
c.sortTable(headers[x],rev);
}
}
}
return elem;
};
setStylesheet("table.sortable span.hidden {visibility:hidden;}\n"+
"table.sortable thead {cursor:pointer;}\n"+
"table.sortable .nosort {cursor:default;}\n"+
"table.sortable td.sortedCol {background:#ffc;}","TableSortingPluginStyles");
function stopEvent(e){
var ev = e? e : window.event;
ev.cancelBubble = true;
if (ev.stopPropagation) ev.stopPropagation();
return false;
}
config.macros.nosort={
handler : function(place){
addClass(place,"nosort");
}
};
config.macros.autosort={
handler : function(place,m,p,w,pS){
addClass(place,"autosort"+" "+pS);
}
};
//!END-PLUGIN-CODE
// %/
/%
|Name|ShowTabsForTags|
|Source|http://www.TiddlyTools.com/#ShowTabsForTags|
|Version|1.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires||
|Overrides||
|Description|automatically generate a tabbed display for tiddlers with a specified set of tags|
Usage:
<<tiddler ShowTabsForTags with: "tag tag ...">>
where:
"tag tag ..." is a space-separated list of tag values, ALL of which
must be present on the tiddlers that are to be displayed.
%/{{left wrap{<script>
var tags="$1".readBracketedList(); // get tags list from param
if ("$1"=="$"+"1") { // if no tags were specified, then ASK for tags...
var response=prompt("skriv tag(s) der skal matches:","faq");
if (!response) return "ingen tags er specificeret"; // cancelled by user
var tags=response.readBracketedList();
}
// get tiddlers with a least one matching tag, in date order (newest first)
// and, for each tiddler that matches ALL tags, add macro params to output...
var out="";
var tids=store.getTaggedTiddlers(tags[0],'modified').reverse();
for (var t=0; t<tids.length; t++)
if (tids[t].tags.containsAll(tags)) out+='[[%0 ]] "view %0" [[%0]]'.format([tids[t].title]);
// if any tiddlers matched, output the <<tabs>> macro...
if (out.length) return "<<tabs tabTabsForTags "+out+">>";
// otherwise, output a message with popups for each specified tag...
return "Der er ingen tiddlere tagget med <<tag "+tags.join(">> og <<tag ")+">>";
</script>}}}
/***
|Name|TagCloudPlugin|
|Source|http://www.TiddlyTools.com/#TagCloudPlugin|
|Version|1.6.0|
|Author|Eric Shulman|
|Original Author|Clint Checketts|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|present a 'cloud' of tags (or links) using proportional font display|
!Usage
<<<
{{{
<<cloud type action:... limit:... tag tag tag ...>>
<<cloud type action:... limit:... +TiddlerName>>
<<cloud type action:... limit:... =tagvalue>>
}}}
where:
* //type// is a keyword, one of:
** ''tags'' (default) - displays a cloud of tags, based on frequency of use
** ''links'' - displays a cloud of tiddlers, based on number of links //from// each tiddler
** ''references'' - displays a cloud of tiddlers, based on number of links //to// each tiddler
* ''action:popup'' (default) - clicking a cloud item shows a popup with links to related tiddlers<br>//or//<br> ''action:goto'' - clicking a cloud item immediately opens the tiddler corresponding to that item
* ''limit:N'' (optional) - restricts the cloud display to only show the N most popular tags/links
* ''tag tag tag...'' (or ''title title title'' if ''links''/''references'' is used)<br>shows all tags/links in the document //except// for those listed as macro parameters
* ''+TiddlerName''<br>shows tags/links read from a space-separated, bracketed list stored in a separate tiddler.
* ''=tagvalue'' (//only if type=''tags''//)<br>shows only tags that are themselves tagged with the indicated tag value (i.e., ~TagglyTagging usage)
//note: for backward-compatibility, you can also use the macro {{{<<tagCloud ...>>}}} in place of {{{<<cloud ...>>}}}//
<<<
!Examples
<<<
//all tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud systemConfig excludeMissing script>>}}}
//top 10 tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud limit:10 systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud limit:10 systemConfig excludeMissing script>>}}}
//tags listed in// [[FavoriteTags]]
{{{<<cloud +FavoriteTags>>}}}
{{groupbox{<<cloud +FavoriteTags>>}}}
//links to tiddlers tagged with 'package'//
{{{<<cloud action:goto =package>>}}}
{{groupbox{<<cloud action:goto =package>>}}}
//top 20 most referenced tiddlers//
{{{<<cloud references limit:20>>}}}
{{groupbox{<<cloud references limit:20>>}}}
//top 20 tiddlers that contain the most links//
{{{<<cloud links limit:20>>}}}
{{groupbox{<<cloud links limit:20>>}}}
<<<
!Revisions
<<<
2009.02.26 [1.6.0] added {{{action:...}}} parameter to apply popup vs. goto action when clicking cloud items
2009.02.05 [1.5.0] added ability to show links or back-links (references) instead of tags and renamed macro to {{{<<cloud>>}}} to reflect more generalized usage.
2008.12.16 [1.4.2] corrected group calculation to prevent 'group=0' error
2008.12.16 [1.4.1] revised tag filtering so excluded tags don't affect calculations
2008.12.15 [1.4.0] added {{{limit:...}}} parameter to restrict the number of tags displayed to the top N most popular
2008.11.15 [1.3.0] added {{{+TiddlerName}}} parameter to include only tags that are listed in the indicated tiddler
2008.09.05 [1.2.0] added '=tagname' parameter to include only tags that are themselves tagged with the specified value (i.e., ~TagglyTagging usage)
2008.07.03 [1.1.0] added 'segments' property to macro object. Extensive code cleanup
<<<
!Code
***/
//{{{
version.extensions.TagCloudPlugin= {major: 1, minor: 6 , revision: 0, date: new Date(2009,2,26)};
//Originally created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
//Currently maintained and enhanced by Eric Shulman
//}}}
//{{{
config.macros.cloud = {
tagstip: "%1 tiddlers tagged with '%0'",
refslabel: " (%0 references)",
refstip: "%1 tiddlers have links to '%0'",
linkslabel: " (%0 links)",
linkstip: "'%0' has links to %1 other tiddlers",
groups: 9,
init: function() {
config.macros.tagCloud=config.macros.cloud; // for backward-compatibility
config.shadowTiddlers.TagCloud='<<cloud>>';
config.shadowTiddlers.StyleSheetTagCloud=
'/*{{{*/\n'
+'.tagCloud span {line-height: 3.5em; margin:3px;}\n'
+'.tagCloud1{font-size: 80%;}\n'
+'.tagCloud2{font-size: 100%;}\n'
+'.tagCloud3{font-size: 120%;}\n'
+'.tagCloud4{font-size: 140%;}\n'
+'.tagCloud5{font-size: 160%;}\n'
+'.tagCloud6{font-size: 180%;}\n'
+'.tagCloud7{font-size: 200%;}\n'
+'.tagCloud8{font-size: 220%;}\n'
+'.tagCloud9{font-size: 240%;}\n'
+'/*}}}*/\n';
setStylesheet(store.getTiddlerText('StyleSheetTagCloud'),'tagCloudsStyles');
},
getLinks: function(tiddler) { // get list of links to existing tiddlers and shadows
if (!tiddler.linksUpdated) tiddler.changed();
var list=[]; for (var i=0; i<tiddler.links.length; i++) {
var title=tiddler.links[i];
if (store.isShadowTiddler(title)||store.tiddlerExists(title))
list.push(title);
}
return list;
},
handler: function(place,macroName,params) {
// unpack params
var inc=[]; var ex=[]; var limit=0; var action='popup';
var links=(params[0]&¶ms[0].toLowerCase()=='links'); if (links) params.shift();
var refs=(params[0]&¶ms[0].toLowerCase()=='references'); if (refs) params.shift();
if (params[0]&¶ms[0].substr(0,7).toLowerCase()=='action:')
action=params.shift().substr(7).toLowerCase();
if (params[0]&¶ms[0].substr(0,6).toLowerCase()=='limit:')
limit=parseInt(params.shift().substr(6));
if (params.length) {
if (params[0].substr(0,1)=='+') { // get tag list from tiddler
var inc=store.getTiddlerText(params[0].substr(1),'').readBracketedList();
} else if (params[0].substr(0,1)=='=') { // get tag list using tagged tags
var tagged=store.getTaggedTiddlers(params[0].substr(1));
for (var t=0; t<tagged.length; t++) inc.push(tagged[t].title);
} else ex=params; // exclude params
}
// get all items, include/exclude specific items
var items=[];
var list=(links||refs)?store.getTiddlers('title','excludeLists'):store.getTags();
for (var t=0; t<list.length; t++) {
var title=(links||refs)?list[t].title:list[t][0];
if (links) var count=this.getLinks(list[t]).length;
else if (refs) var count=store.getReferringTiddlers(title).length;
else var count=list[t][1];
if ((!inc.length||inc.contains(title))&&(!ex.length||!ex.contains(title)))
items.push({ title:title, count:count });
}
if(!items.length) return;
// sort by decending count, limit results (optional)
items=items.sort(function(a,b){return(a.count==b.count)?0:(a.count>b.count?-1:1);});
while (limit && items.length>limit) items.pop();
// find min/max and group size
var most=items[0].count;
var least=items[items.length-1].count;
var groupSize=(most-least+1)/this.groups;
// sort by title and draw the cloud of items
items=items.sort(function(a,b){return(a.title==b.title)?0:(a.title>b.title?1:-1);});
var cloudWrapper = createTiddlyElement(place,'div',null,'tagCloud',null);
for (var t=0; t<items.length; t++) {
cloudWrapper.appendChild(document.createTextNode(' '));
var group=Math.ceil((items[t].count-least)/groupSize)||1;
var className='tagCloudtag tagCloud'+group;
var tip=refs?this.refstip:links?this.linkstip:this.tagstip;
tip=tip.format([items[t].title,items[t].count]);
if (action=='goto') { // TAG/LINK/REFERENCES GOTO
var btn=createTiddlyLink(cloudWrapper,items[t].title,true,className);
btn.title=tip;
btn.style.fontWeight='normal';
} else if (!links&&!refs) { // TAG POPUP
var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,onClickTag,className);
btn.setAttribute('tag',items[t].title);
} else { // LINK/REFERENCES POPUP
var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,
function(ev) { var e=ev||window.event; var cmt=config.macros.cloud;
var popup = Popup.create(this);
var title = this.getAttribute('tiddler');
var count = this.getAttribute('count');
var refs = this.getAttribute('refs')=='T';
var links = this.getAttribute('links')=='T';
var label = (refs?cmt.refslabel:cmt.linkslabel).format([count]);
createTiddlyLink(popup,title,true);
createTiddlyText(popup,label);
createTiddlyElement(popup,'hr');
if (refs) {
popup.setAttribute('tiddler',title);
config.commands.references.handlePopup(popup,title);
}
if (links) {
var tiddler = store.fetchTiddler(title);
var links=config.macros.cloud.getLinks(tiddler);
for(var i=0;i<links.length;i++)
createTiddlyLink(createTiddlyElement(popup,'li'),
links[i],true);
}
Popup.show();
e.cancelBubble=true; if(e.stopPropagation) e.stopPropagation();
return false;
}, className);
btn.setAttribute('tiddler',items[t].title);
btn.setAttribute('count',items[t].count);
btn.setAttribute('refs',refs?'T':'F');
btn.setAttribute('links',links?'T':'F');
btn.title=tip;
}
}
}
};
//}}}
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.1.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.chooseTemplateForTiddler()|
|Description|use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values|
This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.''
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2008.01.22 [*.*.*] plugin size reduction - documentation moved to [[TaggedTemplateTweakInfo]]
2007.06.23 [1.1.0] re-written to use automatic 'tag prefix' search instead of hard coded check for each tag. Allows new custom tags to be used without requiring code changes to this plugin.
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.taggedTemplate= {major: 1, minor: 1, revision: 0, date: new Date(2007,6,23)};
Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
// get default template from core
var template=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);
// if the tiddler to be rendered doesn't exist yet, just return core result
var tiddler=store.getTiddler(title); if (!tiddler) return template;
// look for template whose prefix matches a tag on this tiddler
for (t=0; t<tiddler.tags.length; t++) {
var tag=tiddler.tags[t];
if (store.tiddlerExists(tag+template)) { template=tag+template; break; }
// try capitalized tag (to match WikiWord template titles)
var cap=tag.substr(0,1).toUpperCase()+tag.substr(1);
if (store.tiddlerExists(cap+template)) { template=cap+template; break; }
}
return template;
}
//}}}
/***
|Name|TaggedTemplateTweakInfo|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.5.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for TaggedTemplateTweak|
The core function, "story.chooseTemplateForTiddler(title,template)" is essentially a "pass-thru" that returns the same template it was given, and is provided by the core so that plugins can customize the template selection logic to select alternative templates, based on whatever programmatic criteria is appropriate. This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.''
!!!!!Usage
<<<
Each alternative template is associated with a specific tiddler tag value by using that tag value as a prefix added to the standard TiddlyWiki template titles, [[ViewTemplate]] and [[EditTemplate]]. For example, any tiddlers that are tagged with ''<<tag media>>'' will look for alternative templates named [[mediaViewTemplate]] and [[mediaEditTemplate]].
To use templates that have proper WikiWord tiddler titles (e.g., [[MediaViewTemplate]] and [[MediaEditTemplate]]), the plugin will also attempt to use a capitalized form of the tag value (e.g., ''Media'') as a prefix. //This capitalization is for comparison purposes only and will not alter the actual tag values that are stored in the tiddler.//
To use templates contained as //sections// within a systemTheme definition, the plugin also tries prepending the currently selected theme (specified by {{{config.options.txtTheme}}}) plus the 'section separator' (##) to the template name (e.g. ''[[SomeTheme##MediaViewTemplate]]'').
In addition to tag matching, the plugin also tries using the tiddler's //title// as a prefix (i.e., ''TiddlerNameViewTemplate'' and ''TiddlerNameEditTemplate''). This allows you to associate a custom template with a specific tiddler, without needing to add any special tag designation to that tiddler. Note that, similar to the manner in which //specificity// rules are applied to CSS, a template matching a specific ID (tiddler title) will always take precedence over a template matching a particular class name (tag value). Thus, [[SomeTitleViewTemplate]] overrides [[someTagViewTemplate]], which overrides the default [[ViewTemplate]].
Finally, if no alternative template is found at all, then the tiddler defaults to using the appropriate standard [[ViewTemplate]] or [[EditTemplate]] definition as determined by the standard TiddlyWiki core handling.
''To add your own custom templates:''
>First, decide upon a suitable tag keyword to uniquely identify your custom templates and create custom view and/or edit templates using that keyword as a prefix (e.g., "KeywordViewTemplate" and "KeywordEditTemplate"). Then, simply create a tiddler and tag it with your chosen keyword... that's it! As long as the tiddler is tagged with your keyword, it will be displayed using the corresponding alternative templates. If you remove the tag or rename/delete the alternative templates, the tiddler will revert to using the standard viewing and editing templates.
<<<
!!!!!Examples
<<<
|Sample tiddler| tag | view template | edit template |
|[[MediaSample - QuickTime]]| <<tag media>> | [[MediaViewTemplate]] | [[MediaEditTemplate]] |
|[[MediaSample - Windows]]| <<tag media>> | [[MediaViewTemplate]] | [[MediaEditTemplate]] |
|[[CDSample]]| <<tag CD>> | [[CDViewTemplate]] | [[CDEditTemplate]] |
|<<newTiddler label:"create new task..." title:SampleTask tag:task text:"Type some text and then press DONE to view the task controls">> | <<tag task>> | [[TaskViewTemplate]] | [[EditTemplate]] |
//(note: if these samples are not present in your document, please visit// http://www.TiddlyTools.com/ //to view these sample tiddlers on-line)//
<<<
!!!!!Revisions
<<<
2009.05.04 [1.5.2] check for tiddler exist *after* title-as-prefix (allows shadow tiddlers to use custom templates)
2009.01.06 [1.5.1] reversed logic so that title-as-prefix takes precedence over tag-matched prefix
2008.12.18 [1.5.0] added handling for using tiddler //title// as prefix (e.g., {{{SomeTiddlerViewTemplate}}})
2008.08.29 [1.4.1] corrected handling for tiddlers with no matching tagged template when non-default theme is in effect (e.g., use "MyTheme##ViewTemplate").
2008.05.15 [1.4.0] support use of *shadow* tagged templates (e.g., [[DiscussionViewTemplate]] created by [[DiscussionPlugin]])
2008.05.10 [1.3.0] corrected handling for determining core template when using theme with sections
2008.05.01 [1.2.5] added support for tagged templates stored as sections in a theme
2008.04.01 [1.2.0] added support for using systemTheme section-based template definitions (requested by Phil Hawksworth)
2008.01.22 [*.*.*] plugin size reduction - documentation moved to [[TaggedTemplateTweakInfo]]
2007.06.23 [1.1.0] re-written to use automatic 'tag prefix' search instead of hard coded check for each tag. Allows new custom tags to be used without requiring code changes to this plugin.
2007.06.11 [1.0.0] initial release
<<<
@@color:#800;Tiddlers tagged with TreeviewPackage (plugins, macros and tweaks)@@
<<tiddler ToggleRightSidebar with: "Sidebar »">>
{{twocolumns{
<script>
// get all tiddlers tagged with "TreeviewPackage"
var tids=store.getTaggedTiddlers("TreeviewPackage");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("TreeviewPackage")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
}}}
/***
|''Name:''|~TaggerPlugin|
|''Version:''|1.0.1 (2006-06-01)|
|''Source:''|http://tw.lewcid.org//#TaggerPlugin|
|''Author:''|SaqImtiaz|
|''Description:''|Provides a drop down listing current tiddler tags, and allowing toggling of tags.|
|''Documentation:''|[[TaggerPluginDocumentation]]|
|''Source Code:''|[[TaggerPluginSource]]|
|''~TiddlyWiki:''|Version 2.0.8 or better|
|''Requires''|[[DeprecatedFunctionsPlugin]]|
|''Stylesheet Changes''|ViewTemplate|
|See Above|<div class='toolbar'><span style="padding-right:2.45em;" macro='tagger source:TagDB exclude:excludeLists'></span></div>|
***/
//{{{
config.tagger={
defaults:{
label: 'Tags: ',
tooltip: 'Manage tiddler tags',
taglist: 'true',
excludeTags: 'excludeLists',
notags: 'tiddler has no tags',
aretags: 'current tiddler tags:',
toggletext: 'add tags:'
}
};
config.macros.tagger={};
config.macros.tagger.arrow = (document.all?"▼":"▾"); // the fat one is the only one that works in IE
config.macros.tagger.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var defaults = config.tagger.defaults;
var nAV = paramString.parseParams('tagman', null, true);
var label = ((nAV[0].label)&&(nAV[0].label[0])!='.')?nAV[0].label[0]+this.arrow: defaults.label+this.arrow;
var tooltip = ((nAV[0].tooltip)&&(nAV[0].tooltip[0])!='.')?nAV[0].tooltip[0]: defaults.tooltip;
var taglist = ((nAV[0].taglist)&&(nAV[0].taglist[0])!='.')?nAV[0].taglist[0]: defaults.taglist;
var exclude = ((nAV[0].exclude)&&(nAV[0].exclude[0])!='.')?(nAV[0].exclude[0]).readBracketedList(): defaults.excludeTags.readBracketedList();
if ((nAV[0].source)&&(nAV[0].source[0])!='.')var source = nAV[0].source[0];
if (source&&!store.getTiddler(source)) return false;
var onclick = function(e) {
if (!e) var e = window.event;
var popup = Popup.create(this);
var tagsarray = store.getTags();
var tags=new Array();
for (var i=0; i<tagsarray.length; i++){
tags.push(tagsarray[i][0]);}
if (source)
{var sourcetiddler=store.getTiddler(source);
tags=sourcetiddler.tags.sort();}
var currentTags = tiddler.tags.sort();
var createButtons=function(text,theTag,tooltipPrefix){
var sp = createTiddlyElement(createTiddlyElement(popup,"li"),"span",null,"tagger");
var theToggle = createTiddlyButton(sp,text,tooltipPrefix+" '"+theTag+"'",taggerOnToggle,"button","toggleButton");
theToggle.setAttribute("tiddler",tiddler.title);
theToggle.setAttribute("tag",theTag);
insertSpacer(sp);
if (window.createTagButton_orig_mptw)
createTagButton_orig_mptw(sp,theTag);
else
createTagButton(sp,theTag);
}
createTiddlyElement(popup,"li",null,"listTitle",(tiddler.tags.length == 0 ? defaults.notags : defaults.aretags));
for (var t=0; t<currentTags.length; t++){
createButtons("[x]",currentTags[t],"remove tag ");
}
createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
if (taglist!='false')
{ createTiddlyElement(popup,"li",null,"listTitle",defaults.toggletext);
for (var i=0; i<tags.length; i++){
if (!tiddler.tags.contains(tags[i])&&!exclude.contains(tags[i]))
{createButtons("[ ]",tags[i],"add tag ");
}
}
createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
}
var newTagButton = createTiddlyButton(createTiddlyElement(popup,"li"),("Create new tag"),null,taggerOnToggle);
newTagButton.setAttribute("tiddler",tiddler.title);
if (source) newTagButton.setAttribute("source",source);
Popup.show(popup,false);
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
};
createTiddlyButton(place,label,tooltip,onclick,"button","taggerDrpBtn");
};
window.taggerOnToggle = function(e) {
var tag = this.getAttribute("tag");
var title = this.getAttribute("tiddler");
var tiddler = store.getTiddler(title);
if (!tag)
{
var newtag=prompt("Enter new tag:","");
if (newtag!=''&&newtag!=null)
{
var tag=newtag;
if (this.getAttribute("source"))
{var sourcetiddler = store.getTiddler(this.getAttribute("source"));
sourcetiddler.tags.pushUnique(newtag);}
}
else
{return false;};
}
if (!tiddler || !tiddler.tags)
{store.saveTiddler(title,title,'',config.options.txtUserName,new Date(),tag);}
else
{if (tiddler.tags.find(tag)==null)
{tiddler.tags.push(tag)}
else if(!newtag)
{tiddler.tags.splice(tiddler.tags.find(tag),1)};
store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags);};
story.refreshTiddler(title,null,true);
if(config.options.chkAutoSave)
saveChanges();
return false;
};
setStylesheet(
".tagger a.button {font-weight: bold;display:inline; padding:0px;}\n"+
".tagger #toggleButton {padding-left:2px; padding-right:2px; margin-right:1px; font-size:110%;}\n"+
"#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+
".popup .listTitle {color:#000;}\n"+
"",
"TaggerStyles");
window.lewcidTiddlerSwapTag = function (tiddler, oldTag, newTag){
for (var i = 0; i < tiddler.tags.length; i++)
if (tiddler.tags[i] == oldTag) {
tiddler.tags[i] = newTag;
return true;}
return false;
}
window.lewcidRenameTag = function(e) {
var tag=this.getAttribute("tag");
var newtag=prompt("Rename tag '"+tag+"' to:",tag);
if ((newtag==tag)||(newtag==null)) {return false;}
if(store.tiddlerExists(newtag))
{if(confirm(config.messages.overwriteWarning.format([newtag.toString()])))
story.closeTiddler(newtag,false,false);
else
return null;}
tagged=store.getTaggedTiddlers(tag);
if (tagged.length!=0){
for (var j = 0; j < tagged.length; j++)
lewcidTiddlerSwapTag(tagged[j],tag,newtag);}
if (store.tiddlerExists(tag))
{store.saveTiddler(tag,newtag);}
if (document.getElementById("tiddler"+tag))
{var oldTagTiddler = document.getElementById(story.idPrefix + tag);
var before= story.positionTiddler(oldTagTiddler);
var place = document.getElementById(story.container);
story.closeTiddler(tag,false,false);
story.createTiddler(place,before,newtag,null);
story.saveTiddler(newtag);}
if(config.options.chkAutoSave)
saveChanges();
return false;
}
window.onClickTag=function(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var nested = (!isNested(theTarget));
if ((Popup.stack.length > 1)&&(nested==true)) {Popup.removeFrom(1);}
else if(Popup.stack.length > 0 && nested==false) {Popup.removeFrom(0);};
var theId = (nested==false)? "popup" : "nestedtagger";
var popup = createTiddlyElement(document.body,"ol",theId,"popup",null);
Popup.stack.push({root: this, popup: popup});
var tag = this.getAttribute("tag");
var title = this.getAttribute("tiddler");
if(popup && tag)
{
var tagged = store.getTaggedTiddlers(tag);
var titles = [];
var li,r;
for(r=0;r<tagged.length;r++)
if(tagged[r].title != title)
titles.push(tagged[r].title);
var lingo = config.views.wikified.tag;
if(titles.length > 0)
{
var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
openAll.setAttribute("tag",tag);
createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
for(r=0; r<titles.length; r++)
{
createTiddlyLink(createTiddlyElement(popup,"li"),titles[r],true);
}
}
else
createTiddlyText(createTiddlyElement(popup,"li",null,"disabled"),lingo.popupNone.format([tag]));
createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
var h = createTiddlyLink(createTiddlyElement(popup,"li"),tag,false);
createTiddlyText(h,lingo.openTag.format([tag]));
createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
var renameTagButton = createTiddlyButton(createTiddlyElement(popup,"li"),("Rename tag '"+tag+"'"),null,lewcidRenameTag);
renameTagButton.setAttribute("tag",tag)
}
Popup.show(popup,false);
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
}
if (!window.isNested)
window.isNested = function(e) {
while (e != null) {
var contentWrapper = document.getElementById("contentWrapper");
if (contentWrapper == e) return true;
e = e.parentNode;
}
return false;
};
config.shadowTiddlers.TaggerPluginDocumentation="The documentation is available [[here.|http://tw.lewcid.org/#TaggerPluginDocumentation]]";
config.shadowTiddlers.TaggerPluginSource="The uncompressed source code is available [[here.|http://tw.lewcid.org/#TaggerPluginSource]]";
//}}}
/***
|Name:|TagglyTaggingPlugin|
|Description:|tagglyTagging macro is a replacement for the builtin tagging macro in your ViewTemplate|
|Version:|3.3.1 ($Rev: 6100 $)|
|Date:|$Date: 2008-07-27 01:42:07 +1000 (Sun, 27 Jul 2008) $|
|Source:|http://mptw.tiddlyspot.com/#TagglyTaggingPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
See http://mptw.tiddlyspot.com/#TagglyTagging
***/
//{{{
merge(String.prototype,{
parseTagExpr: function(debug) {
if (this.trim() == "")
return "(true)";
var anyLogicOp = /(!|&&|\|\||\(|\))/g;
var singleLogicOp = /^(!|&&|\|\||\(|\))$/;
var spaced = this.
// because square brackets in templates are no good
// this means you can use [(With Spaces)] instead of [[With Spaces]]
replace(/\[\(/g," [[").
replace(/\)\]/g,"]] ").
// space things out so we can use readBracketedList. tricky eh?
replace(anyLogicOp," $1 ");
var expr = "";
var tokens = spaced.readBracketedList(false); // false means don't uniq the list. nice one JR!
for (var i=0;i<tokens.length;i++)
if (tokens[i].match(singleLogicOp))
expr += tokens[i];
else
expr += "tiddler.tags.contains('%0')".format([tokens[i].replace(/'/,"\\'")]); // fix single quote bug. still have round bracket bug i think
if (debug)
alert(expr);
return '('+expr+')';
}
});
merge(TiddlyWiki.prototype,{
getTiddlersByTagExpr: function(tagExpr,sortField) {
var result = [];
var expr = tagExpr.parseTagExpr();
store.forEachTiddler(function(title,tiddler) {
if (eval(expr))
result.push(tiddler);
});
if(!sortField)
sortField = "title";
result.sort(function(a,b) {return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);});
return result;
}
});
config.taggly = {
// for translations
lingo: {
labels: {
asc: "\u2191", // down arrow
desc: "\u2193", // up arrow
title: "titel",
modified: "ændret",
created: "lavet",
show: "+",
hide: "-",
normal: "normal",
group: "gruppe",
commas: "komma",
sitemap: "sitemap",
numCols: "cols\u00b1", // plus minus sign
label: "Tagget '%0':",
exprLabel: "Matcher tag udtryk '%0':",
excerpts: "uddrag",
descr: "beskriv.",
slices: "klip",
contents: "indhold",
sliders: "slidere",
noexcerpts: "kun titel",
noneFound: "(ingen)"
},
tooltips: {
title: "Klik for at sortere efter titel",
modified: "Klik for at sortere efter ændret dato",
created: "Klik for at sortere efter lavet dato",
show: "Klik for at vise tagget liste",
hide: "Klik for at skjule tagget liste",
normal: "Klik for at vise en normal ikke grupperet listet",
group: "Klik forat vise en liste grupperet efter tags",
sitemap: "Klik for at vise en liste i sitemap stil",
commas: "Klik for at vise en kommasepareret liste",
numCols: "Klik for at ændre på antallet af kolonner",
excerpts: "Klik for at vise uddrag",
descr: "Klik for at vise en beskrevet liste",
slices: "Klik for at vise alle klip",
contents: "Klik for at vise alt indhold",
sliders: "Klik for at vise tiddlerindholdet i en slider",
noexcerpts: "Klik for kun at vise hele titlen"
},
tooDeepMessage: "* //sitemappen er for dyb...//"
},
config: {
showTaggingCounts: true,
listOpts: {
// the first one will be the default
sortBy: ["title","modified","created"],
sortOrder: ["asc","desc"],
hideState: ["show","hide"],
listMode: ["normal","group","sitemap","commas"],
numCols: ["1","2","3","4","5","6"],
excerpts: ["noexcerpts","excerpts","descr","slices","contents","sliders"]
},
valuePrefix: "taggly.",
excludeTags: ["excludeLists","excludeTagging"],
excerptSize: 50,
excerptMarker: "/%"+"%/",
siteMapDepthLimit: 25
},
getTagglyOpt: function(title,opt) {
var val = store.getValue(title,this.config.valuePrefix+opt);
return val ? val : this.config.listOpts[opt][0];
},
setTagglyOpt: function(title,opt,value) {
if (!store.tiddlerExists(title))
// create it silently
store.saveTiddler(title,title,config.views.editor.defaultText.format([title]),config.options.txtUserName,new Date(),"");
// if value is default then remove it to save space
return store.setValue(title,
this.config.valuePrefix+opt,
value == this.config.listOpts[opt][0] ? null : value);
},
getNextValue: function(title,opt) {
var current = this.getTagglyOpt(title,opt);
var pos = this.config.listOpts[opt].indexOf(current);
// a little usability enhancement. actually it doesn't work right for grouped or sitemap
var limit = (opt == "numCols" ? store.getTiddlersByTagExpr(title).length : this.config.listOpts[opt].length);
var newPos = (pos + 1) % limit;
return this.config.listOpts[opt][newPos];
},
toggleTagglyOpt: function(title,opt) {
var newVal = this.getNextValue(title,opt);
this.setTagglyOpt(title,opt,newVal);
},
createListControl: function(place,title,type) {
var lingo = config.taggly.lingo;
var label;
var tooltip;
var onclick;
if ((type == "title" || type == "modified" || type == "created")) {
// "special" controls. a little tricky. derived from sortOrder and sortBy
label = lingo.labels[type];
tooltip = lingo.tooltips[type];
if (this.getTagglyOpt(title,"sortBy") == type) {
label += lingo.labels[this.getTagglyOpt(title,"sortOrder")];
onclick = function() {
config.taggly.toggleTagglyOpt(title,"sortOrder");
return false;
}
}
else {
onclick = function() {
config.taggly.setTagglyOpt(title,"sortBy",type);
config.taggly.setTagglyOpt(title,"sortOrder",config.taggly.config.listOpts.sortOrder[0]);
return false;
}
}
}
else {
// "regular" controls, nice and simple
label = lingo.labels[type == "numCols" ? type : this.getNextValue(title,type)];
tooltip = lingo.tooltips[type == "numCols" ? type : this.getNextValue(title,type)];
onclick = function() {
config.taggly.toggleTagglyOpt(title,type);
return false;
}
}
// hide button because commas don't have columns
if (!(this.getTagglyOpt(title,"listMode") == "commas" && type == "numCols"))
createTiddlyButton(place,label,tooltip,onclick,type == "hideState" ? "hidebutton" : "button");
},
makeColumns: function(orig,numCols) {
var listSize = orig.length;
var colSize = listSize/numCols;
var remainder = listSize % numCols;
var upperColsize = colSize;
var lowerColsize = colSize;
if (colSize != Math.floor(colSize)) {
// it's not an exact fit so..
upperColsize = Math.floor(colSize) + 1;
lowerColsize = Math.floor(colSize);
}
var output = [];
var c = 0;
for (var j=0;j<numCols;j++) {
var singleCol = [];
var thisSize = j < remainder ? upperColsize : lowerColsize;
for (var i=0;i<thisSize;i++)
singleCol.push(orig[c++]);
output.push(singleCol);
}
return output;
},
drawTable: function(place,columns,theClass) {
var newTable = createTiddlyElement(place,"table",null,theClass);
var newTbody = createTiddlyElement(newTable,"tbody");
var newTr = createTiddlyElement(newTbody,"tr");
for (var j=0;j<columns.length;j++) {
var colOutput = "";
for (var i=0;i<columns[j].length;i++)
colOutput += columns[j][i];
var newTd = createTiddlyElement(newTr,"td",null,"tagglyTagging"); // todo should not need this class
wikify(colOutput,newTd);
}
return newTable;
},
createTagglyList: function(place,title,isTagExpr) {
switch(this.getTagglyOpt(title,"listMode")) {
case "group": return this.createTagglyListGrouped(place,title,isTagExpr); break;
case "normal": return this.createTagglyListNormal(place,title,false,isTagExpr); break;
case "commas": return this.createTagglyListNormal(place,title,true,isTagExpr); break;
case "sitemap":return this.createTagglyListSiteMap(place,title,isTagExpr); break;
}
},
getTaggingCount: function(title,isTagExpr) {
// thanks to Doug Edmunds
if (this.config.showTaggingCounts) {
var tagCount = config.taggly.getTiddlers(title,'title',isTagExpr).length;
if (tagCount > 0)
return " ("+tagCount+")";
}
return "";
},
getTiddlers: function(titleOrExpr,sortBy,isTagExpr) {
return isTagExpr ? store.getTiddlersByTagExpr(titleOrExpr,sortBy) : store.getTaggedTiddlers(titleOrExpr,sortBy);
},
getExcerpt: function(inTiddlerTitle,title,indent) {
if (!indent)
indent = 1;
var displayMode = this.getTagglyOpt(inTiddlerTitle,"excerpts");
var t = store.getTiddler(title);
if (t && displayMode == "excerpts") {
var text = t.text.replace(/\n/," ");
var marker = text.indexOf(this.config.excerptMarker);
if (marker != -1) {
return " {{excerpt{<nowiki>" + text.substr(0,marker) + "</nowiki>}}}";
}
else if (text.length < this.config.excerptSize) {
return " {{excerpt{<nowiki>" + t.text + "</nowiki>}}}";
}
else {
return " {{excerpt{<nowiki>" + t.text.substr(0,this.config.excerptSize) + "..." + "</nowiki>}}}";
}
}
else if (t && displayMode == "contents") {
return "\n{{contents indent"+indent+"{\n" + t.text + "\n}}}";
}
else if (t && displayMode == "sliders") {
return "<slider slide>\n{{contents{\n" + t.text + "\n}}}\n</slider>";
}
else if (t && displayMode == "descr") {
var descr = store.getTiddlerSlice(title,'Description');
return descr ? " {{excerpt{" + descr + "}}}" : "";
}
else if (t && displayMode == "slices") {
var result = "";
var slices = store.calcAllSlices(title);
for (var s in slices)
result += "|%0|<nowiki>%1</nowiki>|\n".format([s,slices[s]]);
return result ? "\n{{excerpt excerptIndent{\n" + result + "}}}" : "";
}
return "";
},
notHidden: function(t,inTiddler) {
if (typeof t == "string")
t = store.getTiddler(t);
return (!t || !t.tags.containsAny(this.config.excludeTags) ||
(inTiddler && this.config.excludeTags.contains(inTiddler)));
},
// this is for normal and commas mode
createTagglyListNormal: function(place,title,useCommas,isTagExpr) {
var list = config.taggly.getTiddlers(title,this.getTagglyOpt(title,"sortBy"),isTagExpr);
if (this.getTagglyOpt(title,"sortOrder") == "desc")
list = list.reverse();
var output = [];
var first = true;
for (var i=0;i<list.length;i++) {
if (this.notHidden(list[i],title)) {
var countString = this.getTaggingCount(list[i].title);
var excerpt = this.getExcerpt(title,list[i].title);
if (useCommas)
output.push((first ? "" : ", ") + "[[" + list[i].title + "]]" + countString + excerpt);
else
output.push("*[[" + list[i].title + "]]" + countString + excerpt + "\n");
first = false;
}
}
return this.drawTable(place,
this.makeColumns(output,useCommas ? 1 : parseInt(this.getTagglyOpt(title,"numCols"))),
useCommas ? "commas" : "normal");
},
// this is for the "grouped" mode
createTagglyListGrouped: function(place,title,isTagExpr) {
var sortBy = this.getTagglyOpt(title,"sortBy");
var sortOrder = this.getTagglyOpt(title,"sortOrder");
var list = config.taggly.getTiddlers(title,sortBy,isTagExpr);
if (sortOrder == "desc")
list = list.reverse();
var leftOvers = []
for (var i=0;i<list.length;i++)
leftOvers.push(list[i].title);
var allTagsHolder = {};
for (var i=0;i<list.length;i++) {
for (var j=0;j<list[i].tags.length;j++) {
if (list[i].tags[j] != title) { // not this tiddler
if (this.notHidden(list[i].tags[j],title)) {
if (!allTagsHolder[list[i].tags[j]])
allTagsHolder[list[i].tags[j]] = "";
if (this.notHidden(list[i],title)) {
allTagsHolder[list[i].tags[j]] += "**[["+list[i].title+"]]"
+ this.getTaggingCount(list[i].title) + this.getExcerpt(title,list[i].title) + "\n";
leftOvers.setItem(list[i].title,-1); // remove from leftovers. at the end it will contain the leftovers
}
}
}
}
}
var allTags = [];
for (var t in allTagsHolder)
allTags.push(t);
var sortHelper = function(a,b) {
if (a == b) return 0;
if (a < b) return -1;
return 1;
};
allTags.sort(function(a,b) {
var tidA = store.getTiddler(a);
var tidB = store.getTiddler(b);
if (sortBy == "title") return sortHelper(a,b);
else if (!tidA && !tidB) return 0;
else if (!tidA) return -1;
else if (!tidB) return +1;
else return sortHelper(tidA[sortBy],tidB[sortBy]);
});
var leftOverOutput = "";
for (var i=0;i<leftOvers.length;i++)
if (this.notHidden(leftOvers[i],title))
leftOverOutput += "*[["+leftOvers[i]+"]]" + this.getTaggingCount(leftOvers[i]) + this.getExcerpt(title,leftOvers[i]) + "\n";
var output = [];
if (sortOrder == "desc")
allTags.reverse();
else if (leftOverOutput != "")
// leftovers first...
output.push(leftOverOutput);
for (var i=0;i<allTags.length;i++)
if (allTagsHolder[allTags[i]] != "")
output.push("*[["+allTags[i]+"]]" + this.getTaggingCount(allTags[i]) + this.getExcerpt(title,allTags[i]) + "\n" + allTagsHolder[allTags[i]]);
if (sortOrder == "desc" && leftOverOutput != "")
// leftovers last...
output.push(leftOverOutput);
return this.drawTable(place,
this.makeColumns(output,parseInt(this.getTagglyOpt(title,"numCols"))),
"grouped");
},
// used to build site map
treeTraverse: function(title,depth,sortBy,sortOrder,isTagExpr) {
var list = config.taggly.getTiddlers(title,sortBy,isTagExpr);
if (sortOrder == "desc")
list.reverse();
var indent = "";
for (var j=0;j<depth;j++)
indent += "*"
var childOutput = "";
if (depth > this.config.siteMapDepthLimit)
childOutput += indent + this.lingo.tooDeepMessage;
else
for (var i=0;i<list.length;i++)
if (list[i].title != title)
if (this.notHidden(list[i].title,this.config.inTiddler))
childOutput += this.treeTraverse(list[i].title,depth+1,sortBy,sortOrder,false);
if (depth == 0)
return childOutput;
else
return indent + "[["+title+"]]" + this.getTaggingCount(title) + this.getExcerpt(this.config.inTiddler,title,depth) + "\n" + childOutput;
},
// this if for the site map mode
createTagglyListSiteMap: function(place,title,isTagExpr) {
this.config.inTiddler = title; // nasty. should pass it in to traverse probably
var output = this.treeTraverse(title,0,this.getTagglyOpt(title,"sortBy"),this.getTagglyOpt(title,"sortOrder"),isTagExpr);
return this.drawTable(place,
this.makeColumns(output.split(/(?=^\*\[)/m),parseInt(this.getTagglyOpt(title,"numCols"))), // regexp magic
"sitemap"
);
},
macros: {
tagglyTagging: {
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
var parsedParams = paramString.parseParams("tag",null,true);
var refreshContainer = createTiddlyElement(place,"div");
// do some refresh magic to make it keep the list fresh - thanks Saq
refreshContainer.setAttribute("refresh","macro");
refreshContainer.setAttribute("macroName",macroName);
var tag = getParam(parsedParams,"tag");
var expr = getParam(parsedParams,"expr");
if (expr) {
refreshContainer.setAttribute("isTagExpr","true");
refreshContainer.setAttribute("title",expr);
refreshContainer.setAttribute("showEmpty","true");
}
else {
refreshContainer.setAttribute("isTagExpr","false");
if (tag) {
refreshContainer.setAttribute("title",tag);
refreshContainer.setAttribute("showEmpty","true");
}
else {
refreshContainer.setAttribute("title",tiddler.title);
refreshContainer.setAttribute("showEmpty","false");
}
}
this.refresh(refreshContainer);
},
refresh: function(place) {
var title = place.getAttribute("title");
var isTagExpr = place.getAttribute("isTagExpr") == "true";
var showEmpty = place.getAttribute("showEmpty") == "true";
removeChildren(place);
addClass(place,"tagglyTagging");
var countFound = config.taggly.getTiddlers(title,'title',isTagExpr).length
if (countFound > 0 || showEmpty) {
var lingo = config.taggly.lingo;
config.taggly.createListControl(place,title,"hideState");
if (config.taggly.getTagglyOpt(title,"hideState") == "show") {
createTiddlyElement(place,"span",null,"tagglyLabel",
isTagExpr ? lingo.labels.exprLabel.format([title]) : lingo.labels.label.format([title]));
config.taggly.createListControl(place,title,"title");
config.taggly.createListControl(place,title,"modified");
config.taggly.createListControl(place,title,"created");
config.taggly.createListControl(place,title,"listMode");
config.taggly.createListControl(place,title,"excerpts");
config.taggly.createListControl(place,title,"numCols");
config.taggly.createTagglyList(place,title,isTagExpr);
if (countFound == 0 && showEmpty)
createTiddlyElement(place,"div",null,"tagglyNoneFound",lingo.labels.noneFound);
}
}
}
}
},
// todo fix these up a bit
styles: [
"/*{{{*/",
"/* created by TagglyTaggingPlugin */",
".tagglyTagging { padding-top:0.5em; }",
".tagglyTagging li.listTitle { display:none; }",
".tagglyTagging ul {",
" margin-top:0px; padding-top:0.5em; padding-left:2em;",
" margin-bottom:0px; padding-bottom:0px;",
"}",
".tagglyTagging { vertical-align: top; margin:0px; padding:0px; }",
".tagglyTagging table { margin:0px; padding:0px; }",
".tagglyTagging .button { visibility:hidden; margin-left:3px; margin-right:3px; }",
".tagglyTagging .button, .tagglyTagging .hidebutton {",
" color:[[ColorPalette::TertiaryLight]]; font-size:90%;",
" border:0px; padding-left:0.3em;padding-right:0.3em;",
"}",
".tagglyTagging .button:hover, .hidebutton:hover, ",
".tagglyTagging .button:active, .hidebutton:active {",
" border:0px; background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]];",
"}",
".selected .tagglyTagging .button { visibility:visible; }",
".tagglyTagging .hidebutton { color:[[ColorPalette::Background]]; }",
".selected .tagglyTagging .hidebutton { color:[[ColorPalette::TertiaryLight]] }",
".tagglyLabel { color:[[ColorPalette::TertiaryMid]]; font-size:90%; }",
".tagglyTagging ul {padding-top:0px; padding-bottom:0.5em; margin-left:1em; }",
".tagglyTagging ul ul {list-style-type:disc; margin-left:-1em;}",
".tagglyTagging ul ul li {margin-left:0.5em; }",
".editLabel { font-size:90%; padding-top:0.5em; }",
".tagglyTagging .commas { padding-left:1.8em; }",
"/* not technically tagglytagging but will put them here anyway */",
".tagglyTagged li.listTitle { display:none; }",
".tagglyTagged li { display: inline; font-size:90%; }",
".tagglyTagged ul { margin:0px; padding:0px; }",
".excerpt { color:[[ColorPalette::TertiaryDark]]; }",
".excerptIndent { margin-left:4em; }",
"div.tagglyTagging table,",
"div.tagglyTagging table tr,",
"td.tagglyTagging",
" {border-style:none!important; }",
".tagglyTagging .contents { border-bottom:2px solid [[ColorPalette::TertiaryPale]]; padding:0 1em 1em 0.5em;",
" margin-bottom:0.5em; }",
".tagglyTagging .indent1 { margin-left:3em; }",
".tagglyTagging .indent2 { margin-left:4em; }",
".tagglyTagging .indent3 { margin-left:5em; }",
".tagglyTagging .indent4 { margin-left:6em; }",
".tagglyTagging .indent5 { margin-left:7em; }",
".tagglyTagging .indent6 { margin-left:8em; }",
".tagglyTagging .indent7 { margin-left:9em; }",
".tagglyTagging .indent8 { margin-left:10em; }",
".tagglyTagging .indent9 { margin-left:11em; }",
".tagglyTagging .indent10 { margin-left:12em; }",
".tagglyNoneFound { margin-left:2em; color:[[ColorPalette::TertiaryMid]]; font-size:90%; font-style:italic; }",
"/*}}}*/",
""].join("\n"),
init: function() {
merge(config.macros,this.macros);
config.shadowTiddlers["TagglyTaggingStyles"] = this.styles;
store.addNotification("TagglyTaggingStyles",refreshStyles);
}
};
config.taggly.init();
//}}}
/***
InlineSlidersPlugin
By Saq Imtiaz
http://tw.lewcid.org/sandbox/#InlineSlidersPlugin
// syntax adjusted to not clash with NestedSlidersPlugin
// added + syntax to start open instead of closed
***/
//{{{
config.formatters.unshift( {
name: "inlinesliders",
// match: "\\+\\+\\+\\+|\\<slider",
match: "\\<slider",
// lookaheadRegExp: /(?:\+\+\+\+|<slider) (.*?)(?:>?)\n((?:.|\n)*?)\n(?:====|<\/slider>)/mg,
lookaheadRegExp: /(?:<slider)(\+?) (.*?)(?:>)\n((?:.|\n)*?)\n(?:<\/slider>)/mg,
handler: function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart ) {
var btn = createTiddlyButton(w.output,lookaheadMatch[2] + " "+"\u00BB",lookaheadMatch[2],this.onClickSlider,"button sliderButton");
var panel = createTiddlyElement(w.output,"div",null,"sliderPanel");
panel.style.display = (lookaheadMatch[1] == '+' ? "block" : "none");
wikify(lookaheadMatch[3],panel);
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
},
onClickSlider : function(e) {
if(!e) var e = window.event;
var n = this.nextSibling;
n.style.display = (n.style.display=="none") ? "block" : "none";
return false;
}
});
//}}}
Det er et privilegie at kunne tilbyde denne ressource gratis. Dette er muligt pga. forskellige menneskers indsats:
Tak til..
*Jeremy Ruston, [[TiddlyWikis|http://tiddlywiki.com]] ophavsmand. ^^ ~TiddlyWiki <<version>> © 2008 [[UnaMesa|http://www.unamesa.org/]]^^
*Dem der har lavet de forskellige plugins som bliver brugt i denne version af ~TiddlyWiki. Brug den følgende knap for at se en liste over de plugins der bliver brugt her. Hvert plugin indeholder information om dem der har lavet det. <<tag systemConfig>>
*Morris Gray, som har lavet [[TwT-notes|http://efterskolelister.tiddlyspot.com/download]].
-----
~~[[TiddlyWiki|http://tiddlywiki.com]] is published under a BSD licence, and is owned by the not-for-profit UnaMesa Foundation.~~
Red:
[[Måns Mårtensson|Kontakt Måns]] har oversat, tilføjet plugins og lavet mange modifikationer til den oprindelige [[TwT-Notes|http://twt-treeview.tiddlyspot.com/]] og valgt at kalde den [[EfterSkole Noter|http://efterskolelister.tiddlyspot.com]]. [[Klik her for at hente en udgave til dig selv|http://esl0809.tiddlyspot.com/download]]
Måns Mårtensson
25344884
Petra Shulz
Brynjólfur Þorvarðarson
Jacob Krüger Andersen
Betina Skovbo Korsbæk
Dan Bojer Olesen
Else Thorsen Jensen
Henning Christensen
Henrik Meldgaard
Jesper Dalhoff
Jakob Mols Græsborg
Jørn Knudsen
Lis Madsen
Line Hargreaves
Peter Andersen
Svend Brøndum
Sara Mols Græsborg
Thomas Nederby
Type the text for 'New Tiddler'
/***
|!''Name:''|!''TemplatedTagTools''|
|''Description:''|this plugin replace the content of the tag popup with the one from TagToolTemplate (a new shadowTiddler).<<br>>It allows for quick and easy modification of this popup content (including some [[batchTagTools]] macros for example)|
|''Version:''|0.1.0|
|''Date:''|17/01/2007|
|''Source:''|http://yann.perrin.googlepages.com/twkd.html#TemplatedTagTools|
|''Author:''|[[Yann Perrin|YannPerrin]]|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.x|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
***/
//{{{
function onClickTag(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var popup = Popup.create(this);
var tag = this.getAttribute("tag");
var title = this.getAttribute("tiddler");
if(popup && tag) {
wikify('<<tiddler TagToolTemplate with:"'+tag+'">>',popup);
}
Popup.show(popup,false);
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
}
//}}}
//{{{
config.macros.openAll = {};
config.macros.openAll.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var lingo = config.views.wikified.tag;
var openAll = createTiddlyButton(place,lingo.openAllText.format(params),lingo.openAllTooltip,onClickTagOpenAll);
openAll.setAttribute("tag",params[0]);
}
//}}}
////definition de TagToolTemplate
//{{{
config.shadowTiddlers.TagToolTemplate = "[[Open tag '$1'|$1]]\n<<openAll $1>>\n<<tagging $1>><<newTiddler label:\"Ny $1 Tiddler\" tag:\"$1\">>";
//}}}
Det er kun førstelinier som kommer til at stå i lærerens tabel - så alt
hvad du skriver på de kommende linier skal læses fra fanebladet Meddelelser
eller [[her|TestElev]]
/***
|Name|TextAreaPlugin|
|Source|http://www.TiddlyTools.com/#TextAreaPlugin|
|Documentation|http://www.TiddlyTools.com/#TextAreaPluginInfo|
|Version|2.2.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.focusTiddler|
|Options|##Configuration|
|Description|Adds Find/Again keyboard search, autosize, and 'stretch bar' resize for textarea controls|
!!!!!Documentation
>see [[TextAreaPluginInfo]]
!!!!!Configuration
<<<
<<option chkTextAreaExtensions>> use control-f (find), control-g (find again) inside text area
<<option chkDisableAutoSelect>> place cursor at start of textarea instead of pre-selecting content
<<option chkResizeEditor>> modify shadow EditTemplate to add resizeable text area (and autosize command)
<<<
!!!!!Revisions
<<<
2009.04.08 [2.2.1] added autosizeEditor macro to enable automatic autosizing without using toolbar command
2009.04.06 [2.2.0] added resizeListbox macro definition and adjusted dragbar width calculation.
|please see [[TextAreaPluginInfo]] for additional revision details|
2006.01.22 [1.0.0] Moved from temporary "System Tweaks" tiddler into 'real' TextAreaPlugin tiddler.
<<<
!!!!!Code
***/
//{{{
version.extensions.TextAreaPlugin= {major: 2, minor: 2, revision: 1, date: new Date(2009,4,8)};
if (config.options.chkTextAreaExtensions===undefined) config.options.chkTextAreaExtensions=true;
if (config.options.chkDisableAutoSelect===undefined) config.options.chkDisableAutoSelect=true;
if (config.options.chkResizeEditor===undefined) config.options.chkResizeEditor=true;
// automatically tweak shadow EditTemplate to add "autosizeEditor" toolbar command
if (config.options.chkResizeEditor)
config.shadowTiddlers.EditTemplate=config.shadowTiddlers.EditTemplate.replace(/deleteTiddler/,"deleteTiddler autosizeEditor");
// automatically tweak shadow EditTemplate to add "resizeEditor" macro
if (config.options.chkResizeEditor)
config.shadowTiddlers.EditTemplate+="<span macro='resizeEditor'></span>";
// Put focus in a specified tiddler field
Story.prototype.TextAreaExtensions_focusTiddler=Story.prototype.focusTiddler;
Story.prototype.focusTiddler = function(title,field)
{
this.TextAreaExtensions_focusTiddler.apply(this,arguments); // first call core
var e = this.getTiddlerField(title,field);
if (e && config.options.chkDisableAutoSelect) {
if (e.setSelectionRange) // FF
e.setSelectionRange(0,0);
else if (e.createTextRange) // IE
{ var r=e.createTextRange(); r.collapse(true); r.select(); }
}
if (e && config.options.chkTextAreaExtensions) addKeyDownHandlers(e);
}
//}}}
//{{{
function addKeyDownHandlers(e)
{
// exit if not textarea or element doesn't allow selections
if (e.tagName.toLowerCase()!="textarea"||!e.setSelectionRange||e.initialized) return;
// utility function: exits keydown handler and prevents browser from processing the keystroke
var processed=function(ev) {
ev.cancelBubble=true; // IE4+
try{event.keyCode=0;}catch(e){}; // IE5
if (window.event) ev.returnValue=false; // IE6
if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
if (ev.stopPropagation) ev.stopPropagation(); // all
return false;
}
// capture keydown in edit field
e.saved_onkeydown=e.onkeydown; // save current keydown handler (if any)
e.onkeydown=function(ev) { if (!ev) var ev=window.event;
var key=ev.keyCode;
if (!key) {
var char=event.which?event.which:event.charCode;
if (char==102) key=70;
if (char==103) key=71;
}
// process CTRL-F (find matching text) or CTRL-G (find next match)
if (ev.ctrlKey && (key==70||key==71)) {
// prompt for text to find
var defFind=e.findText?e.findText:e.value.substring(e.selectionStart,e.selectionEnd);
if (key==70||!e.findText||!e.findText.length) // ctrl-f or no saved search text
{ var f=prompt("find:", defFind); e.focus(); if (f) e.findText=f; }
if (!e.findText||!e.findText.length) return processed(ev); // if no search text, exit
// do case-insensitive match with 'wraparound'... if not found, alert and exit
var newstart=e.value.toLowerCase().indexOf(e.findText.toLowerCase(),e.selectionStart+1);
if (newstart==-1) newstart=e.value.toLowerCase().indexOf(e.findText.toLowerCase());
if (newstart==-1) { alert("'"+e.findText+"' not found"); e.focus(); return processed(ev); }
// set new selection, scroll it into view, and report line position in status bar
e.setSelectionRange(newstart,newstart+e.findText.length);
var linecount=e.value.split('\n').length;
var thisline=e.value.substr(0,e.selectionStart).split('\n').length;
e.scrollTop=Math.floor((thisline-1-e.rows/2)*e.scrollHeight/linecount);
window.status="line: "+thisline+"/"+linecount;
return processed(ev);
}
if (e.saved_onkeydown) // call previous keydown handler (if any)
e.saved_onkeydown(ev);
}
e.initialized=true;
}
//}}}
// // 'autosize' toolbar command
//{{{
config.commands.autosizeEditor = {
text: 'autosize',
tooltip: 'automatically adjust the editor height to fit the contents',
text_alt: '\u221Aautosize',
hideReadOnly: false,
handler: function(event,src,title) {
var here=story.findContainingTiddler(src); if (!here) return;
var ta=here.getElementsByTagName('textarea'); if (!ta) return;
for (i=0;i<ta.length;i++) {
// only autosize textareas actually used to edit tiddler fields
if (ta[i].getAttribute("edit")==undefined) continue;
ta[i].button=src;
if (!ta[i].maxed)
config.commands.autosizeEditor.on(ta[i]);
else
config.commands.autosizeEditor.off(ta[i],true);
}
return false;
},
on: function(e) {
if (e.maxed) return; // already autosizing!
if (e.savedheight==undefined)
e.savedheight=e.style.height;
if (e.savedkeyup==undefined) {
e.savedkeyup=e.onkeyup;
e.onkeyup=function(ev) {
if (!ev) var ev=window.event; var e=resolveTarget(ev);
e.style.height=e.scrollHeight+'px';
if (e.savedkeyup) e.savedkeyup();
}
}
// IE reports error: "not implemented" for onkeypress
if (!config.browser.isIE && e.savedkeypress==undefined) {
e.savedkeypress=e.onkeypress;
e.onkeypress=function(ev) {
if (!ev) var ev=window.event; var e=resolveTarget(ev);
if (ev.keyCode==33) { // PGUP
if (window.scrollByPages) window.scrollByPages(-1);
return false;
}
if (ev.keyCode==34) { // PGDN
if (window.scrollByPages) window.scrollByPages(1);
return false;
}
if (e.savedkeypress) e.savedkeypress();
}
}
e.style.height=e.scrollHeight+'px';
if (e.button) e.button.innerHTML=config.commands.autosizeEditor.text_alt;
e.maxed=true;
},
off: function(e,resetHeight) {
if (resetHeight) e.style.height=e.savedheight;
e.onkeyup=e.savedkeyup;
// IE reports error: "not implemented" for onkeypress
if (!config.browser.isIE) e.onkeypress=e.savedkeypress;
if (e.button) e.button.innerHTML=config.commands.autosizeEditor.text;
e.maxed=false;
}
};
config.macros.autosizeEditor={
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var here=story.findContainingTiddler(place); if (!here) return;
var ta=here.getElementsByTagName('textarea'); if (!ta) return;
for (i=0;i<ta.length;i++) {
// only autosize textareas actually used to edit tiddler fields
if (ta[i].getAttribute("edit")==undefined) continue;
config.commands.autosizeEditor.on(ta[i]);
}
return false;
}
}
//}}}
// // grab-and-stretch handle
//{{{
config.macros.resizeEditor = { // add stretch bar to editor textarea
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var here=story.findContainingTiddler(place); if (!here) return;
var ta=here.getElementsByTagName('textarea');
if (ta) for (i=0;i<ta.length;i++) {
// only resize tiddler editor textareas
if (ta[i].getAttribute("edit")==undefined) continue;
new window.TextAreaResizer(ta[i]);
}
}
}
config.macros.resizeTiddler = { // add stretch bar to tiddler viewer element
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var here=story.findContainingTiddler(place); if (!here) return;
var elems=here.getElementsByTagName('div');
if (elems) for (i=0;i<elems.length;i++) if (hasClass(elems[i],'viewer')) break;
if (i<elems.length) new window.TextAreaResizer(elems[i]);
}
}
config.macros.resizeFrame = { // add stretch bar to iframes
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var here=story.findContainingTiddler(place); if (!here) return;
var fr=here.getElementsByTagName('iframe');
if (fr) for (i=0;i<fr.length;i++) new window.TextAreaResizer(fr[i]);
}
}
config.macros.resizeListbox = { // add stretch bar to listbox controls
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var here=story.findContainingTiddler(place); if (!here) here=place;
var fr=here.getElementsByTagName('select');
if (fr) for (i=0;i<fr.length;i++) new window.TextAreaResizer(fr[i]);
}
}
// TextAreaResizer script by Jason Johnston (jj@lojjic.net)
// Created August 2003. Use freely, but give me credit.
// adds a handle below textareas that the user can drag with the mouse to resize the textarea.
// MODIFIED by ELS for cross-browser (IE) compatibility, including:
window.TextAreaResizer = function(elt) {
this.element = elt;
this.create();
}
window.TextAreaResizer.prototype = {
create : function() {
var elt = this.element;
var thisRef = this;
var h = this.handle = document.createElement("div");
h.style.height = "2px"; // was 4px... looked too fat!
h.style.overflow = "hidden"; // ELS: force IE to trim height to < 1em
var adjust=elt.nodeName=='textarea'?4:0; // 4 pixels for textarea border edge
h.style.width=(elt.offsetWidth-adjust)+"px";
// h.style.width="auto";
h.style.backgroundColor = "#999"; // ELS: standard mid-tone (dark) gray
h.style.cursor = "s-resize";
h.title = "Drag to resize text box";
h.onmousedown=function(evt){thisRef.dragStart(evt)};
elt.parentNode.insertBefore(h, elt.nextSibling);
},
dragStart : function(evt) {
if (!evt) var evt=window.event;
this.dragStop(evt); // ELS: stop any current drag processing first
var thisRef = this;
this.dragStartY = evt.clientY;
this.dragStartH = this.element.offsetHeight;
document.savedmousemove=document.onmousemove;
document.onmousemove=this.dragMoveHdlr=function(evt){thisRef.dragMove(evt)};
document.savedmouseup=document.onmouseup;
document.onmouseup=this.dragStopHdlr=function(evt){thisRef.dragStop(evt)};
},
dragMove : function(evt) {
if (!evt) var evt=window.event;
// ELS: make sure height is at least 10px
var h=this.dragStartH+evt.clientY-this.dragStartY;
if (h<10) h=10; this.element.style.height=h+"px";
// ELS: match handle to textarea width (which may have changed due to document scrollbars)
var adjust=this.element.nodeName.toLowerCase()=='textarea'?4:0; // 4 pixels for textarea
this.handle.style.width=(this.element.offsetWidth-adjust)+"px";
// ELS: when manually resizing, disable autoresizing (without restoring saved height)
if (this.element.maxed!=undefined && this.element.maxed)
config.commands.autosizeEditor.off(this.element,false);
},
dragStop : function(evt) {
if (!evt) var evt=window.event;
document.onmousemove=(document.savedmousemove!=undefined)?document.savedmousemove:null;
document.onmousemove=(document.savedmouseup!=undefined)?document.savedmouseup:null;
},
destroy : function() {
var elt = this.element;
elt.parentNode.removeChild(this.handle);
elt.style.height = "";
}
};
//}}}
Files for making new tiddlers
----
/%
!html
<html><hide linebreaks>
</html>
!end
%/
/%
!iframe
{{borderless center{
|vertical-align:bottom;<<toolbar fullscreen>><<tiddler ToggleLeftSidebar with: "label">>Sidebar »<<tiddler ToggleRightSidebar with: "label">> |<<tiddler NavButtons>>|[img[New window|http://img229.imageshack.us/img229/1687/extlink7226466sx5.gif][TYPE URL HERE]]|
----
<html><div align="center"><iframe src ="TYPE URL HERE" width="100%" align="center" height="600" scrolling="auto" frameborder="0" allowtransparency style="border:none;"></iframe></div></html>}}}
!end
%/
/%
!journal2
Put your preconfigured journal information here in TiddlerMakeFile
!end
%/
/%
!object
<html><div align="center"> <object width="425" height="350"><param name="movie" value="TYPE URL HERE"></param><param name="wmode" value="transparent"></param><embed src="TYPE URL HERE" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></div></html>
!end
%/
/%
!table
{{niceTable{
|Title/link|[[TW Help|http://twhelp.tiddlyspot.com]]|
|Creator|Morris Gray|
|Subject matter|Tutorial|
|Description/notes|A beginners to intermedate level help file|
|Screenshot|[img[http://www.giffmex.org/twinactionimgs/twhelp.png]]|
}}}
!end
%/
/%
!tabs
<<tabs tabsCookie
[[Intro ]] "tooltip 1" [[MakeTabsIntro]]
[[TabTwoName]] "tooltip 2" [[tiddler two]]
[[TabThreeName]] "tooltip 3" [[Tiddler three]]
[[TabFourName]] "tooltip 3" [[Tiddler four]]
>>
OR
Create a tabbed view with one tab for every tiddler containing the tag "YOURTAG" (using the {{{<<tabs...>>}}} macro).
{{{
<<forEachTiddler
where
'tiddler.tags.contains("YOURTAG")'
sortBy
'tiddler.title.toUpperCase()'
write '" [["+tiddler.title+" ]] \"view ["+tiddler.title+"]\" [["+tiddler.title+"]] "'
begin '"<<tabs txtMyAutoTab "'
end '">"+">"'
none '"//No tiddler tagged with \"YOURTAG\"//"'
>>
}}}
!end
%/
/***
|''Name:''|TiddlerNotesPlugin|
|''Description:''|Add notes to tiddlers without modifying the original content|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#TiddlerNotesPlugin|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.1|
|''Date:''|26/10/07|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.3|
!!Concept:
*The TiddlerNotesPlugin allows you to add notes to tiddlers, without needing to edit the original tiddler. This means that your original content will remain unaltered, and if you update it in the future, you won’t lose your notes. Notes are stored in separate tiddlers, but can be viewed and edited from within the original tiddler.
*For a tiddler titled "~MySlide", the notes are by default saved in a tiddler titled "~MySlide-Notes" and is given a tag of "Notes". The suffix and tags of the notes tiddlers are customizable. You can have one or multiple notes per tiddlers. So it is possible to have for example, teacher's notes and student's notes in the same file.
*Notes can be configured to start off blank, or pre-filled with the contents of the original tiddler.
!!Usage:
*{{{<<notes>>}}} is the simplest usage form.
* additional optional parameters include:
**{{{heading:}}} the heading to use for the notes box
**{{{tag:}}} the tag to be given to the notes tiddler
**{{{suffix:}}} the suffix to be used when naming the notes tiddler
* a full macro call could look like: {{{<<notes heading:"My Notes" tag:"NoteTiddlers" suffix:"Comments">>}}}
* To avoid adding {{{<<notes>>}}} to each tiddler you want notes for, you could add the macro call to the ViewTemplate
** below the line {{{<div class='viewer' macro='view text wikified'></div>}}} add the following line: <br> {{{<div class='viewer' macro='notes'></div>}}}
** Used in combination with the ~HideWhenPlugin or ~PublisherPlugin, you could have notes be shown only for tiddlers with specific tags. The ~PublisherPlugin would allow you for instance to only have the ~TeachersNotes visible to the teacher, and the ~StudentsNotes for the same tiddler visible to the Student.
!!Configuration
*<<option chkPrefillNotes>> Enable to pre-fill notes with the original tiddler's contents
!!Demo:
* [[MySlide]]
***/
// /%
//!BEGIN-PLUGIN-CODE
if (!config.options.chkPrefillNotes)
config.options.chkPrefillNotes = false;
function createTiddlyElement(theParent,theElement,theID,theClass,theText,attribs)
{
var e = document.createElement(theElement);
if(theClass != null)
e.className = theClass;
if(theID != null)
e.setAttribute("id",theID);
if(theText != null)
e.appendChild(document.createTextNode(theText));
if(attribs){
for(var n in attribs){
e.setAttribute(n,attribs[n]);
}
}
if(theParent != null)
theParent.appendChild(e);
return e;
}
function createTiddlyButton(theParent,theText,theTooltip,theAction,theClass,theId,theAccessKey,attribs)
{
var theButton = document.createElement("a");
if(theAction) {
theButton.onclick = theAction;
theButton.setAttribute("href","javascript:;");
}
if(theTooltip)
theButton.setAttribute("title",theTooltip);
if(theText)
theButton.appendChild(document.createTextNode(theText));
if(theClass)
theButton.className = theClass;
else
theButton.className = "button";
if(theId)
theButton.id = theId;
if(attribs){
for(var n in attribs){
e.setAttribute(n,attribs[n]);
}
}
if(theParent)
theParent.appendChild(theButton);
if(theAccessKey)
theButton.setAttribute("accessKey",theAccessKey);
return theButton;
}
config.macros.notes={
cancelWarning: "Er du sikker på at du vil undlade at gemme dine ændringer af kommentarer til '%0'?",
editLabel: "redigér kommentar",
editTitle: "dobbeltklik for at ændre",
saveLabel: "gem kommentar",
saveTitle: "Dobbeltklik for at gemme",
cancelLabel: "fortryd",
heading: "Kommentar",
suffix: "Kommentar",
tag: "Kommentar",
saveNotes: function(ev){
e = ev? ev : window.event;
var theTarget = resolveTarget(e);
if (theTarget.nodeName.toLowerCase() == "textarea")
return false;
var title = story.findContainingTiddler(theTarget).getAttribute("tiddler");
story.setDirty(title,false);
var box = document.getElementById("notesContainer"+title);
var textarea = document.getElementById("notesTextArea"+title);
if(textarea.getAttribute("oldText")!=textarea.value && !hasClass(theTarget,"cancelNotesButton")){
var suffix = box.getAttribute("suffix");
var t = store.getTiddler(title+"-"+suffix);
store.saveTiddler(title+"-"+suffix,title+"-"+suffix,textarea.value,config.options.txtUserName,new Date(),t?t.tags:box.getAttribute("tag"),t?t.fields:{});
}
story.refreshTiddler(title,1,true);
autoSaveChanges(true);
return false;
},
editNotes: function(box,tiddler){
removeChildren(box);
story.setDirty(tiddler,true);
box.title = this.saveTitle;
box.ondblclick = this.saveNotes;
createTiddlyButton(box,this.cancelLabel,this.cancelLabel,this.saveNotes,"cancelNotesButton");
createTiddlyButton(box,this.saveLabel,this.saveLabel,this.saveNotes,"saveNotesButton");
wikify("!!"+box.getAttribute("heading")+"\n",box);
addClass(box,"editor");
var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix");
var wrapper2 = createTiddlyElement(wrapper1,"div");
var e = createTiddlyElement(wrapper2,"textarea","notesTextArea"+tiddler);
var v = store.getValue(tiddler+"-"+box.getAttribute("suffix"),"text");
if(!v)
v = config.options.chkPrefillNotes? store.getValue(tiddler,"text"):'';
e.value = v;
e.setAttribute("oldText",v);
var rows = 10;
var lines = v.match(/\n/mg);
var maxLines = Math.max(parseInt(config.options.txtMaxEditRows),5);
if(lines != null && lines.length > rows)
rows = lines.length + 5;
rows = Math.min(rows,maxLines);
e.setAttribute("rows",rows);
box.appendChild(wrapper1);
},
editNotesButtonOnclick: function(e){
var title = story.findContainingTiddler(this).getAttribute("tiddler");
var box = document.getElementById("notesContainer"+title);
config.macros.notes.editNotes(box,title);
return false;
},
ondblclick : function(ev){
e = ev? ev : window.event;
var theTarget = resolveTarget(e);
var title = story.findContainingTiddler(theTarget).getAttribute("tiddler");
var box = document.getElementById("notesContainer"+title);
config.macros.notes.editNotes(box,title);
e.cancelBubble = true;
if(e.stopPropagation) e.stopPropagation();
return false;
},
handler : function(place,macroName,params,wikifier,paramString,tiddler){
params = paramString.parseParams("anon",null,true,false,false);
var heading = getParam(params,"heading",this.heading);
var tag = getParam(params,"tag",this.tag);
var suffix = getParam(params,"suffix",this.suffix);
var box = createTiddlyElement(place,"div","notesContainer"+tiddler.title,"TiddlerNotes",null,{"source":tiddler.title,params:paramString,heading:heading,tag:tag,suffix:suffix});
createTiddlyButton(box,this.editLabel,this.editLabel,this.editNotesButtonOnclick,"editNotesButton");
wikify("!!"+heading+"\n",box);
box.title=this.editTitle;
box.ondblclick = this.ondblclick;
wikify("<<tiddler [["+tiddler.title+"-"+suffix+"]]>>",box);
}
};
Story.prototype.old_notes_closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler = function(title,animate,unused){
if(story.isDirty(title)) {
if(!confirm(config.macros.notes.cancelWarning.format([title])))
return false;
}
return this.old_notes_closeTiddler.apply(this,arguments);
}
setStylesheet(".TiddlerNotes {\n"+ " background:#eee;\n"+ " border:1px solid #ccc;\n"+ " padding:10px;\n"+ " margin:15px;\n"+ "}\n"+ "\n"+ ".cancelNotesButton,.editNotesButton, .saveNotesButton {\n"+ " float:right;\n"+ " border:1px solid #ccc;\n"+ " padding:2px 5px;\n"+ "}\n"+ "\n"+ ".saveNotesButton{\n"+ " margin-right:0.5em;\n"+ "}\n"+ "\n"+ ".TiddlerNotes.editor textarea{\n"+ " border:1px solid #ccc;\n"+ "}","NotesPluginStyles");
//!END-PLUGIN-CODE
// %/
/***
|Name|TiddlerPasswordPlugin|
|Source|http://www.TiddlyTools.com/#TiddlerPasswordPlugin|
|Documentation|http://www.TiddlyTools.com/#TiddlerPasswordPluginInfo|
|Version|1.1.3|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|block viewing of tiddler content by prompting for a password before content is displayed|
This plugin blocks viewing of specific tiddler content by prompting for a NON-SECURE, UNENCRYPTED password before the tiddler is displayed. If the correct password is not entered, the tiddler is automatically closed. The process does not prevent tiddler content from being viewed directly from the TiddlyWiki source file's storeArea, nor does it encrypt the tiddler content in any way. Because it is relatively simple to bypass and/or disable the password prompting process, this macro should be thought of as a "latch" rather than a "lock" on a given tiddler.
!!!!!Documentation
> see [[TiddlerPasswordPluginInfo]]
!!!!!Installation Notes
<<<
''As soon as you have installed this plugin, you should change the default admin password in [[TiddlerPasswordPluginConfig]].'' Note: the configuration tiddler is password-protected to prevent the admin password from being viewed (and/or modified) unless the current password is provided. By default, the admin password is set to "admin".
<<<
!!!!!Revisions
<<<
2008.03.10 [*.*.*] plugin size reduction - documentation moved to [[TiddlerPasswordPluginInfo]]
2007.09.13 [1.1.3] adjusted wording of "cancelMsg" text so it can apply to either view-mode or edit-mode activities, and documented usage in ViewTemplate/EditTemplate.
| Please see [[TiddlerPasswordPluginInfo]] for previous revision details |
2006.12.02 [1.0.0] initial release - converted from GetTiddlerPassword inline script
<<<
!!!!!Code
***/
//{{{
version.extensions.TiddlerPasswordPlugin= {major: 1, minor: 1, revision: 3, date: new Date(2007,9,13)};
config.macros.getTiddlerPassword = {
msg: "Skriv venligst et password for at læse '%0'",
defaultText: "Skriv password her",
retryMsg: "'%0' er ikke det korrekte password til '%1'. Prøv venligst igen:",
cancelMsg: "desværre du kan ikke få adgang til '%0' uden det rigtige password.",
thanksMsg: "Tak, dit password er blevet accepteret.",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var here=story.findContainingTiddler(place); if (!here) return;
var title=tiddler?tiddler.title:here.getAttribute("tiddler");
var who=here.getAttribute("logID");
var userPass=params[0]?params[0]:""; if (userPass=='-') userPass="";
var msg=params[1]?params[1]:this.msg;
if (who==userPass||who==this.adminPass) return; // already 'logged in'?
var who=prompt(msg.format([title]),this.defaultText); // ask for ID
while (who && who!=userPass && who!=this.adminPass) // not correct ID?
who=prompt(this.retryMsg.format([who,title]),this.defaultText); // ask again
if (who==userPass||who==this.adminPass) // correct ID? mark tiddler logged in...
{ here.setAttribute("logID",who); alert(this.thanksMsg); }
else // incorrect ID (e.g., entry cancelled by user)...
{ story.closeTiddler(here.getAttribute("tiddler")); alert(this.cancelMsg.format([title])); }
}
}
// default admin password (may be overridden in TiddlerPasswordPluginConfig)
if (config.macros.getTiddlerPassword.adminPass==undefined)
config.macros.getTiddlerPassword.adminPass="admin";
//}}}
// // Tiddler Admin Password Configuration... <<getTiddlerPassword>> /% rest of tiddler will not be displayed without password... %/
//{{{
config.macros.getTiddlerPassword.adminPass="kultur";
//}}}
// {{small{NOTE: after changing the password, save-and-reload the document for the change to take effect}}} //
<<slider chkSyg Syg "Sygemeldte & vilkår»">> <<slider chkWeekendListen WeekendListen "Weekend»">> <<slider chkHjemme Hjemme "Hjemme»">>
<<tiddler ToggleRightSidebar with: "Sidebar »">>
{{overflow{
<<tiddlerTweaker>>
}}}
/***
|Name|TiddlerTweakerPlugin|
|Source|http://www.TiddlyTools.com/#TiddlerTweakerPlugin|
|Version|2.4.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|select multiple tiddlers and modify author, created, modified and/or tag values|
~TiddlerTweaker is a tool for TiddlyWiki authors. It allows you to select multiple tiddlers from a listbox, either by direct interaction or automatically matching specific criteria. You can then modify the creator, author, created, modified and/or tag values of those tiddlers using a compact set of form fields. The values you enter into the fields simultantously overwrite the existing values in all tiddlers you have selected.
!!!!!Usage
<<<
{{{<<tiddlerTweaker>>}}}
{{smallform{<<tiddlerTweaker>>}}}
By default, any tags you enter into the TiddlerTweaker will //replace// the existing tags in all the tiddlers you have selected. However, you can also use TiddlerTweaker to quickly filter specified tags from the selected tiddlers, while leaving any other tags assigned to those tiddlers unchanged:
>Any tag preceded by a "+" (plus) or "-" (minus), will be added or removed from the existing tags //instead of replacing the entire tag definition// of each tiddler (e.g., enter "-excludeLists" to remove that tag from all selected tiddlers. When using this syntax, care should be taken to ensure that //every// tag is preceded by "+" or "-", to avoid inadvertently overwriting any other existing tags on the selected tiddlers. (note: the "+" or "-" prefix on each tag value is NOT part of the tag value, and is only used by TiddlerTweaker to control how that tag value is processed)
Important Notes:
* Inasmuch as TiddlerTweaker is a 'power user' tool that can perform 'batch' functions (operating on many tiddlers at once), you should always have a recent backup of your document (or "save changes" just *before* tweaking the tiddlers), just in case you "shoot yourself in the foot".
* By design, TiddlerTweaker does NOT update the 'modified' date of tiddlers simply by making changes to the tiddler's values. A tiddler's dates are ONLY updated when the corresponding 'created' and/or 'modified' checkboxes are selected and you enter new values for those dates. As a general rule, after using TiddlerTweaker, always ''//remember to save your document//'' when you are done, even though the tiddler timeline tab may not show any recently modified tiddlers.
* Because you may be changing the values on many tiddlers simultaneously, selecting and updating all tiddlers in a document operation may take a while and your browser might warn about an "unresponsive script"... you should give it a whole bunch of time to 'continue'... it should complete the processing... eventually.
<<<
!!!!!Revisions
<<<
2009.03.30 [2.4.0] added 'sort by modifier'
2009.01.22 [2.3.0] added support for text pattern find/replace
2008.10.27 [2.2.3] in setTiddlers(), fixed Safari bug by replacing static Array.concat(...) with new Array().concat(...)
2008.09.07 [2.2.2] added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.05.12 [2.2.1] replace built-in backstage "tweak" task with tiddler tweaker control panel (moved from BackstageTweaks)
2008.01.13 [2.2.0] added "auto-selection" links: all, changed, tags, title, text
2007.12.26 [2.1.0] added support for managing 'creator' custom field (see [[CoreTweaks]])
2007.11.01 [2.0.3] added config.options.txtTweakerSortBy for cookie-based persistence of list display order preference setting.
2007.09.28 [2.0.2] in settiddlers() and deltiddlers(), added suspend/resume notification handling (improves performance when operating on multiple tiddlers)
2007.08.03 [2.0.1] added shadow definition for [[TiddlerTweaker]] tiddler for use as parameter references with {{{<<tiddler>>, <<slider>> or <<tabs>>}}} macros.
2007.08.03 [2.0.0] converted from inline script
2006.01.01 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TiddlerTweakerPlugin= {major: 2, minor: 4, revision: 0, date: new Date(2009,1,22)};
// shadow tiddler
config.shadowTiddlers.TiddlerTweaker="<<tiddlerTweaker>>";
/// backstage task
if (config.tasks) { // for TW2.2b3 or above
config.tasks.tweak.tooltip="review/modify tiddler internals: dates, authors, tags, etc.";
config.tasks.tweak.content="{{smallform small groupbox{<<tiddlerTweaker>>}}}";
}
if (config.options.txtTweakerSortBy==undefined) config.options.txtTweakerSortBy="modified";
// if removeCookie() function is not defined by TW core, define it here.
if (window.removeCookie===undefined) {
window.removeCookie=function(name) {
document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;';
}
}
config.macros.tiddlerTweaker = {
html: '<form style="display:inline"><!--\
--><table style="padding:0;margin:0;border:0;width:100%"><tr valign="top" style="padding:0;margin:0;border:0"><!--\
--><td style="text-align:center;white-space:nowrap;width:99%;padding:0;margin:0;border:0"><!--\
--><font size=-2><div style="text-align:left;"><span style="float:right"><!--\
--> <a href="javascript:;" \
title="select all tiddlers"\
onclick="\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++)\
if (f.list.options[t].value.length) f.list.options[t].selected=true;\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">all</a><!--\
--> <a href="javascript:;" \
title="select tiddlers that are new/changed since the last file save"\
onclick="\
var lastmod=new Date(document.lastModified);\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
var tid=store.getTiddler(f.list.options[t].value);\
f.list.options[t].selected=tid&&tid.modified>lastmod;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">changed</a><!--\
--> <a href="javascript:;" \
title="select tiddlers with at least one matching tag"\
onclick="\
var t=prompt(\'Enter space-separated tags (match ONE)\');\
if (!t||!t.length) return false;\
var tags=t.readBracketedList();\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
f.list.options[t].selected=false;\
var tid=store.getTiddler(f.list.options[t].value);\
if (tid&&tid.tags.containsAny(tags)) f.list.options[t].selected=true;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">tags</a><!--\
--> <a href="javascript:;" \
title="select tiddlers whose titles include matching text"\
onclick="\
var txt=prompt(\'Enter a title (or portion of a title) to match\');\
if (!txt||!txt.length) return false;\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
f.list.options[t].selected=f.list.options[t].value.indexOf(txt)!=-1;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">titles</a><!--\
--> <a href="javascript:;" \
title="select tiddlers containing matching text"\
onclick="\
var txt=prompt(\'Enter tiddler text (content) to match\');\
if (!txt||!txt.length) return false;\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
var tt=store.getTiddlerText(f.list.options[t].value,\'\');\
f.list.options[t].selected=(tt.indexOf(txt)!=-1);\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">text</a> <!--\
--></span><span>select tiddlers</span><!--\
--></div><!--\
--></font><select multiple name=list size="11" style="width:99.99%" \
title="use click, shift-click and/or ctrl-click to select multiple tiddler titles" \
onclick="config.macros.tiddlerTweaker.selecttiddlers(this)" \
onchange="config.macros.tiddlerTweaker.setfields(this)"><!--\
--></select><br><!--\
-->show<input type=text size=1 value="11" \
onchange="this.form.list.size=this.value; this.form.list.multiple=(this.value>1);"><!--\
-->by<!--\
--><select name=sortby size=1 \
onchange="config.macros.tiddlerTweaker.init(this.form,this.value)"><!--\
--><option value="title">title</option><!--\
--><option value="size">size</option><!--\
--><option value="modified">modified</option><!--\
--><option value="created">created</option><!--\
--><option value="modifier">modifier</option><!--\
--></select><!--\
--><input type="button" value="refresh" \
onclick="config.macros.tiddlerTweaker.init(this.form,this.form.sortby.value)"<!--\
--> <input type="button" name="stats" disabled value="totals..." \
onclick="config.macros.tiddlerTweaker.stats(this)"><!--\
--></td><td style="white-space:nowrap;padding:0;margin:0;border:0;width:1%"><!--\
--><div style="text-align:left"><font size=-2> modify values</font></div><!--\
--><table border=0 style="width:100%;padding:0;margin:0;border:0;"><tr style="padding:0;border:0;"><!--\
--><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=settitle unchecked \
title="allow changes to tiddler title (rename tiddler)" \
onclick="this.form.title.disabled=!this.checked">title<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=title size=35 style="width:98%" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setcreator unchecked \
title="allow changes to tiddler creator" \
onclick="this.form.creator.disabled=!this.checked">created by<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=creator size=35 style="width:98%" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setwho unchecked \
title="allow changes to tiddler author" \
onclick="this.form.who.disabled=!this.checked">modified by<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=who size=35 style="width:98%" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setcdate unchecked \
title="allow changes to created date" \
onclick="var f=this.form; f.cm.disabled=f.cd.disabled=f.cy.disabled=f.ch.disabled=f.cn.disabled=!this.checked"><!--\
-->created on<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=cm size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=cd size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=cy size=4 style="width:3em;padding:0;text-align:center" disabled><!--\
--> at <input type=text name=ch size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> : <input type=text name=cn size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setmdate unchecked \
title="allow changes to modified date" \
onclick="var f=this.form; f.mm.disabled=f.md.disabled=f.my.disabled=f.mh.disabled=f.mn.disabled=!this.checked"><!--\
-->modified on<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=mm size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=md size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=my size=4 style="width:3em;padding:0;text-align:center" disabled><!--\
--> at <input type=text name=mh size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> : <input type=text name=mn size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=replacetext unchecked\
title="find/replace matching text" \
onclick="this.form.pattern.disabled=this.form.replacement.disabled=!this.checked">replace text<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=pattern size=15 value="" style="width:40%" disabled \
title="enter TEXT PATTERN (regular expression)"> with <!--\
--><input type=text name=replacement size=15 value="" style="width:40%" disabled \
title="enter REPLACEMENT TEXT"><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=settags checked \
title="allow changes to tiddler tags" \
onclick="this.form.tags.disabled=!this.checked">tags<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=tags size=35 value="" style="width:98%" \
title="enter new tags or use \'+tag\' and \'-tag\' to add/remove tags from existing tags"><!--\
--></td></tr></table><!--\
--><div style="text-align:center"><!--\
--><nobr><input type=button name=display disabled style="width:32%" value="display tiddlers" \
onclick="config.macros.tiddlerTweaker.displaytiddlers(this)"><!--\
--> <input type=button name=del disabled style="width:32%" value="delete tiddlers" \
onclick="config.macros.tiddlerTweaker.deltiddlers(this)"><!--\
--> <input type=button name=set disabled style="width:32%" value="update tiddlers" \
onclick="config.macros.tiddlerTweaker.settiddlers(this)"></nobr><!--\
--></div><!--\
--></td></tr></table><!--\
--></form><span style="display:none"><!--content replaced by tiddler "stats"--></span>\
',
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var span=createTiddlyElement(place,"span");
span.innerHTML=this.html;
this.init(span.firstChild,config.options.txtTweakerSortBy);
},
init: function(f,sortby) { // initialize form controls
if (!f) return; // form might not be rendered yet...
while (f.list.options[0]) f.list.options[0]=null; // empty current list content
var tids=store.getTiddlers(sortby);
if (sortby=='size') // descending order
tids.sort(function(a,b) {return a.text.length > b.text.length ? -1 : (a.text.length == b.text.length ? 0 : +1);});
var who='';
for (i=0; i<tids.length; i++) { var t=tids[i];
var label=t.title; var value=t.title;
switch (sortby) {
case 'modified':
case 'created':
var t=tids[tids.length-i-1]; // reverse order
var when=t[sortby].formatString('YY.0MM.0DD 0hh:0mm ');
label=when+t.title;
value=t.title;
break;
case 'size':
label='['+t.text.length+'] '+label;
break;
case 'modifier':
case 'creator':
if (who!=t[sortby]) {
who=t[sortby];
f.list.options[f.list.length]=new Option('by '+who+':','',false,false);
}
label='\xa0\xa0\xa0'+label; // indent
break;
}
f.list.options[f.list.length]=new Option(label,value,false,false);
}
f.title.value=f.who.value=f.creator.value=f.tags.value="";
f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value="";
f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value="";
f.stats.disabled=f.set.disabled=f.del.disabled=f.display.disabled=true;
f.settitle.disabled=false;
config.options.txtTweakerSortBy=sortby; // remember current setting
f.sortby.value=sortby; // sync droplist selection with current setting
if (sortby!="modified") // non-default preference... save cookie
saveOptionCookie("txtTweakerSortBy");
else removeCookie("txtTweakerSortBy"); // default preference... clear cookie
},
selecttiddlers: function(here) { // enable/disable tweaker fields based on number of items selected
// count how many tiddlers are selected
var f=here.form; var list=f.list;
var c=0; for (i=0;i<list.length;i++) if (list.options[i].selected) c++;
if (c>1) f.title.disabled=true;
if (c>1) f.settitle.checked=false;
f.set.disabled=(c==0);
f.del.disabled=(c==0);
f.display.disabled=(c==0);
f.settitle.disabled=(c>1);
f.stats.disabled=(c==0);
var msg=(c==0)?'select tiddlers':(c+' tiddler'+(c!=1?'s':'')+' selected');
here.previousSibling.firstChild.firstChild.nextSibling.innerHTML=msg;
if (c) clearMessage(); else displayMessage("no tiddlers selected");
},
setfields: function(here) { // set tweaker edit fields from first selected tiddler
var f=here.form;
if (!here.value.length) {
f.title.value=f.who.value=f.creator.value=f.tags.value="";
f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value="";
f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value="";
return;
}
var tid=store.getTiddler(here.value); if (!tid) return;
f.title.value=tid.title;
f.who.value=tid.modifier;
f.creator.value=tid.fields['creator']||''; // custom field - might not exist
f.tags.value=tid.tags.join(' ');
var c=tid.created; var m=tid.modified;
f.cm.value=c.getMonth()+1;
f.cd.value=c.getDate();
f.cy.value=c.getFullYear();
f.ch.value=c.getHours();
f.cn.value=c.getMinutes();
f.mm.value=m.getMonth()+1;
f.md.value=m.getDate();
f.my.value=m.getFullYear();
f.mh.value=m.getHours();
f.mn.value=m.getMinutes();
},
settiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
var cdate=new Date(f.cy.value,f.cm.value-1,f.cd.value,f.ch.value,f.cn.value);
var mdate=new Date(f.my.value,f.mm.value-1,f.md.value,f.mh.value,f.mn.value);
if (tids.length>1 && !confirm("Are you sure you want to update these tiddlers:\n\n"+tids.join(', '))) return;
store.suspendNotifications();
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
var title=!f.settitle.checked?tid.title:f.title.value;
var who=!f.setwho.checked?tid.modifier:f.who.value;
var text=tid.text;
if (f.replacetext.checked) text=text.replace(new RegExp(f.pattern.value,'mg'),f.replacement.value);
var tags=tid.tags;
if (f.settags.checked) {
var intags=f.tags.value.readBracketedList();
var addtags=[]; var deltags=[]; var reptags=[];
for (i=0;i<intags.length;i++) {
if (intags[i].substr(0,1)=='+')
addtags.push(intags[i].substr(1));
else if (intags[i].substr(0,1)=='-')
deltags.push(intags[i].substr(1));
else
reptags.push(intags[i]);
}
if (reptags.length)
tags=reptags;
if (addtags.length)
tags=new Array().concat(tags,addtags);
if (deltags.length)
for (i=0;i<deltags.length;i++)
{ var pos=tags.indexOf(deltags[i]); if (pos!=-1) tags.splice(pos,1); }
}
if (!f.setcdate.checked) cdate=tid.created;
if (!f.setmdate.checked) mdate=tid.modified;
store.saveTiddler(tid.title,title,text,who,mdate,tags,tid.fields);
if (f.setcreator.checked) store.setValue(tid.title,'creator',f.creator.value); // set creator
if (f.setcdate.checked) tid.assign(null,null,null,null,null,cdate); // set create date
}
store.resumeNotifications();
this.init(f,f.sortby.value);
},
displaytiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0; i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
story.displayTiddlers(story.findContainingTiddler(f),tids)
},
deltiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
if (!confirm("Are you sure you want to delete these tiddlers:\n\n"+tids.join(', '))) return;
store.suspendNotifications();
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
if (tid.tags.contains("systemConfig"))
if (!confirm("'"+tid.title+"' is tagged with 'systemConfig'.\n\nRemoving this tiddler may cause unexpected results. Are you sure?"))
continue;
store.removeTiddler(tid.title);
story.closeTiddler(tid.title);
}
store.resumeNotifications();
this.init(f,f.sortby.value);
},
stats: function(here) {
var f=here.form; var list=f.list; var tids=[]; var out=''; var tot=0;
var target=f.nextSibling;
for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
out+='[['+tid.title+']] '+tid.text.length+'\n'; tot+=tid.text.length;
}
var avg=tot/tids.length;
out=tot+' bytes in '+tids.length+' selected tiddlers ('+avg+' bytes/tiddler)\n<<<\n'+out+'<<<\n';
removeChildren(target);
target.innerHTML="<hr><font size=-2><a href='javascript:;' style='float:right' "
+"onclick='this.parentNode.parentNode.style.display=\"none\"'>close</a></font>";
wikify(out,target);
target.style.display="block";
}
};
//}}}
Type the text for 'TiddlerbarToggled'
/***
|''Name:''|TiddlersBarPluginMG|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Modification
2008.09.06 - Morris Gray (Added http://tw.lewcid.org/#OpenTopPlugin code to this plugin to overcome jumping to the top when invoking any popup. Deleted the offending code)
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed.
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab = config.options.chkHideTabsBarWhenSingleTab ? config.options.chkHideTabsBarWhenSingleTab : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "do nothing";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
tooltip : "see ",
tooltipClose : "click here to close this tab",
tooltipSave : "click here to save this tab",
promptRename : "Enter tiddler new name",
currentTiddler : "",
previousState : false,
previousKey : config.options.txtPreviousTabKey,
nextKey : config.options.txtNextTabKey,
tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
handler: function(place,macroName,params) {
var previous = null;
if (config.macros.tiddlersBar.isShown())
story.forEachTiddler(function(title,e){
if (title==config.macros.tiddlersBar.currentTiddler){
var d = createTiddlyElement(null,"span",null,"tab tabSelected");
config.macros.tiddlersBar.createActiveTabButton(d,title);
if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
previous = "active";
}
else {
var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
btn.setAttribute("tiddler", title);
if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
previous=btn;
}
var isDirty =story.isDirty(title);
var c = createTiddlyButton(d,isDirty ?"?":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
c.setAttribute("tiddler", title);
if (place.childNodes) {
place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
place.insertBefore(d,place.firstChild);
}
else place.appendChild(d);
})
},
refresh: function(place,params){
removeChildren(place);
config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
story.refreshAllTiddlers();
if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
}
},
isShown : function(){
if (config.options.chkDisableTabsBar) return false;
if (!config.options.chkHideTabsBarWhenSingleTab) return true;
var cpt=0;
story.forEachTiddler(function(){cpt++});
return (cpt>1);
},
selectNextTab : function(){ //used when the current tab is closed (to select another tab)
var previous="";
story.forEachTiddler(function(title){
if (!config.macros.tiddlersBar.currentTiddler) {
story.displayTiddler(null,title);
return;
}
if (title==config.macros.tiddlersBar.currentTiddler) {
if (previous) {
story.displayTiddler(null,previous);
return;
}
else config.macros.tiddlersBar.currentTiddler=""; // so next tab will be selected
}
else previous=title;
});
},
onSelectTab : function(e){
var t = this.getAttribute("tiddler");
if (t) story.displayTiddler(null,t);
return false;
},
onTabClose : function(e){
var t = this.getAttribute("tiddler");
if (t) {
if(story.hasChanges(t) && !readOnly) {
if(!confirm(config.commands.cancelTiddler.warning.format([t])))
return false;
}
story.closeTiddler(t);
}
return false;
},
onTabSave : function(e) {
var t = this.getAttribute("tiddler");
if (!e) e=window.event;
if (t) config.commands.saveTiddler.handler(e,null,t);
return false;
},
onSelectedTabButtonClick : function(event,src,title) {
var t = this.getAttribute("tiddler");
if (!event) event=window.event;
if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
return false;
},
onTiddlersBarAction: function(event) {
var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
},
createActiveTabButton : function(place,title) {
if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
btn.setAttribute("tiddler", title);
}
else
createTiddlyText(place,title);
}
}
story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;
story.closeTiddler = function(title,animate,unused) {
if (title==config.macros.tiddlersBar.currentTiddler)
config.macros.tiddlersBar.selectNextTab();
story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;
if (config.macros.tiddlersBar.isShown()) {
story.forEachTiddler(function(t,e){
if (t!=title) e.style.display="none";
else e.style.display="";
})
config.macros.tiddlersBar.currentTiddler=title;
}
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
coreRefreshPageTemplate(title);
if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}
ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)
config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles);
config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");
//}}}
/***
|Name|TiddlyLockPlugin|
|Source|http://www.minormania.com/tiddlylock/tiddlylock.html|
|Version|1.0.4|
|TiddlyWiki Core Version|2.2.4|
|Author|Richard Hobbis|
|License|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|Type|plugin|
|Overrides|config.macros.newTiddler.onClickNewTiddler()<<br>>config.commands.cancelTiddler.handler()<<br>>config.commands.deleteTiddler.handler<<br>>config.commands.editTiddler.handler()<<br>>config.commands.saveTiddler.handler()<<br>>saveChanges()<<br>>checkUnsavedChanges()|
|Description|Automatically locks and unlocks the TiddlyWiki as required, allowing multiple users to edit the TiddlyWiki without fear of overwriting other users' changes.|
!!!Usage
<<<
Simply import TiddlyLockPlugin into your TiddlyWiki!
<<<
!!!Installation
<<<
Import (or copy/paste) ''this tiddler'' into your TiddlyWiki and make sure it's tagged with <<tag systemConfig>>. Reload your TiddlyWiki to enable TiddlyLock.
<<<
!!!Configuration
<<<
None required!
<<<
!!!Revision History
<<<
''2007.06.22 [1.0.4]'' Added locking on 'new tiddler' which also traps 'new journal'. Tweaked messages.
''2007.06.20 [1.0.3]'' Fixed an issue that occurred when a user navigated away from the TiddlyWiki without saving outstanding changes.
''2007.05.10 [1.0.2]'' Implemented a timestamp to track the last update time. This fixes the multi-browser edit issue and also removes the need for a password.
''2007.05.08 [1.0.1]'' Function overrides are now done using apply() ensuring clean upgrades (thanks Martin!)
''2007.05.01 [1.0.0]'' Initial Release
<<<
!!!Known Issues
<<<
*Monkey Pirate TiddlyWiki (MPTW) adds a ''disable'' button to the toolbar for systemConfig tiddlers. This button is available even when the TW is marked as readOnly and therefore it's possible for two users to disable/enable plugins at the same time. In this case, whoever saves the TW last will 'win' and their changes will be saved. Note that this is only an issue if there are no other unsaved changes in both browsers - TiddlyLock still handles all other changes.
<<<
!!!Credits
<<<
This feature was developed by Richard Hobbis (rhobbis [at] hotmail [dot] com).
<<<
!!!Code
***/
//{{{
// Convert a date to UTC YYYYMMDDHHMMSSMMM string format
// This is the same as the builtin function convertToYYYYMMDDHHMMSSMMM() but
// without the '.' in the middle - this allows simple date comparisons
Date.prototype.TLConvertToYYYYMMDDHHMMSSMMM = function()
{
return(String.zeroPad(this.getUTCFullYear(),4)
+ String.zeroPad(this.getUTCMonth()+1,2)
+ String.zeroPad(this.getUTCDate(),2)
+ String.zeroPad(this.getUTCHours(),2)
+ String.zeroPad(this.getUTCMinutes(),2)
+ String.zeroPad(this.getUTCSeconds(),2)
+ String.zeroPad(this.getUTCMilliseconds(),4));
}
// namespace for TiddlyLock
TiddlyLock = {};
// Load/Last Update timestamp
TiddlyLock.TimeStamp = new Date().TLConvertToYYYYMMDDHHMMSSMMM();
// Lockfile
TiddlyLock.LockPath = '';
TiddlyLock.OldLockData = '';
TiddlyLock.LockData = '';
// define messages
TiddlyLock.Msg = {
Locked: 'File locked',
Unlocked: 'File unlocked',
LockFailed: 'Failed to lock file',
UnlockFailed: 'Failed to unlock file',
ReadOnly: 'Now in Read-Only mode.',
Changed: 'This file has been changed by someone else.',
Reload: 'Reload this file before editing.'};
// create/update the lock file
function TLSave(timeStamp,lockedBy)
{
var lockedText='';
if (lockedBy!='')
{
lockedText=timeStamp+'##'+lockedBy;
}
else lockedText=timeStamp+'##';
var lockSave=saveFile(TiddlyLock.LockPath,lockedText);
TiddlyLock.TimeStamp = timeStamp;
return false;
}
// Create/update the lock file to prevent other users from editing the TW
function TLLock()
{
clearMessage();
lockSave = TLSave(new Date().TLConvertToYYYYMMDDHHMMSSMMM(),config.options.txtUserName);
displayMessage(TiddlyLock.Msg.Locked,'');
return false;
}
// Clear the lock file if necessary, but only if I have it locked, setting the
// timestamp in the lockfile to the specified value
function TLUnlock(timeStamp)
{
if ((store && store.isDirty && !store.isDirty())
&& (story && story.areAnyDirty && !story.areAnyDirty())
&& TLIsLocked()
&& TLIsLockedByMe())
{
lockSave=TLSave(timeStamp,'','');
displayMessage(TiddlyLock.Msg.Unlocked,'');
TiddlyLock.OldLockData = TiddlyLock.LockData;
}
return false;
}
// Get the contents of the lock file, if it exists
function TLLockPath()
{
var lockPath,p;
var originalPath=document.location.toString();
var localPath=getLocalPath(originalPath);
if((p=localPath.lastIndexOf('.')) != -1)
lockPath=localPath.substr(0,p) + '.lck';
else lockPath=localPath + '.lck';
return lockPath;
}
// Get the contents of the lock file, if it exists
function TLLockData()
{
TiddlyLock.LockPath = TLLockPath();
return loadFile(TiddlyLock.LockPath);
}
// Get the contents of the lock file, if it exists
function TLIsLocked()
{
TiddlyLock.LockData = TLLockData();
if (TiddlyLock.LockData
&& ( TLLockedBy(TiddlyLock.LockData)!='' // someone has it locked
|| TiddlyLock.TimeStamp < TLLockedTimeStamp(TiddlyLock.LockData) // changed by someone else but not currently locked
)
)
return true;
else
return false;
}
// check if locked by me
function TLIsLockedByMe()
{
if(TiddlyLock.LockData == TiddlyLock.TimeStamp+'##' + config.options.txtUserName)
return true;
else
return false;
}
// returns just the timestamp portion of the supplied lock file contents
function TLLockedTimeStamp(lockData)
{
if(lockData)
return lockData.split('##')[0];
else
return '';
}
// returns just the username portion of the supplied lock file contents
function TLLockedBy(lockData)
{
if(lockData)
return lockData.split('##')[1];
else
return '';
}
// display a message if locked or changed
function TLChangesAllowed()
{
if(TLIsLocked() && !TLIsLockedByMe())
{
// if(!readOnly)
{
readOnly=true;
if(TLLockedBy(TiddlyLock.LockData))
{
displayMessage(TiddlyLock.Msg.Locked+' by '+TLLockedBy(TiddlyLock.LockData));
alert(TiddlyLock.Msg.Locked+' by '+TLLockedBy(TiddlyLock.LockData)+'. '+TiddlyLock.Msg.ReadOnly);
}
else
{
displayMessage(TiddlyLock.Msg.Changed+' '+TiddlyLock.Msg.Reload);
alert(TiddlyLock.Msg.Changed+' '+TiddlyLock.Msg.Reload);
}
}
return false;
}
else
return true;
}
//*********************************************
// OVERRIDE STANDARD FUNCTIONS
//*********************************************
//
// OVERRIDE onClickNewTiddler()
//
TiddlyLock.onClickNewTiddler = config.macros.newTiddler.onClickNewTiddler;
config.macros.newTiddler.onClickNewTiddler = function(event,src,title)
{
if (TLChangesAllowed())
{
TiddlyLock.OldLockData = TiddlyLock.LockData;
TLLock();
var ret = TiddlyLock.onClickNewTiddler.apply(this,arguments);
return ret;
}
}
//
// OVERRIDE checkUnsavedChanges()
//
TiddlyLock.checkUnsavedChanges = checkUnsavedChanges;
checkUnsavedChanges = function(event,src,title)
{
var ret = TiddlyLock.checkUnsavedChanges.apply(this,arguments);
if(TLIsLocked() && TLIsLockedByMe())
lockSave=TLSave(TLLockedTimeStamp(TiddlyLock.OldLockData),'','');
return ret;
}
//
// OVERRIDE cancelTiddler()
//
TiddlyLock.cancelTiddler = config.commands.cancelTiddler.handler;
config.commands.cancelTiddler.handler = function(event,src,title)
{
var ret = TiddlyLock.cancelTiddler.apply(this,arguments);
TLUnlock(TLLockedTimeStamp(TiddlyLock.OldLockData));
return ret;
}
//
// OVERRIDE deleteTiddler()
//
TiddlyLock.deleteTiddler = config.commands.deleteTiddler.handler;
config.commands.deleteTiddler.handler = function(event,src,title)
{
if (TLChangesAllowed())
{
TiddlyLock.OldLockData = TiddlyLock.LockData;
TLLock();
var ret = TiddlyLock.deleteTiddler.apply(this,arguments);
return ret;
}
}
//
// OVERRIDE editTiddler()
//
TiddlyLock.editTiddler = config.commands.editTiddler.handler;
config.commands.editTiddler.handler = function(event,src,title)
{
if (TLChangesAllowed())
{
TiddlyLock.OldLockData = TiddlyLock.LockData;
TLLock();
}
var ret = TiddlyLock.editTiddler.apply(this,arguments);
return ret;
}
//
// OVERRIDE saveChanges()
//
TiddlyLock.saveChanges = saveChanges;
saveChanges = function(onlyIfDirty)
{
if(TLChangesAllowed())
{
var ret = TiddlyLock.saveChanges.apply(this,arguments);
TLUnlock(new Date().TLConvertToYYYYMMDDHHMMSSMMM());
return ret;
}
else
return false;
}
//
// OVERRIDE saveTiddler()
//
TiddlyLock.saveTiddler= config.commands.saveTiddler.handler;
config.commands.saveTiddler.handler=function(event,src,title)
{
var ret = TiddlyLock.saveTiddler.apply(this,arguments);
TLUnlock(new Date().TLConvertToYYYYMMDDHHMMSSMMM());
return ret;
}
//}}}
/***
|Name|TiddlerTweakerPlugin|
|Source|http://www.TiddlyTools.com/#TiddlerTweakerPlugin|
|Version|2.3.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|select multiple tiddlers and modify author, created, modified and/or tag values|
~TiddlerTweaker is a tool for TiddlyWiki authors. It allows you to select multiple tiddlers from a listbox, either by direct interaction or automatically matching specific criteria. You can then modify the creator, author, created, modified and/or tag values of those tiddlers using a compact set of form fields. The values you enter into the fields simultantously overwrite the existing values in all tiddlers you have selected.
!!!!!Usage
<<<
{{{<<tiddlerTweaker>>}}}
{{smallform{<<tiddlerTweaker>>}}}
By default, any tags you enter into the TiddlerTweaker will //replace// the existing tags in all the tiddlers you have selected. However, you can also use TiddlerTweaker to quickly filter specified tags from the selected tiddlers, while leaving any other tags assigned to those tiddlers unchanged:
>Any tag preceded by a "+" (plus) or "-" (minus), will be added or removed from the existing tags //instead of replacing the entire tag definition// of each tiddler (e.g., enter "-excludeLists" to remove that tag from all selected tiddlers. When using this syntax, care should be taken to ensure that //every// tag is preceded by "+" or "-", to avoid inadvertently overwriting any other existing tags on the selected tiddlers. (note: the "+" or "-" prefix on each tag value is NOT part of the tag value, and is only used by TiddlerTweaker to control how that tag value is processed)
Important Notes:
* Inasmuch as TiddlerTweaker is a 'power user' tool that can perform 'batch' functions (operating on many tiddlers at once), you should always have a recent backup of your document (or "save changes" just *before* tweaking the tiddlers), just in case you "shoot yourself in the foot".
* By design, TiddlerTweaker does NOT update the 'modified' date of tiddlers simply by making changes to the tiddler's values. A tiddler's dates are ONLY updated when the corresponding 'created' and/or 'modified' checkboxes are selected and you enter new values for those dates. As a general rule, after using TiddlerTweaker, always ''//remember to save your document//'' when you are done, even though the tiddler timeline tab may not show any recently modified tiddlers.
* Because you may be changing the values on many tiddlers simultaneously, selecting and updating all tiddlers in a document operation may take a while and your browser might warn about an "unresponsive script"... you should give it a whole bunch of time to 'continue'... it should complete the processing... eventually.
<<<
!!!!!Revisions
<<<
2009.01.22 [2.3.0] added support for text pattern find/replace
2008.10.27 [2.2.3] in setTiddlers(), fixed Safari bug by replacing static Array.concat(...) with new Array().concat(...)
2008.09.07 [2.2.2] added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.05.12 [2.2.1] replace built-in backstage "tweak" task with tiddler tweaker control panel (moved from BackstageTweaks)
2008.01.13 [2.2.0] added "auto-selection" links: all, changed, tags, title, text
2007.12.26 [2.1.0] added support for managing 'creator' custom field (see [[CoreTweaks]])
2007.11.01 [2.0.3] added config.options.txtTweakerSortBy for cookie-based persistence of list display order preference setting.
2007.09.28 [2.0.2] in settiddlers() and deltiddlers(), added suspend/resume notification handling (improves performance when operating on multiple tiddlers)
2007.08.03 [2.0.1] added shadow definition for [[TiddlerTweaker]] tiddler for use as parameter references with {{{<<tiddler>>, <<slider>> or <<tabs>>}}} macros.
2007.08.03 [2.0.0] converted from inline script
2006.01.01 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TiddlerTweakerPlugin= {major: 2, minor: 3, revision: 0, date: new Date(2009,1,22)};
// shadow tiddler
config.shadowTiddlers.TiddlerTweaker="<<tiddlerTweaker>>";
/// backstage task
if (config.tasks) { // for TW2.2b3 or above
config.tasks.tweak.tooltip="review/modify tiddler internals: dates, authors, tags, etc.";
config.tasks.tweak.content="{{smallform small groupbox{<<tiddlerTweaker>>}}}";
}
if (config.options.txtTweakerSortBy==undefined) config.options.txtTweakerSortBy="modified";
// if removeCookie() function is not defined by TW core, define it here.
if (window.removeCookie===undefined) {
window.removeCookie=function(name) {
document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;';
}
}
config.macros.tiddlerTweaker = {
html: '<form style="display:inline"><!--\
--><table style="padding:0;margin:0;border:0;width:100%"><tr valign="top" style="padding:0;margin:0;border:0"><!--\
--><td style="text-align:center;white-space:nowrap;width:99%;padding:0;margin:0;border:0"><!--\
--><font size=-2><div style="text-align:left;"><span style="float:right"><!--\
--> <a href="javascript:;" \
title="select all tiddlers"\
onclick="\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++)\
if (f.list.options[t].value.length) f.list.options[t].selected=true;\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">all</a><!--\
--> <a href="javascript:;" \
title="select tiddlers that are new/changed since the last file save"\
onclick="\
var lastmod=new Date(document.lastModified);\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
var tid=store.getTiddler(f.list.options[t].value);\
f.list.options[t].selected=tid&&tid.modified>lastmod;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">changed</a><!--\
--> <a href="javascript:;" \
title="select tiddlers with at least one matching tag"\
onclick="\
var t=prompt(\'Enter space-separated tags (match ONE)\');\
if (!t||!t.length) return false;\
var tags=t.readBracketedList();\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
f.list.options[t].selected=false;\
var tid=store.getTiddler(f.list.options[t].value);\
if (tid&&tid.tags.containsAny(tags)) f.list.options[t].selected=true;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">tags</a><!--\
--> <a href="javascript:;" \
title="select tiddlers whose titles include matching text"\
onclick="\
var txt=prompt(\'Enter a title (or portion of a title) to match\');\
if (!txt||!txt.length) return false;\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
f.list.options[t].selected=f.list.options[t].value.indexOf(txt)!=-1;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">titles</a><!--\
--> <a href="javascript:;" \
title="select tiddlers containing matching text"\
onclick="\
var txt=prompt(\'Enter tiddler text (content) to match\');\
if (!txt||!txt.length) return false;\
var f=this; while (f&&f.nodeName.toLowerCase()!=\'form\')f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
var tt=store.getTiddlerText(f.list.options[t].value,\'\');\
f.list.options[t].selected=(tt.indexOf(txt)!=-1);\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">text</a> <!--\
--></span><span>select tiddlers</span><!--\
--></div><!--\
--></font><select multiple name=list size="11" style="width:99.99%" \
title="use click, shift-click and/or ctrl-click to select multiple tiddler titles" \
onclick="config.macros.tiddlerTweaker.selecttiddlers(this)" \
onchange="config.macros.tiddlerTweaker.setfields(this)"><!--\
--></select><br><!--\
-->show<input type=text size=1 value="11" \
onchange="this.form.list.size=this.value; this.form.list.multiple=(this.value>1);"><!--\
-->by<!--\
--><select name=sortby size=1 \
onchange="config.macros.tiddlerTweaker.init(this.form,this.value)"><!--\
--><option value="title">title</option><!--\
--><option value="size">size</option><!--\
--><option value="modified">modified</option><!--\
--><option value="created">created</option><!--\
--></select><!--\
--><input type="button" value="refresh" \
onclick="config.macros.tiddlerTweaker.init(this.form,this.form.sortby.value)"<!--\
--> <input type="button" name="stats" disabled value="totals..." \
onclick="config.macros.tiddlerTweaker.stats(this)"><!--\
--></td><td style="white-space:nowrap;padding:0;margin:0;border:0;width:1%"><!--\
--><div style="text-align:left"><font size=-2> modify values</font></div><!--\
--><table border=0 style="width:100%;padding:0;margin:0;border:0;"><tr style="padding:0;border:0;"><!--\
--><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=settitle unchecked \
title="allow changes to tiddler title (rename tiddler)" \
onclick="this.form.title.disabled=!this.checked">title<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=title size=35 style="width:98%" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setcreator unchecked \
title="allow changes to tiddler creator" \
onclick="this.form.creator.disabled=!this.checked">created by<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=creator size=35 style="width:98%" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setwho unchecked \
title="allow changes to tiddler author" \
onclick="this.form.who.disabled=!this.checked">modified by<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=who size=35 style="width:98%" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setcdate unchecked \
title="allow changes to created date" \
onclick="var f=this.form; f.cm.disabled=f.cd.disabled=f.cy.disabled=f.ch.disabled=f.cn.disabled=!this.checked"><!--\
-->created on<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=cm size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=cd size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=cy size=4 style="width:3em;padding:0;text-align:center" disabled><!--\
--> at <input type=text name=ch size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> : <input type=text name=cn size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=setmdate unchecked \
title="allow changes to modified date" \
onclick="var f=this.form; f.mm.disabled=f.md.disabled=f.my.disabled=f.mh.disabled=f.mn.disabled=!this.checked"><!--\
-->modified on<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=mm size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=md size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> / <input type=text name=my size=4 style="width:3em;padding:0;text-align:center" disabled><!--\
--> at <input type=text name=mh size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--> : <input type=text name=mn size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=replacetext unchecked\
title="find/replace matching text" \
onclick="this.form.pattern.disabled=this.form.replacement.disabled=!this.checked">replace text<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=pattern size=15 value="" style="width:40%" disabled \
title="enter TEXT PATTERN (regular expression)"> with <!--\
--><input type=text name=replacement size=15 value="" style="width:40%" disabled \
title="enter REPLACEMENT TEXT"><!--\
--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=checkbox name=settags checked \
title="allow changes to tiddler tags" \
onclick="this.form.tags.disabled=!this.checked">tags<!--\
--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
--><input type=text name=tags size=35 value="" style="width:98%" \
title="enter new tags or use \'+tag\' and \'-tag\' to add/remove tags from existing tags"><!--\
--></td></tr></table><!--\
--><div style="text-align:center"><!--\
--><nobr><input type=button name=display disabled style="width:32%" value="display tiddlers" \
onclick="config.macros.tiddlerTweaker.displaytiddlers(this)"><!--\
--> <input type=button name=del disabled style="width:32%" value="delete tiddlers" \
onclick="config.macros.tiddlerTweaker.deltiddlers(this)"><!--\
--> <input type=button name=set disabled style="width:32%" value="update tiddlers" \
onclick="config.macros.tiddlerTweaker.settiddlers(this)"></nobr><!--\
--></div><!--\
--></td></tr></table><!--\
--></form><span style="display:none"><!--content replaced by tiddler "stats"--></span>\
',
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var span=createTiddlyElement(place,"span");
span.innerHTML=this.html;
this.init(span.firstChild,config.options.txtTweakerSortBy);
},
init: function(f,sortby) { // initialize form controls
if (!f) return; // form might not be rendered yet...
while (f.list.options[0]) f.list.options[0]=null; // empty current list content
var tids=store.getTiddlers(sortby);
if (sortby=="size") // descending order (largest tiddlers listed first)
tids.sort(function(a,b) {return a.text.length > b.text.length ? -1 : (a.text.length == b.text.length ? 0 : +1);});
for (i=0; i<tids.length; i++) {
var label=tids[i].title; var value=tids[i].title;
if (sortby=="modified" || sortby=="created") {
label=tids[tids.length-i-1][sortby].formatString("YY.0MM.0DD 0hh:0mm ")+tids[tids.length-i-1].title;
value=tids[tids.length-i-1].title;
}
if (sortby=="size") label="["+tids[i].text.length+"] "+label;
f.list.options[f.list.length]=new Option(label,value,false,false);
}
f.title.value=f.who.value=f.creator.value=f.tags.value="";
f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value="";
f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value="";
f.stats.disabled=f.set.disabled=f.del.disabled=f.display.disabled=true;
f.settitle.disabled=false;
config.options.txtTweakerSortBy=sortby; // remember current setting
f.sortby.value=sortby; // sync droplist selection with current setting
if (sortby!="modified") // non-default preference... save cookie
saveOptionCookie("txtTweakerSortBy");
else removeCookie("txtTweakerSortBy"); // default preference... clear cookie
},
selecttiddlers: function(here) { // enable/disable tweaker fields based on number of items selected
// count how many tiddlers are selected
var f=here.form; var list=f.list;
var c=0; for (i=0;i<list.length;i++) if (list.options[i].selected) c++;
if (c>1) f.title.disabled=true;
if (c>1) f.settitle.checked=false;
f.set.disabled=(c==0);
f.del.disabled=(c==0);
f.display.disabled=(c==0);
f.settitle.disabled=(c>1);
f.stats.disabled=(c==0);
var msg=(c==0)?'select tiddlers':(c+' tiddler'+(c!=1?'s':'')+' selected');
here.previousSibling.firstChild.firstChild.nextSibling.innerHTML=msg;
if (c) clearMessage(); else displayMessage("no tiddlers selected");
},
setfields: function(here) { // set tweaker edit fields from first selected tiddler
var f=here.form;
if (!here.value.length) {
f.title.value=f.who.value=f.creator.value=f.tags.value="";
f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value="";
f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value="";
return;
}
var tid=store.getTiddler(here.value); if (!tid) return;
f.title.value=tid.title;
f.who.value=tid.modifier;
f.creator.value=tid.fields['creator']||''; // custom field - might not exist
f.tags.value=tid.tags.join(' ');
var c=tid.created; var m=tid.modified;
f.cm.value=c.getMonth()+1;
f.cd.value=c.getDate();
f.cy.value=c.getFullYear();
f.ch.value=c.getHours();
f.cn.value=c.getMinutes();
f.mm.value=m.getMonth()+1;
f.md.value=m.getDate();
f.my.value=m.getFullYear();
f.mh.value=m.getHours();
f.mn.value=m.getMinutes();
},
settiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
var cdate=new Date(f.cy.value,f.cm.value-1,f.cd.value,f.ch.value,f.cn.value);
var mdate=new Date(f.my.value,f.mm.value-1,f.md.value,f.mh.value,f.mn.value);
if (tids.length>1 && !confirm("Are you sure you want to update these tiddlers:\n\n"+tids.join(', '))) return;
store.suspendNotifications();
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
var title=!f.settitle.checked?tid.title:f.title.value;
var who=!f.setwho.checked?tid.modifier:f.who.value;
var text=tid.text;
if (f.replacetext.checked) text=text.replace(new RegExp(f.pattern.value,'mg'),f.replacement.value);
var tags=tid.tags;
if (f.settags.checked) {
var intags=f.tags.value.readBracketedList();
var addtags=[]; var deltags=[]; var reptags=[];
for (i=0;i<intags.length;i++) {
if (intags[i].substr(0,1)=='+')
addtags.push(intags[i].substr(1));
else if (intags[i].substr(0,1)=='-')
deltags.push(intags[i].substr(1));
else
reptags.push(intags[i]);
}
if (reptags.length)
tags=reptags;
if (addtags.length)
tags=new Array().concat(tags,addtags);
if (deltags.length)
for (i=0;i<deltags.length;i++)
{ var pos=tags.indexOf(deltags[i]); if (pos!=-1) tags.splice(pos,1); }
}
if (!f.setcdate.checked) cdate=tid.created;
if (!f.setmdate.checked) mdate=tid.modified;
store.saveTiddler(tid.title,title,text,who,mdate,tags,tid.fields);
if (f.setcreator.checked) store.setValue(tid.title,'creator',f.creator.value); // set creator
if (f.setcdate.checked) tid.assign(null,null,null,null,null,cdate); // set create date
}
store.resumeNotifications();
this.init(f,f.sortby.value);
},
displaytiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0; i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
story.displayTiddlers(story.findContainingTiddler(f),tids)
},
deltiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
if (!confirm("Are you sure you want to delete these tiddlers:\n\n"+tids.join(', '))) return;
store.suspendNotifications();
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
if (tid.tags.contains("systemConfig"))
if (!confirm("'"+tid.title+"' is tagged with 'systemConfig'.\n\nRemoving this tiddler may cause unexpected results. Are you sure?"))
continue;
store.removeTiddler(tid.title);
story.closeTiddler(tid.title);
}
store.resumeNotifications();
this.init(f,f.sortby.value);
},
stats: function(here) {
var f=here.form; var list=f.list; var tids=[]; var out=''; var tot=0;
var target=f.nextSibling;
for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler"); return; }
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
out+='[['+tid.title+']] '+tid.text.length+'\n'; tot+=tid.text.length;
}
var avg=tot/tids.length;
out=tot+' bytes in '+tids.length+' selected tiddlers ('+avg+' bytes/tiddler)\n<<<\n'+out+'<<<\n';
removeChildren(target);
target.innerHTML="<hr><font size=-2><a href='javascript:;' style='float:right' "
+"onclick='this.parentNode.parentNode.style.display=\"none\"'>close</a></font>";
wikify(out,target);
target.style.display="block";
}
};
//}}}
<<forEachTiddler where 'tiddler.tags.contains("Bøger")&& tiddler.data("wherekept") && tiddler.title.contains(context.viewerTiddler.title)'
sortBy 'tiddler.data("wherekept")'
write
'" [[Elev|"+tiddler.data("wherekept")+"]] "'
none '"//ingen \"elev\" har læst den endnu//"'
>>
----
{{invisibletable{
| <<tiddler TabFag>> | <<tagglyTagging Fag>> |
----
{{wrap{
{{mmheading{Oversigt over fag}}}
<<treeview2 "Timer" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Timer-ID"' >>
{{mmheading{Oversigt over reservationer}}}
<<treeview2 "Reservationer" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "Reservation-ID"' >>
/%
|Name|ToggleLeftSidebar|
|Source|http://www.TiddlyTools.com/#ToggleLeftSidebar|
|Version|2.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|show/hide left sidebar (MainMenu)|
Usage: <<tiddler ToggleLeftSidebar with: "label">>
Config settings:
config.options.chkShowLeftSidebar (true)
config.options.txtToggleLeftSideBarLabelShow (►)
config.options.txtToggleLeftSideBarLabelHide (◄)
%/<script label="$1" title="show/hide MainMenu content">
var co=config.options;
if (co.chkShowLeftSidebar=='undefined') co.chkShowLeftSidebar=true;
co.chkShowLeftSidebar=!co.chkShowLeftSidebar;
var mm=document.getElementById('mainMenu'); if (!mm) return;
mm.style.display=co.chkShowLeftSidebar?'block':'none';
document.getElementById('displayArea').style.marginLeft=co.chkShowLeftSidebar?'':'1em';
saveOptionCookie('chkShowLeftSidebar');
var labelShow=co.txtToggleLeftSideBarLabelShow||'►';
var labelHide=co.txtToggleLeftSideBarLabelHide||'◄';
if (typeof(place)!='undefined' && '$1'=='$'+'1') {
place.innerHTML=co.chkShowLeftSidebar?labelHide:labelShow;
place.title=(co.chkShowLeftSidebar?'hide':'show')+' left sidebar';
}
var sm=document.getElementById('storyMenu'); if (sm) config.refreshers.content(sm);
</script><script>
var co=config.options;
if (co.chkShowLeftSidebar=='undefined') co.chkShowLeftSidebar=true;
var mm=document.getElementById('mainMenu'); if (!mm) return;
mm.style.display=co.chkShowLeftSidebar?'block':'none';
document.getElementById('displayArea').style.marginLeft=co.chkShowLeftSidebar?'':'1em';
if ('$1'=='$'+'1') {
var labelShow=co.txtToggleLeftSideBarLabelShow||'►';
var labelHide=co.txtToggleLeftSideBarLabelHide||'◄';
place.lastChild.innerHTML=co.chkShowLeftSidebar?labelHide:labelShow;
place.lastChild.title=(co.chkShowLeftSidebar?'hide':'show')+' left sidebar';
}
</script>
/%
|Name|ToggleRightSidebar|
|Source|http://www.TiddlyTools.com/#ToggleRightSidebar|
|Version|2.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|show/hide right sidebar (MainMenu)|
Usage: <<tiddler ToggleRightSidebar with: "label">>
Config settings:
config.options.chkShowRightSidebar (true)
config.options.txtToggleRightSideBarLabelShow (◄)
config.options.txtToggleRightSideBarLabelHide (►)
%/<script label="$1" title="show/hide right sidebar content">
var co=config.options;
if (co.chkShowRightSidebar=='undefined') co.chkShowRightSidebar=true;
co.chkShowRightSidebar=!co.chkShowRightSidebar;
var sb=document.getElementById('sidebar'); if (!sb) return;
sb.style.display=co.chkShowRightSidebar?'block':'none';
document.getElementById('displayArea').style.marginRight=co.chkShowRightSidebar?'':'1em';
saveOptionCookie('chkShowRightSidebar');
var labelShow=co.txtToggleRightSideBarLabelShow||'◄';
var labelHide=co.txtToggleRightSideBarLabelHide||'►';
if (typeof(place)!='undefined' && '$1'=='$'+'1') {
place.innerHTML=co.chkShowRightSidebar?labelHide:labelShow;
place.title=(co.chkShowRightSidebar?'hide':'show')+' right sidebar';
}
var sm=document.getElementById('storyMenu'); if (sm) config.refreshers.content(sm);
</script><script>
var co=config.options;
if (co.chkShowRightSidebar=='undefined') co.chkShowRightSidebar=true;
var sb=document.getElementById('sidebar'); if (!sb) return;
sb.style.display=co.chkShowRightSidebar?'block':'none';
document.getElementById('displayArea').style.marginRight=co.chkShowRightSidebar?'':'1em';
if ('$1'=='$'+'1') {
var labelShow=co.txtToggleRightSideBarLabelShow||'◄';
var labelHide=co.txtToggleRightSideBarLabelHide||'►';
place.lastChild.innerHTML=co.chkShowRightSidebar?labelHide:labelShow;
place.lastChild.title=(co.chkShowRightSidebar?'hide':'show')+' right sidebar';
}
</script>
<html><a href="javascript:;"
onclick="config.options.chkDisableTabsBar=!
config.options.chkDisableTabsBar;refreshPageTemplate();return
false;">toggle tiddler tabs</a></html>
/***
|Name:|ToggleTagPlugin|
|Description:|Makes a checkbox which toggles a tag in a tiddler|
|Version:|3.1.0 ($Rev: 4907 $)|
|Date:|$Date: 2008-05-13 03:15:46 +1000 (Tue, 13 May 2008) $|
|Source:|http://mptw.tiddlyspot.com/#ToggleTagPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Usage
{{{<<toggleTag }}}//{{{TagName TiddlerName LabelText}}}//{{{>>}}}
* TagName - the tag to be toggled, default value "checked"
* TiddlerName - the tiddler to toggle the tag in, default value the current tiddler
* LabelText - the text (gets wikified) to put next to the check box, default value is '{{{[[TagName]]}}}' or '{{{[[TagName]] [[TiddlerName]]}}}'
(If a parameter is '.' then the default will be used)
* TouchMod flag - if non empty then touch the tiddlers mod date. Note, can set config.toggleTagAlwaysTouchModDate to always touch mod date
!!Examples
|Code|Description|Example|h
|{{{<<toggleTag>>}}}|Toggles the default tag (checked) in this tiddler|<<toggleTag>>|
|{{{<<toggleTag TagName>>}}}|Toggles the TagName tag in this tiddler|<<toggleTag TagName>>|
|{{{<<toggleTag TagName TiddlerName>>}}}|Toggles the TagName tag in the TiddlerName tiddler|<<toggleTag TagName TiddlerName>>|
|{{{<<toggleTag TagName TiddlerName 'click me'>>}}}|Same but with custom label|<<toggleTag TagName TiddlerName 'click me'>>|
|{{{<<toggleTag . . 'click me'>>}}}|dot means use default value|<<toggleTag . . 'click me'>>|
!!Notes
* If TiddlerName doesn't exist it will be silently created
* Set label to '-' to specify no label
* See also http://mgtd-alpha.tiddlyspot.com/#ToggleTag2
!!Known issues
* Doesn't smoothly handle the case where you toggle a tag in a tiddler that is current open for editing
* Should convert to use named params
***/
//{{{
if (config.toggleTagAlwaysTouchModDate == undefined) config.toggleTagAlwaysTouchModDate = false;
merge(config.macros,{
toggleTag: {
createIfRequired: true,
shortLabel: "[[%0]]",
longLabel: "[[%0]] [[%1]]",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var tiddlerTitle = tiddler ? tiddler.title : '';
var tag = (params[0] && params[0] != '.') ? params[0] : "checked";
var title = (params[1] && params[1] != '.') ? params[1] : tiddlerTitle;
var defaultLabel = (title == tiddlerTitle ? this.shortLabel : this.longLabel);
var label = (params[2] && params[2] != '.') ? params[2] : defaultLabel;
var touchMod = (params[3] && params[3] != '.') ? params[3] : "";
label = (label == '-' ? '' : label); // dash means no label
var theTiddler = (title == tiddlerTitle ? tiddler : store.getTiddler(title));
var cb = createTiddlyCheckbox(place, label.format([tag,title]), theTiddler && theTiddler.isTagged(tag), function(e) {
if (!store.tiddlerExists(title)) {
if (config.macros.toggleTag.createIfRequired) {
var content = store.getTiddlerText(title); // just in case it's a shadow
store.saveTiddler(title,title,content?content:"",config.options.txtUserName,new Date(),null);
}
else
return false;
}
if ((touchMod != "" || config.toggleTagAlwaysTouchModDate) && theTiddler)
theTiddler.modified = new Date();
store.setTiddlerTag(title,this.checked,tag);
return true;
});
}
}
});
//}}}
Du kan slå ~TiddlerBar til og fra for at printe flere tiddlere på een gang. Når fanerne er slået fra vil alle tiddlere vises under hinanden.
Sæt flueben og <<toolbar closeTiddler>> for at slå ~TiddlerBar faner fra.
/%
|Name|ToggleTiddlersBar|
|Source|http://www.TiddlyTools.com/#ToggleBreadcrumbs|
|Version|0.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|BreadcrumbsPlugin, InlineJavascriptPlugin|
|Overrides||
|Description|dynamically enable/disable BreadcrumbsPlugin display|
%/{{nowrap{<script>
if (config.options.chkDisableTabsBar==undefined) config.options.chkDisableTabsBar=true;
</script><<option chkDisableTabsBar>><script>
var chk=place.lastChild;
chk.coreOnChange=chk.onchange;
chk.onchange=function() {
if (this.coreOnChange) this.coreOnChange.apply(this,arguments);
this.checked=config.options.chkDisableTabsBar;
if (config.macros.DisableTabsBar) config.macros.DisableTabsBar.refresh();
return
};
</script>
Fjern fluebenet og <<toolbar closeTiddler>> for at få fanerne tilbage igen.
|~ViewToolbar|closeTiddler closeOthers closeAll +editTiddler > fullscreen < * fields editHtml permalink > < * references syncing snapshotSave snapshotPrint jump|
|~EditToolbar|+saveTiddler saveCloseTiddler -cancelTiddler cancelCloseTiddler deleteTiddler|
<html><hide linebreaks><div id="slantedmenu" style="font-size:0.75em;"><ul><li>[[hjælp|Intro Treeview]]</li><li><<newTiddler>></li><li><<saveChanges>></li><li>{{nowrap{<<search>><<option chkUseYourSearch>>}}}</li><li>[[?|Find]]</li><li>[[faner til/fra»|ToggleTiddlersBar]]</li><li><<tiddler ToggleLeftSidebar with: "«Hovedmenu">><<fullscreen>><<tiddler ToggleRightSidebar with: "Sidepanel»">><<tiddler GenOpfrisk>></li></ul>></div></html>
/***
!!!<<gradient horiz #4EB93E #fff >><<tiddler RefreshStyles>> TopMenuStyle>>/%==================================================%/
***/
#topMenu{
font-size: 1.4em;
}
#slantedmenu:after{ /*Add margin between menu and rest of content in Firefox*/
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#slantedmenu ul{
text-indent: 10px;
padding: 3px 0;
margin: 0;
background:url([[navbargrayhw1.gif]]) repeat-x top left;top left;
background-color: #ccc;
border-top: 0px solid #f6f;
border-bottom: 0px solid #f6f;
text-align: center; /*set value to "center" for example to center items*/
}
#slantedmenu ul li{
display: inline;
}
#slantedmenu ul li a {
font-weight: normal;
color: #080;
padding: 3px 0;
padding-right: 5px;
padding-left: 5px;
margin: 0;
text-decoration: none;
background: transparent url([[mainmenugray7ef.gif]]) top right no-repeat;
}
#slantedmenu ul li a:hover{
color: #f00;
background:#fff;
}
/***
!!!SlantedStyle /%==================================================%/
***/
{{{
http://img261.imageshack.us/img261/8603/navbargrayhw1.png
http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif
background-image: url("http://img264.imageshack.us/img264/4134/headbackbgdc6.png");background-repeat: repeat-x top-left;
}}}
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
{{{
#slantedmenu{
font-size: 90%;
position: fixed !important;
width: 100%;
z-index:1
}
}}}
#slantedmenu{
font-size: 90%;}
#slantedmenu:after{ /*Add margin between menu and rest of content in Firefox*/
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#slantedmenu ul{
text-indent: 10px;
padding: 3px 0;
margin: 0;
background:url([[navbargrayhw1.gif]]) repeat-x top left;top left;
background-color: #ccc;
border-top: 0px solid #f6f;
border-bottom: 0px solid #f6f;
text-align: center; /*set value to "center" for example to center items*/
}
#slantedmenu ul li{
display: inline;
}
#slantedmenu ul li a{
font-weight: normal;
color: #00a;
padding: 3px 0;
padding-right: 5px;
padding-left: 5px;
margin: 0;
text-decoration: none;
background: transparent url([[mainmenugray7ef.gif]]) top right no-repeat;
}
#slantedmenu ul li a:hover{
color: #f00;
background:#fff;
}
/***
|Name|TreeviewPluginPlugin2|
|Source|http://treeview.tiddlyspot.com/|
|Version|0.24|
|Author|MarkS|
|License|Various. See respective libraries for details|
|Type|plugin|
|Requires(1) |jQuery library, treeview plugin libraries and styles |
|Requires(2) |AttachFilePackage and sub-libraries from tiddlytools.com if you want to use embedded images to create the tree|
|Description|Creates a tag tree, formatted as an actual tree |
|Status|Experimental - ALPHA, but built on fairly solid technologies|
|Warning|When creating tag trees, make sure no tiddler loops back on itself, or its likely the script will hang|
!!!!Set up for portability
You will need a version of TW that incorporates the jQuery library. That happens automatically with recent editions of TW. You will also need to install or access the treeview libraries from http:www.dynamicdrive.com. The libraries can be carried as local files, inserted in the MarkupPostBody, or referenced from the dynamicdrive site. Each approach will require a different set up.
You will also need to link in the stylesheet for the treeview objects. A quick way to do this is to put:
>{{{<link rel="stylesheet" type="text/css" href="http://www.dynamicdrive.com/dynamicindex1/treeview/jquery.treeview.css" /> }}}
into the MarkupPreHead tiddler. However, this won't work if you go off line. It also doesn't work permanently if you are hosting your file on a web server. So you may want to download a copy of the stylesheet and attendant image files and change the MarkupPreHead tiddler to pick up the local copy. Or load the stylesheet and images onto your own server where you will be able to access them.
!!!!Usage
{{{<<treeview2 }}}
>{{{<root tag> [tree style] [startup parameters]}}}
{{{ >>}}}
!!!!!Where:
''root tag'' is the tag at the top of your tagging tree, i.e. the mother of all tiddlers related to it by using its name as one of their tags.
''tree style'' indicates which type of tree will be displayed, possibly //treeview//, //filetree//, and //treeview-red//, and //treeview-famfamfam//. There may be other styles too, but those are the ones I know about.
''startup parameters'' are a set of optional parameters given in a comma-separated, key/value string like this:
>{{{'collapsed: false, animated: "normal", persist: true'}}}
There's a list of possible options at:
http://www.dynamicdrive.com/dynamicindex1/treeview/index.htm
However, not all settings may actually work under TW. Mainly, you will probably be interested in controlling the presence of animation, and whether the initial state of the tree is opened or closed.
!!!!Images and stylesheet set-up
The tree is constructed from little bits of images. If you don't want to carry these images in a separate directory, nor reference them remotely, you can embed them in your TW file. To do this, you will need the AttachFilePackage and accompanying plugins from
> www.tiddlytools.com
and you will need the AttachFilePluginFormatters plugin from the same site.
Then import all the tiddlers from this file tagged as treeviewimage . These images are referenced in the StyleSheet. If you import JqueryTreeviewCss from this file, and then put the name in your StyleSheet, the images should be imported without having to access them remotely.
!!!!Persistence
To make persistence work, you will need to have the treeview cookie library loaded. The easiest way to do that is to put:
>{{{<script src="http://www.dynamicdrive.com/dynamicindex1/treeview/lib/jquery.cookie.js" type="text/javascript"></script>}}}
into the MarkupPostBody. However, this technique will only work if you have online access. If you will be working offline, then you will either need to download the cookie library to the same directory as your ~TiddlyWiki file and put the following into your MarkupPostBody:
>>{{{<script src="jquery.cookie.js"></script>}}}
or you will need to put the entire contents of the cookie library into script tags inside the MarkupPostBody.
Then, in any macro that wants its tree to be persistently configured, you will need to use configuration parameter:
>>{{{persist: "cookie", cookieId: "myid"}}}
where //myid// should be an identification that will be unique throughout the entire TW file.
***/
//{{{
config.macros.treeview2 = {
handler: function (place, macroName, params, wikifier, paramString, tiddler)
{ // Code here
var lcTag = params[0] ;
var lcClass = params[1] ? params[1] : "treeview" ;
var DEV_MODE = false ; // Make true when developing code or changes won't show up.
try {
if( MAS === undefined ) MAS = { } ;
} catch(ex) {
MAS = {} ;
}
MAS.treeviewSettings = function(obj) {
var defa = {} ;
defa.collapsed= true;
defa.unique = true ;
//defa.persist= "location" ;
if( obj !== undefined ) {
try {
obj = eval("({" + obj + "})" ) ;
} catch(ex) {
alert("Unable to use your treeview configuration settings!") ;
return defa ;
}
for (var prop in obj) {
defa[prop] =obj[prop] ;
}
}
return defa ;
} ;
if( DEV_MODE || MAS.getTiddlersPerTagAsHtmlList === undefined ) {
MAS.getTiddlersPerTagAsHtmlList = function(tagname,setup) {
var tids = store.getTaggedTiddlers(tagname) ;
var temp = "" ;
var prefix = tids.length > 0 ? "<span class='folder'>" : "<span class='file'>" ;
var statetags = store.getTiddler(tagname).tags ;
var state = "" ;
var lcSesame = setup["sesame"] !== undefined ? setup["sesame"] : "" ;
var lcAntiSesame = setup["antisesame"] !== undefined ? setup["antisesame"] : "" ;
if(statetags.length > 0 ) {
if(lcSesame) state = statetags.contains(lcSesame) ? ' class="open"' : ' class="closed"' ;
if(lcAntiSesame) state = statetags.contains(lcAntiSesame) ? ' class="closed"' : ' class="open"' ;
}
// state="" ; // DEBUG
//var rtn ="<li>" + prefix + tagname + "</a></span>" ;
var rtn = "<li" + state +">" + prefix + "<a href=\"javascript:;\" tiddlylink=\"" + tagname + "\" refresh=\"link\" class='tiddlyLink tiddlyLinkExisting' title='Link to " + tagname + "' >" + tagname + "</a></span>" ;
//wikify(rtn,place) ;
forever:
while(true) {
if(tids.length == 0 ) break ;
rtn = rtn + "<ul>" ;
for(var i=0;i<tids.length;i++) {
temp = MAS.getTiddlersPerTagAsHtmlList(tids[i].title, setup) ;
rtn = rtn + temp ;
}
rtn = rtn + "</ul>\n" ;
break ;
} // forever
rtn = rtn + "</li>\n" ;
return rtn ;
} ; // End of function definition
} // End of checking if function already defined
// The extra set of span tags are needed here because jquery find function ignores
// the outer set of tags. Or at least that's what seems to be happening. So, I give
// it an extra set so it can throw it away without consequence
var loSetup = MAS.treeviewSettings(params[2]) ;
var lcId = "root" + (new Date()).getTime().toString() ;
if(loSetup.cookieId) {
lcId = "root_" + loSetup.cookieId ;
}
//var a = '<span id="' + lcId + '"><ul id="' + "root" + '" >' + MAS.getTiddlersPerTagAsHtmlList(lcTag, loSetup) + "</ul></span>" ;
var a = '<ul id="' + lcId + '" >' + MAS.getTiddlersPerTagAsHtmlList(lcTag, loSetup) + "</ul>" ;
var b = jQuery(a) ;
// A smarter person might have know how to put the onclick function in at the top
b.find("a").each(function(n) {
this.onclick = onClickTiddlerLink ;
}) ;
//b.find(lcId).attr("class",lcClass) ;
//b.find("#root").attr("class",lcClass) ;
jQuery(place).append(b) ;
jQuery(place).find("#" + lcId).attr("class",lcClass).treeview(loSetup) ;
}
};
//}}}
/***
|Name|TwHelpSearchPlugin|
|Source|http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin|
|Documentation|http://twhelp.tiddlyspot.com/#TWHelpSearchDoc|
|Version|1.0.7|
|Author|Morris Gray|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.0 - 2.4|
|Type|plugin|
|Requires|[[SearchOptionsPlugin|http://www.TiddlyTools.com/#SearchOptionsPlugin]] [[TableSortingPlugin|http://tw.lewcid.org/#TableSortingPlugin]] (only for sorting option)|
|Overrides|SearchOptionsPlugin's search results|
|Description|Extends the search results from SearchOptionsPlugin to a sortable table showing title, size and tags.|
''Demo search:''
|>|>|>|<<search>> |
|>|>| look for in |>|>|>|
| <<option chkSearchTitles>> | <<option chkSearchText>> | <<option chkSearchTags>> | <<option chkHoldSearches>> |
| titles | text | tags | hold |
''A Plugin Tweak for:'' SearchOptionsPlugin
!!!!!Description
<<<
This plugin defines an alternative format for the SearchResults tiddler that is generated by the SearchOptionsPlugin . It presents the search results in tabular form numbering the rows; and showing the tiddler title, the size in bytes, and the tags. It is ready to be used with the [[TableSortingPlugin|http://tw.lewcid.org/#TableSortingPlugin]] (check versions) so any column can be sorted; such as size in ascending or descending order.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your ~TiddlyWiki:
* http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
*SearchOptionsPlugin from http://www.tiddlytools.com/#SearchOptionsPlugin
* Get more documentation here [[TWHelpSearchDoc]] or here:
* http://twhelp.tiddlyspot.com/#TwHelpSearchDoc
<<<
!!!!!Revision History
<<<
''2009.02.18 [1.0.7]''
Removed text coloring of headers re: conflict with TableSortingPlugin refresh.
''2008.09.14 [1.0.6]''
Cosmetic - Add header.
''2007.09.12 [1.0.6]''
Added overflow scroll to TWHelp-SearchResults for long titles or tags.
''2006.02.03 [1.0.5]''
Added facility for holding the results of multiple searches with tick box on dashboard.
''2006.02.02 [1.0.4]''
Added several options, cleaned up design.Planning one version basic and one with added options this is the added options version.
''2006.01.27 [1.0.3''
Added a column for the size of the text in each tiddler, this does not include the size of the title or tags. Added overall TW statistics button requires TiddlerStatsPlugin.
''2006.01.23 [1.0.2 ]''
''a)''Changed function reportSearchResults(text,matches) to window.reportSearchResults=function(text,matches)
''b)''Added a line so that Incremental Search is automatically disabled config.options.chkSearchIncremental=false; turn off key-by-key searching
''c)''Removed space inside parens. bgcolor(#fe8 )" to "bgcolor(#fe8)". This
is what was causing IE to 'crap out' halfway through drawing the table
headings.
''d)''Added {{{config.options.chkSearchList=true;}}}
''2006.01.20 [1.0.1]''
ELS: reportSearchResults() definition moved to this Plugin Tweak tiddler and removed extranous code
''2006.01.19 [1.0.0]''
This is an adaptation of Eric Shulman's SearchOptionsPlugin. Adapted by MorrisGray to provide search results in table form. All the necessary controls for refining the search is provided within the table including slide-down access to AdvancedOptions.
<<<
!!!!!Code
***/
//{{{
if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
if (config.options.chkRegExpSearch==undefined) config.options.chkRegExpSearch=true;
if (config.options.chkSearchTitles==undefined) config.options.chkSearchTitles=false;
if (config.options.chkSearchText==undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags==undefined) config.options.chkSearchTags=false;
if (config.options.chkSearchTitlesFirst==undefined) config.options.chkSearchTitlesFirst=true;
if (config.options.chkSearchList==undefined) config.options.chkSearchList=true;
if (config.options.chkSearchIncremental==undefined) config.options.chkSearchIncremental=false;
if (config.options.chkToggleLinks==true) config.options.chkToggleLinks=false;
if (config.options.chkHoldSearches==undefined) config.options.chkHoldSearches=false;
if (config.options.chkSortTags==undefined) config.options.chkSortTags=false;
config.options.chkToggleLinks=false;
config.options.chkSinglePageMode=false;
config.options.chkHoldSearches=false;
config.options.chkSearchIncremental=false;
config.options.chkHttpReadOnly = false;
config.options.chkRegExpSearch=true;
config.options.chkSearchList=true;
config.options.chkToggleLinks=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkHoldSearches>> Hold search results";
//}}}
//{{{
// Give the report a custom name
config.macros.search.reportTitle="TWHelp-SearchResults";
// Override default SearchOptionsPlugin formatting for SearchResults tiddler
window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
config.macros.search.reportTitle;
var q = config.options.chkRegExpSearch ? "/" : "'";
if (!config.options.chkHoldSearches) body="";
body+="\n|>|bgcolor:#8af;@@color(#000080):''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''@@|bgcolor:#8af; @@color:#A00000; SearchHelp@@ "+"|"+"\n";
body+="|>|>|bgcolor:#E3FFE3;<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |"+"\n";
body+="\n|bgcolor:#8af; |bgcolor:#8af; sort by:''Titles'' |bgcolor:#8af; ''Size'' |bgcolor:#8af; ''Tags'' |h";
for(var t=0;t<matches.length;t++)
body+="\n"+"| "+(t+1)+"|[["+matches[t].title+"]]| "+matches[t].text.length+"|"+matches[t].tags+"|";
body+="\n|sortable|k";
body+="\n";
// create/update the tiddler
var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch killbookmark");
store.addTiddler(tiddler); story.closeTiddler(title);
// render tiddler
var oldprompt=config.macros.search.label;
config.macros.search.label="search again"; // use alternate "search again" label
story.displayTiddler(null,title,1); // force refresh
config.macros.search.label=oldprompt; // restore standard search label
}
//}}}
{{textcenter{
@@padding-left:45%;+++[Søg Tweets]...<br><<tiddler TwitterTabs>>
<<tiddler HideTiddlerBackground>><<tiddler HideTiddlerTags>>/%
- - - - - TAB DEFINITIONS - - - - -
%/<<tabs twitterTabs
'søg' 'søg efter tweets' [[TwitterTabs##searchForm]]
'Efterskole' 'tweets om efterskole' [[TwitterTabs##Efterskole]]
'TiddlyWiki' 'tweets fra TiddlyWiki' [[TwitterTabs##TiddlyWiki]]
'tiddlytools' 'tweets fra tiddlytools' [[TwitterTabs##tiddlytools]]
>>/%
!searchForm
<<tiddler [[TwitterTabs##searchForTweets]]
with: {{config.options.txtTweetSearch=config.options.txtTweetSearch||'TiddlyWiki'}}>>
!Efterskole
<<tiddler [[TwitterTabs##searchForTweets]] with:'efterskole'>>
!TiddlyWiki
<<tiddler [[TwitterTabs##showUserTweets]] with: TiddlyWiki>>
!tiddlytools
<<tiddler [[TwitterTabs##showUserTweets]] with: tiddlytools>>
!end
- - - - - TAB CONTENT FORMATTING - - - - -
!searchForTweets
Søg efter tweets som indeholder: <<option txtTweetSearch>> {{fine{//(indskriv tekst, klik derefter på 'søg' fanen igen for at opdatere resultater)//}}}
''__[[aktuelle tweets om: "$1"|http://search.twitter.com/search?q=$1]]__''
<hr>@@display:block;height:30em;overflow:auto;
<script src="http://search.twitter.com/search.json?q=$1&rpp=25&callback=twitterCallback">
window.twitterPlace=place;
</script>@@@@display:block;text-align:right;^^rul ned for at se flere...^^@@
!end
!showUserTweets
''__[[seneste tweets fra $1|http://twitter.com/$1]]__''
<hr>@@display:block;height:30em;overflow:auto;
<script src="http://twitter.com/statuses/user_timeline/$1.json?callback=twitterCallback">
window.twitterPlace=place;
</script>@@@@display:block;text-align:right;^^rul ned for at se flere...^^@@
!end
- - - - - CALLBACK RENDERING FUNCTION - - - - -
%/<script>
window.twitterCallback=function(data){ // render data items returned from twitter.com
var fmt=store.getTiddlerText('TwitterTabs##itemFormat');
if (data.results) data=data.results; // for SEARCH results
for (var i=0; i<data.length; i++) { var item=data[i];
var img=item.user? item.user.profile_image_url : item.profile_image_url;
var who=item.user? item.user.screen_name : item.from_user;
wikify(fmt.format([img,who,item.text,item.created_at]),window.twitterPlace);
}
}
</script>/%
- - - - - TWEET ITEM FORMAT - - - - -
!itemFormat
[<img(48px+,48px+)[%0]][[%1|http://twitter.com/%1]]: %2
{{fine{
%3}}} {{clear{
}}}<br>
!end
NOTE: (48px+,48px+) syntax requires [[ImageSizePlugin]]
%/
<<forEachTiddler
where
'tiddler.tags.contains("Fag") && tiddler.fields["tiddler.title"]=="true" '
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"hold\" er oprettede endnu//"'
>>
[[M|mandag]][_(mandag@)][[T|tirsdag]][_(tirsdag@)][[O|onsdag]][_(onsdag@)][[T|torsdag]][_(torsdag@)][[F|fredag]][_(fredag@)]
| [[Mandag|mandag]] | [[Tirsdag|tirsdag]] | [[Onsdag|onsdag]] | [[Torsdag|torsdag]] | [[Fredag|fredag]] |h
|<<tiddler mandag>> |<<tiddler tirsdag>> |<<tiddler onsdag>> |<<tiddler torsdag>> |<<tiddler fredag>> |
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 15/06/2009 22:58:13 | DitNavn | [[/|http://el0809.tiddlyspot.com/#%5B%5BBrev%20til%20Herdis%5D%5D]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | backup |
| 16/06/2009 00:11:38 | DitNavn | [[index.html|http://el0809.tiddlyspot.com/index.html#ListboxPlugin]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | backup | ok |
| 16/06/2009 00:45:53 | DitNavn | [[index.html|http://el0809.tiddlyspot.com/index.html#%5B%5BBrev%20til%20Herdis%5D%5D]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | backup |
| 23/06/2009 21:48:42 | DitNavn | [[/|http://el0809.tiddlyspot.com/#%5B%5BStartet%20tr%C3%A5d%20Re%3ASubj%20(MaMa)%5D%5D]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | backup | ok |
| 23/06/2009 22:08:30 | DitNavn | [[/|http://el0809.tiddlyspot.com/#%5B%5BStartet%20tr%C3%A5d%20Re%3ASubj%20(MaMa)%5D%5D]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | backup | ok |
| 23/06/2009 22:33:36 | DitNavn | [[/|http://el0809.tiddlyspot.com/#%5B%5BSvar%20II%20p%C3%A5%20tr%C3%A5d%20(humama)%5D%5D]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | backup |
| 16/08/2011 23:33:06 | DitNavn | [[/|http://el0809.tiddlyspot.com/#testKontakt]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | |
| 16/08/2011 23:35:42 | DitNavn | [[/|http://el0809.tiddlyspot.com/#testKontakt]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | |
| 16/08/2011 23:43:51 | DitNavn | [[/|http://el0809.tiddlyspot.com/#testKontakt]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | |
| 17/08/2011 00:20:22 | DitNavn | [[/|http://el0809.tiddlyspot.com/#testKontakt]] | [[store.cgi|http://el0809.tiddlyspot.com/store.cgi]] | . | [[index.html | http://el0809.tiddlyspot.com/index.html]] | |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
major: 4, minor: 1, revision: 3,
date: new Date("Feb 24, 2008"),
source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
coreVersion: '2.2.0'
};
//
// Environment
//
if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false; // true to activate both in Plugin and UploadService
//
// Upload Macro
//
config.macros.upload = {
// default values
defaultBackupDir: '', //no backup
defaultStoreScript: "store.php",
defaultToFilename: "index.html",
defaultUploadDir: ".",
authenticateUser: true // UploadService Authenticate User
};
config.macros.upload.label = {
promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
promptParamMacro: "Save and Upload this TiddlyWiki in %0",
saveLabel: "save to web",
saveToDisk: "save to disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "No store URL in parmeters or options",
usernameOrPasswordMissing: "Username or password missing"
};
config.macros.upload.handler = function(place,macroName,params) {
if (readOnly)
return;
var label;
if (document.location.toString().substr(0,4) == "http")
label = this.label.saveLabel;
else
label = this.label.uploadLabel;
var prompt;
if (params[0]) {
prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0],
(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
} else {
prompt = this.label.promptOption;
}
createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};
config.macros.upload.action = function(params)
{
// for missing macro parameter set value from options
if (!params) params = {};
var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
var username = params[4] ? params[4] : config.options.txtUploadUserName;
var password = config.options.pasUploadPassword; // for security reason no password as macro parameter
// for still missing parameter set default value
if ((!storeUrl) && (document.location.toString().substr(0,4) == "http"))
storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
if (storeUrl.substr(0,4) != "http")
storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
if (!toFilename)
toFilename = bidix.basename(window.location.toString());
if (!toFilename)
toFilename = config.macros.upload.defaultToFilename;
if (!uploadDir)
uploadDir = config.macros.upload.defaultUploadDir;
if (!backupDir)
backupDir = config.macros.upload.defaultBackupDir;
// report error if still missing
if (!storeUrl) {
alert(config.macros.upload.messages.noStoreUrl);
clearMessage();
return false;
}
if (config.macros.upload.authenticateUser && (!username || !password)) {
alert(config.macros.upload.messages.usernameOrPasswordMissing);
clearMessage();
return false;
}
bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password);
return false;
};
config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir)
{
if (!storeUrl)
return null;
var dest = bidix.dirname(storeUrl);
if (uploadDir && uploadDir != '.')
dest = dest + '/' + uploadDir;
dest = dest + '/' + toFilename;
return dest;
};
//
// uploadOptions Macro
//
config.macros.uploadOptions = {
handler: function(place,macroName,params) {
var wizard = new Wizard();
wizard.createWizard(place,this.wizardTitle);
wizard.addStep(this.step1Title,this.step1Html);
var markList = wizard.getElement("markList");
var listWrapper = document.createElement("div");
markList.parentNode.insertBefore(listWrapper,markList);
wizard.setValue("listWrapper",listWrapper);
this.refreshOptions(listWrapper,false);
var uploadCaption;
if (document.location.toString().substr(0,4) == "http")
uploadCaption = config.macros.upload.label.saveLabel;
else
uploadCaption = config.macros.upload.label.uploadLabel;
wizard.setButtons([
{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption,
onClick: config.macros.upload.action},
{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
]);
},
options: [
"txtUploadUserName",
"pasUploadPassword",
"txtUploadStoreUrl",
"txtUploadDir",
"txtUploadFilename",
"txtUploadBackupDir",
"chkUploadLog",
"txtUploadLogMaxLine"
],
refreshOptions: function(listWrapper) {
var opts = [];
for(i=0; i<this.options.length; i++) {
var opt = {};
opts.push();
opt.option = "";
n = this.options[i];
opt.name = n;
opt.lowlight = !config.optionsDesc[n];
opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
opts.push(opt);
}
var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
for(n=0; n<opts.length; n++) {
var type = opts[n].name.substr(0,3);
var h = config.macros.option.types[type];
if (h && h.create) {
h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
}
}
},
onCancel: function(e)
{
backstage.switchTab(null);
return false;
},
wizardTitle: "Upload with options",
step1Title: "These options are saved in cookies in your browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Cancel",
cancelButtonPrompt: "Cancel prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
};
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
backupSaved: "Backup saved",
backupFailed: "Failed to upload backup file",
rssSaved: "RSS feed uploaded",
rssFailed: "Failed to upload RSS feed file",
emptySaved: "Empty template uploaded",
emptyFailed: "Failed to upload empty template file",
mainSaved: "Main TiddlyWiki file uploaded",
mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
//specific upload
loadOriginalHttpPostError: "Can't get original file",
aboutToSaveOnHttpPost: 'About to upload on %0 ...',
storePhpNotFound: "The store script '%0' was not found."
};
bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
var callback = function(status,uploadParams,original,url,xhr) {
if (!status) {
displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
return;
}
if (bidix.debugMode)
alert(original.substr(0,500)+"\n...");
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.upload.uploadRss(uploadParams,original,posDiv);
};
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
// save on localdisk ?
if (document.location.toString().substr(0,4) == "file") {
var path = document.location.toString();
var localPath = getLocalPath(path);
saveChanges();
}
// get original
var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
var originalPath = document.location.toString();
// If url is a directory : add index.html
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + "index.html";
var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
var log = new bidix.UploadLog();
log.startUpload(storeUrl, dest, uploadDir, backupDir);
displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
if (bidix.debugMode)
alert("about to execute Http - GET on "+originalPath);
var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
bidix.upload.uploadRss = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
bidix.upload.uploadMain(params[0],params[1],params[2]);
} else {
displayMessage(bidix.upload.messages.rssFailed);
}
};
// do uploadRss
if(config.options.chkGenerateAnRssFeed) {
var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
var rssString = generateRss();
// no UnicodeToUTF8 conversion needed when location is "file" !!!
if (document.location.toString().substr(0,4) != "file")
rssString = convertUnicodeToUTF8(rssString);
bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
} else {
bidix.upload.uploadMain(uploadParams,original,posDiv);
}
};
bidix.upload.uploadMain = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
var log = new bidix.UploadLog();
if(status) {
// if backupDir specified
if ((params[3]) && (responseText.indexOf("backupfile:") > -1)) {
var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
}
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
store.setDirty(false);
log.endUpload("ok");
} else {
alert(bidix.upload.messages.mainFailed);
displayMessage(bidix.upload.messages.mainFailed);
log.endUpload("failed");
}
};
// do uploadMain
var revised = bidix.upload.updateOriginal(original,posDiv);
bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};
bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
var localCallback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (xhr.status == 404)
alert(bidix.upload.messages.storePhpNotFound.format([url]));
if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
alert(responseText);
if (responseText.indexOf("Debug mode") >= 0 )
responseText = responseText.substring(responseText.indexOf("\n\n")+2);
} else if (responseText.charAt(0) != '0')
alert(responseText);
if (responseText.charAt(0) != '0')
status = null;
callback(status,params,responseText,url,xhr);
};
// do httpUpload
var boundary = "---------------------------"+"AaB03x";
var uploadFormName = "UploadPlugin";
// compose headers data
var sheader = "";
sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
sheader += uploadFormName +"\"\r\n\r\n";
sheader += "backupDir="+uploadParams[3] +
";user=" + uploadParams[4] +
";password=" + uploadParams[5] +
";uploaddir=" + uploadParams[2];
if (bidix.debugMode)
sheader += ";debug=1";
sheader += ";;\r\n";
sheader += "\r\n" + "--" + boundary + "\r\n";
sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
sheader += "Content-Length: " + data.length + "\r\n\r\n";
// compose trailer data
var strailer = new String();
strailer = "\r\n--" + boundary + "--\r\n";
data = sheader + data + strailer;
if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
if (!posDiv)
posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
store.allTiddlersAsHtml() + "\n" +
original.substr(posDiv[1]);
var newSiteTitle = getPageTitle().htmlEncode();
revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
return revised;
};
//
// UploadLog
//
// config.options.chkUploadLog :
// false : no logging
// true : logging
// config.options.txtUploadLogMaxLine :
// -1 : no limit
// 0 : no Log lines but UploadLog is still in place
// n : the last n lines are only kept
// NaN : no limit (-1)
bidix.UploadLog = function() {
if (!config.options.chkUploadLog)
return; // this.tiddler = null
this.tiddler = store.getTiddler("UploadLog");
if (!this.tiddler) {
this.tiddler = new Tiddler();
this.tiddler.title = "UploadLog";
this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
this.tiddler.created = new Date();
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
}
return this;
};
bidix.UploadLog.prototype.addText = function(text) {
if (!this.tiddler)
return;
// retrieve maxLine when we need it
var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
if (isNaN(maxLine))
maxLine = -1;
// add text
if (maxLine != 0)
this.tiddler.text = this.tiddler.text + text;
// Trunck to maxLine
if (maxLine >= 0) {
var textArray = this.tiddler.text.split('\n');
if (textArray.length > maxLine + 1)
textArray.splice(1,textArray.length-1-maxLine);
this.tiddler.text = textArray.join('\n');
}
// update tiddler fields
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
// refresh and notifiy for immediate update
story.refreshTiddler(this.tiddler.title);
store.notify(this.tiddler.title, true);
};
bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
if (!this.tiddler)
return;
var now = new Date();
var text = "\n| ";
var filename = bidix.basename(document.location.toString());
if (!filename) filename = '/';
text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
text += config.options.txtUserName + " | ";
text += "[["+filename+"|"+location + "]] |";
text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
text += uploadDir + " | ";
text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
text += backupDir + " |";
this.addText(text);
};
bidix.UploadLog.prototype.endUpload = function(status) {
if (!this.tiddler)
return;
this.addText(" "+status+" |");
};
//
// Utilities
//
bidix.checkPlugin = function(plugin, major, minor, revision) {
var ext = version.extensions[plugin];
if (!
(ext &&
((ext.major > major) ||
((ext.major == major) && (ext.minor > minor)) ||
((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
// write error in PluginManager
if (pluginInfo)
pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
}
};
bidix.dirname = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(0, lastpos);
} else {
return filePath.substring(0, filePath.lastIndexOf("\\"));
}
};
bidix.basename = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("#")) != -1)
filePath = filePath.substring(0, lastpos);
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(lastpos + 1);
} else
return filePath.substring(filePath.lastIndexOf("\\")+1);
};
bidix.initOption = function(name,value) {
if (!config.options[name])
config.options[name] = value;
};
//
// Initializations
//
// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);
// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");
//optionsDesc
merge(config.optionsDesc,{
txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
txtUploadUserName: "Upload Username",
pasUploadPassword: "Upload Password",
chkUploadLog: "do Logging in UploadLog (default: true)",
txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});
// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');
// Backstage
merge(config.tasks,{
uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
//}}}
''Usage Treeview.24''
{{{<<treeview2 [root tag] [tree style] [startup parameters]>>}}}
Startup parameters are a set of optional parameters given in a comma-separated, key/value string like this: 'collapsed: false, animated: "normal", persist: true' ''Carefully observe the quotes.''
''Version .24.''
{{{<<treeview2 "TWT-Notes" "filetree" 'collapsed: false, antisesame: "closed", animated: "fast", persist: "cookie", cookieId: "myid"' >>}}}
Where:
root tag is the tag at the the name of your top level topic, it related to subTopics by using its name as one of their tags. Tree style indicates which type of tree will be displayed, possibly treeview, filetree, and treeview-red, and treeview-famfamfam. This ~TiddlyWiki is set up for treeview' only.
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span style="color:#555;">[</span>skift:»<span style="padding-right:0em;" macro='tagger'></span >tilføj:»<span macro='newHere label:"underemne"'></span>send:»<span macro='email to:{{tiddler.fields.email}} permalink:"true"'></span><span style="color:#555">]</span><span macro='snapshot print label:print prompt:Udskriv id:story'></span></div></div>
<div macro="hideWhenTaggedAny noTitle iframe">
<div class='title' macro='view title'></div>
</div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<script>
var tid=story.findContainingTiddler(place).getAttribute("tiddler");
var links=store.getTiddler(tid).getLinks();
return wikify('{{relatedTiddlers{\n:[['+links.sort().join(']]\n:[[')
+']]\n}}}',place);
</script>
<<forEachTiddler where 'tiddler.tags.contains("Elev")&& tiddler.fields["vaerelse"]'
sortBy 'tiddler.fields["gang"]'
write
'(index < 200)? "|"+(index+1)+"|[["+tiddler.title+"]] | "+tiddler.fields["vaerelse"]+" | <<tag "+tiddler.fields["k-gruppe"] +" \>\> | [img(3em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | <<tag "+tiddler.fields["gang"]+" \>\> |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>|>| !<<tag Elev Elever \>\> på <<tag GangOversigt værelser \>\> |h\n"
+"|!#| <<tag Elev Navn \>\> | <<tag Værelser Vær \>\> | <<tag Lærere K-gr \>\> ||<<tag GangOversigt Gang \>\> |h\n"'
end 'count+" stk elever på værelser\n"' none '"Ingen elever på værelser\n"'>>
Der findes mange måder at udvide ~TiddlyWikis funktionalitet.
En af dem er via <<tag systemConfig>>. En anden er ganske enkelt at man laver sit eget hierakiske system, med viden som er vigtig at kunne finde rundt i på en nem og overskuelig måde.
<<forEachTiddler
where
'tiddler.tags.contains("HU")'
sortBy 'tiddler.fields["gang"]'
write
'(index < 100) ? "| !"+(index+1)+" |[["+tiddler.title+"]] | [["+tiddler.fields["k-gruppe"]+"]] | [["+tiddler.fields["gang"]+"]] | [img(2em,auto)["+store.getValue(tiddler,"title")+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] | [["+tiddler.fields["værelse"]+"]] | | f-e |!| f-e |!| f-e |!| f-e |!| f-e |!||\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>|>| ![[Weekenden|WeekendListen]]@@padding-left: 20px; <<tiddler [[Reset HU]] \>\>@@ |>| !<<tag NatteVagt Sovested \>\> |>| !<<tag VagtPlan Fredag \>\> |>|>|>| !<<tag VagtPlan Lørdag \>\> |>|>|>|>| !<<tag VagtPlan Søndag \>\><<snapshot print label:print prompt:Udskriv id:viewer \>\> |h\n"
+"|!#| <<tag Elev \>\> | <<tag Lærere K-gruppe \>\> | <<tag GangOversigt Gang \>\> | <<tag Syg SygW \>\> | <<tag Værelser Fredag \>\> | <<tag Værelser Lørdag \>\> | Aft | Kaf | Mo | Kaf | Aft | Kaf | Mo | Kaf |Aft | Kaf | Ren |h\n"'
end 'count+" elever på HU i weekenden\n"'
none '"Ingen elever på HU i weekenden\n"'
>>
/***
|''Name:''|WikiBar|
|''Version:''|2.0.0 beta3|
|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|
|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|
|''Type:''|toolbar macro command extension|
|''Required:''|TiddlyWiki 2.0.0 beta6|
!Description
WikiBar is a toolbar that gives access to most of TiddlyWiki's formatting features with a few clicks. It's a handy tool for people who are not familiar with TiddlyWiki syntax.
Besides, with WikiBar-addons, users can extend the power of WikiBar.
!Support browser
*Firefox 1.5
!Revision history
*v2.0.0 beta3 (2005/12/30)
** remove macros (replaced by TWMacro addon)
** add wikibar command in toolbar automatically
** rename DOIT to HANDLER
** rename TIP to TOOLTIP
*v2.0.0 beta2 (2005/12/21)
** re-design Wikibar addon framework
*v2.0.0 beta1 (2005/12/14)
** Note:
*** WikiBarPlugin is renamed to WikiBar
** New Features:
*** support TiddlyWiki 2.0.0 template mechanism
*** new wikibar data structure
*** new wikibar-addon framework for developers
**** support dynamic popup menu generator
*** support most new macros added in TiddlyWiki 2.0.0
*** multi-level popup menu
*** fix wikibar tab stop
*** remove paletteSelector
** Known Bugs:
*** popup-menu and color-picker can't be closed correctly
*** some macros can't be displayed correctly in previewer
*** text in previewer will be displayed italic
*v1.2.0 (2005/11/21)
**New Features:
***User defined color palettes supported
####Get color palettes from [[ColorZilla Palettes|http://www.iosart.com/firefox/colorzilla/palettes.html]].
####Save the palette file(*.gpl) as a new tiddler and tag it with 'ColorPalettes', then you can use it in WikiBar.
***WikiBar style sheet supported
***Click on document to close current colorPicker, paletteSelector or aboutWikibar
*v1.1.1 (2005/11/03)
**Bugs fixed:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.1.0 (2005/11/01)
**Bugs fixed:
***WikiBar overruns (reported by by GeoffS <gslocock@yahoo.co.uk>)
**New features:
***Insert a color code at the cursor. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Enable gradient macro. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by TiddlyWiki 1.2.37)
***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by TiddlyWiki 1.2.37)
**Enhanced:
***Allow optional parameters in syntax.
**Bugs:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.0.0 (2005/10/30)
**Initial release
!Code
***/
//{{{
config.macros.wikibar = {major: 2, minor: 0, revision: 0, beta: 3, date: new Date(2005,12,30)};
config.macros.wikibar.handler = function(place,macroName,params,wikifier,paramString,tiddler){
if(!(tiddler instanceof Tiddler)) {return;}
story.setDirty(tiddler.title,true);
place.id = 'wikibar'+tiddler.title;
place.className = 'toolbar wikibar';
};
function wikibar_install(){
config.commands.wikibar = {
text: 'wikibar',
tooltip: 'wikibar on/off',
handler: function(e,src,title) {
if(!e){ e = window.event; }
var theButton = resolveTarget(e);
theButton.id = 'wikibarButton'+title;
wikibarPopup.remove();
wikibar_installAddons(theButton, title);
wikibar_createWikibar(title);
return(false);
}
};
config.shadowTiddlers['EditTemplate'] = wikibar_addWikibarCommand(config.shadowTiddlers['EditTemplate']);
var tiddler = store.getTiddler('EditTemplate');
if(tiddler){
tiddler.text = wikibar_addWikibarCommand(tiddler.text);
}
}
function wikibar_installAddons(theButton, title){
var tiddlers = store.getTaggedTiddlers('wikibarAddons');
if(!tiddlers) { return; }
theButton.addons=[];
for(var i=0; i<tiddlers.length; i++){
try{
eval(tiddlers[i].text);
try{
wikibar_addonInstall(title);
wikibar_addonInstall = null;
theButton.addons.push({ok:true, name:tiddlers[i].title});
}catch(ex){
theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
}
}catch(ex){
theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
}
}
}
function wikibar_addWikibarCommand(tiddlerText){
var div = document.createElement('div');
div.style.display = 'none';
div.innerHTML = tiddlerText;
for(var i=0; i<div.childNodes.length; i++){
var o=div.childNodes[i];
if(o.tagName==='DIV'){
if(o.className=='toolbar'){
var macroText = o.getAttribute('macro').trim();
if(macroText.search('wikibar')<=0){
macroText += ' wikibar';
o.setAttribute('macro', macroText);
}
break;
}
}
}
return div.innerHTML.replace(/\"/g, "\'");
}
function wikibar_processSyntaxParams(theSyntax, params){
try{
var pcr = 'AplWikibarPcr';
var rx=null;
var allParams=null;
if(params){
if(typeof(params)=='object'){
for(var i=0; i<params.length; i++){
if(params[i]){
params[i] = params[i].replace(new RegExp('%','g'), pcr).trim();
rx = '(\\[%'+(i+1)+'\\])' + '|' + '(%'+(i+1)+')';
theSyntax = theSyntax.replace(new RegExp(rx,'g'), params[i] );
}
}
allParams = params.join(' ').trim();
}else{
allParams = params.replace(new RegExp('%','g'), pcr).trim();
rx = /(\[%1{1}\])|(%1{1})/g;
theSyntax = theSyntax.replace(rx, allParams);
}
}
if(allParams){
theSyntax = theSyntax.replace(new RegExp('%N{1}','g'), allParams);
}
rx=/\[%(([1-9]{1,}[0-9]{0,})|(N{1}))\]/g;
theSyntax = theSyntax.replace(rx, '');
rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;
if( theSyntax.match(rx) ){
throw 'Not enough parameters! ' + theSyntax;
}
theSyntax=theSyntax.replace(new RegExp(pcr,'g'), '%');
return theSyntax;
} catch(ex){
return null;
}
}
function wikibar_resolveEditItem(tiddlerWrapper, itemName){
if(tiddlerWrapper.hasChildNodes()){
var c=tiddlerWrapper.childNodes;
for(var i=0; i<c.length; i++){
var txt=wikibar_resolveEditItem(c[i], itemName);
if(!txt){
continue;
}else{
return txt;
}
}
}
return ((tiddlerWrapper.getAttribute && tiddlerWrapper.getAttribute('edit')==itemName)? tiddlerWrapper : null);
}
function wikibar_resolveEditItemValue(tiddlerWrapper, itemName){
var o = wikibar_resolveEditItem(tiddlerWrapper, itemName);
return (o? o.value.replace(/\r/mg,'') : null);
}
function wikibar_resolveTiddlerEditorWrapper(obj){
if(obj.id=='tiddlerDisplay'){return null;}
if((obj.getAttribute && obj.getAttribute('macro')=='edit text')){return obj;}
return wikibar_resolveTiddlerEditorWrapper(obj.parentNode);
}
function wikibar_resolveTiddlerEditor(obj){
if(obj.hasChildNodes()){
var c = obj.childNodes;
for(var i=0; i<c.length; i++){
var o=wikibar_resolveTiddlerEditor(c[i]);
if(o){ return o;}
}
}
return ((obj.getAttribute && obj.getAttribute('edit')=='text')? obj : null);
}
function wikibar_resolveTargetButton(obj){
if(obj.id && obj.id.substring(0,7)=='wikibar'){ return null; }
if(obj.tiddlerTitle){
return obj;
}else{
return wikibar_resolveTargetButton(obj.parentNode);
}
}
function wikibar_isValidMenuItem(tool){
if(!tool){ return false; }
if(tool.TYPE=='MENU' || tool.TYPE=='MAIN_MENU'){
for(var key in tool){
if(key.substring(0,8)=='DYNAITEM'){ return true; }
if(wikibar_isValidMenuItem(tool[key])){ return true; }
}
return false;
}else{
return (tool.HANDLER? true : false);
}
}
function wikibar_editFormat(param){
var editor = param.button.editor;
var params = param.params;
clearMessage();
if(!editor){ return; }
var repText = wikibar_processSyntaxParams(this.syntax, params);
if(repText===null){ return; }
var st = editor.scrollTop;
var ss = editor.selectionStart;
var se = editor.selectionEnd;
var frontText= '';
var endText = '';
var fullText = editor.value;
if(se>ss && ss>=0){
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
}
else if(ss===0 && (se===0 || se == fullText.length) ){
endText = fullText;
}
else if(se==ss && ss>0){
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
}
if(repText.indexOf('user_text')>=0 && this.hint){
repText = repText.replace('user_text', this.hint);
}
editor.value = frontText + repText + endText;
editor.selectionStart = ss;
editor.selectionEnd = ss + repText.length;
editor.scrollTop = st;
editor.focus();
}
function wikibar_editFormatByWord(param){
var editor = param.button.editor;
var params = param.params;
clearMessage();
if(!editor){return;}
var repText = wikibar_processSyntaxParams(this.syntax, params);
if(repText===null){ return; }
var st = editor.scrollTop;
var ss = editor.selectionStart;
var se = editor.selectionEnd;
var frontText= '';
var selText = '';
var endText = '';
var fullText = editor.value;
if(se>ss && ss>=0){
frontText = fullText.substring(0, ss);
selText = fullText.substring(ss,se);
endText = fullText.substring(se, fullText.length);
}
else if(ss===0 && (se===0 || se == fullText.length) ){
endText = fullText;
}
else if(se==ss && ss>0){
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
if(!( fullText.charAt(ss-1).match(/\W/gi) || fullText.charAt(ss).match(/\W/gi) )){
var m = frontText.match(/\W/gi);
if(m){
ss = frontText.lastIndexOf(m[m.length-1])+1;
}
else{
ss = 0;
}
m = endText.match(/\W/gi);
if(m){
se += endText.indexOf(m[0]);
}
else{
se = fullText.length;
}
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
selText = fullText.substring(ss,se);
}
}
if(selText.length>0){
repText = repText.replace('user_text', selText);
}
if(repText.indexOf('user_text')>=0 && this.hint){
repText = repText.replace('user_text', this.hint);
}
editor.value = frontText + repText + endText;
editor.selectionStart = ss;
editor.selectionEnd = ss + repText.length;
editor.scrollTop = st;
editor.focus();
}
function wikibar_editFormatByCursor(param){
var editor = param.button.editor;
var params = param.params;
clearMessage();
if(!editor){ return; }
var repText = wikibar_processSyntaxParams(this.syntax, params);
if(repText===null){ return; }
var st = editor.scrollTop;
var ss = editor.selectionStart;
var se = editor.selectionEnd;
var frontText= '';
var endText = '';
var fullText = editor.value;
if(se>ss && ss>=0){
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
}
else if(ss===0 && (se===0 || se == fullText.length) ){
endText = fullText;
}
else if(se==ss && ss>0){
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
}
if(repText.indexOf('user_text')>=0 && this.hint){
repText = repText.replace('user_text', this.hint);
}
editor.value = frontText + repText + endText;
editor.selectionStart = ss;
editor.selectionEnd = ss + repText.length;
editor.scrollTop = st;
editor.focus();
}
function wikibar_editFormatByLine(param){
var editor = param.button.editor;
var params = param.params;
clearMessage();
if(!editor){ return; }
var repText = wikibar_processSyntaxParams(this.syntax, params);
if(repText===null){ return; }
var st = editor.scrollTop;
var ss = editor.selectionStart;
var se = editor.selectionEnd;
var frontText= '';
var selText = '';
var endText = '';
var fullText = editor.value;
if(se>ss && ss>=0){
if(this.byBlock){
frontText = fullText.substring(0, ss);
selText = fullText.substring(ss,se);
endText = fullText.substring(se, fullText.length);
}
else{
se = ss;
}
}
if(ss===0 && (se===0 || se == fullText.length) ){
var m=fullText.match(/(\n|\r)/g);
if(m){
se = fullText.indexOf(m[0]);
}else{
se = fullText.length;
}
selText = fullText.substring(0, se);
endText = fullText.substring(se, fullText.length);
}
else if(se==ss && ss>0){
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
m = frontText.match(/(\n|\r)/g);
if(m){
ss = frontText.lastIndexOf(m[m.length-1])+1;
}
else{
ss = 0;
}
m = endText.match(/(\n|\r)/g);
if(m){
se += endText.indexOf(m[0]);
}
else{
se = fullText.length;
}
frontText = fullText.substring(0, ss);
selText = fullText.substring(ss,se);
endText = fullText.substring(se, fullText.length);
}
if(selText.length>0){
repText = repText.replace('user_text', selText);
}
if(repText.indexOf('user_text')>=0 && this.hint){
repText = repText.replace('user_text', this.hint);
}
if(this.byBlock){
if( (frontText.charAt(frontText.length-1)!='\n') && ss>0 ){
repText = '\n' + repText;
}
if( (endText.charAt(0)!='\n') || se==fullText.length){
repText += '\n';
}
}
editor.value = frontText + repText + endText;
editor.selectionStart = ss;
editor.selectionEnd = ss + repText.length;
editor.scrollTop = st;
editor.focus();
}
function wikibar_editFormatByTableCell(param){
var editor = param.button.editor;
var params = param.params;
clearMessage();
if(!editor){ return; }
var repText = wikibar_processSyntaxParams(this.syntax, params);
if(repText===null){ return; }
var st = editor.scrollTop;
var ss = editor.selectionStart;
var se = editor.selectionEnd;
var frontText= '';
var selText = '';
var endText = '';
var fullText = editor.value;
if(ss===0 || ss==fullText.length){
throw 'not valid cell!';
}
se=ss;
frontText = fullText.substring(0, ss);
endText = fullText.substring(se, fullText.length);
i=frontText.lastIndexOf('\n');
j=frontText.lastIndexOf('|');
if(i>j || j<0){
throw 'not valid cell!';
}
ss = j+1;
i=endText.indexOf('\n');
j=endText.indexOf('|');
if(i<j || j<0){
throw 'not valid cell!';
}
se += j;
frontText = fullText.substring(0, ss-1);
selText = fullText.substring(ss,se);
endText = fullText.substring(se+1, fullText.length);
if(this.key.substring(0,5)=='align'){
selText = selText.trim();
if( selText=='>' || selText=='~' || selText.substring(0,8)=='bgcolor(') {return; }
}
if(selText.length>0){
repText = repText.replace('user_text', selText);
}
if(repText.indexOf('user_text')>=0 && this.hint){
repText = repText.replace('user_text', this.hint);
}
editor.value = frontText + repText + endText;
editor.selectionStart = ss;
editor.selectionEnd = ss + repText.length - 2;
editor.scrollTop = st;
editor.focus();
}
function wikibar_editSelectAll(param){
var editor = param.button.editor;
editor.selectionStart = 0;
editor.selectionEnd = editor.value.length;
editor.scrollTop = 0;
editor.focus();
}
function wikibar_doPreview(param){
var theButton = param.button;
var editor = param.button.editor;
var wikibar = theButton.parentNode;
if(!wikibar) { return; }
title = theButton.tiddlerTitle;
var editorWrapper = wikibar_resolveTiddlerEditorWrapper(editor);
var tiddlerWrapper = editorWrapper.parentNode;
var previewer = document.getElementById('previewer'+title);
if(previewer){
previewer.parentNode.removeChild(previewer);
editorWrapper.style.display = 'block';
visible=true;
}else{
previewer = document.createElement('div');
previewer.id = 'previewer'+title;
previewer.className = 'viewer previewer';
previewer.style.height = (editor.offsetHeight) + 'px';
wikify(editor.value, previewer);
tiddlerWrapper.insertBefore(previewer, editorWrapper);
editorWrapper.style.display = 'none';
visible=false;
}
var pv=null;
for(var i=0; i<wikibar.childNodes.length; i++){
try{
var btn = wikibar.childNodes[i];
if(btn.toolItem.key == 'preview'){ pv=btn; }
if(btn.toolItem.key != 'preview'){
btn.style.display = visible ? '': 'none';
}
}catch(ex){}
}
if(!pv) { return; }
if(visible){
pv.innerHTML = '<font face=\"verdana\">∞</font>';
pv.title = 'preview current tiddler';
}
else{
pv.innerHTML = '<font face=\"verdana\">←</font>';
pv.title = 'back to editor';
}
}
function wikibar_doListAddons(param){
clearMessage();
var title = param.button.tiddlerTitle;
var wikibarButton = document.getElementById('wikibarButton'+title);
var ok=0, fail=0;
for(var i=0; i<wikibarButton.addons.length; i++){
var addon=wikibarButton.addons[i];
if(addon.ok){
displayMessage('[ o ] '+addon.name);
ok++;
}
else{
displayMessage('[ x ] '+addon.name + ': ' + addon.error);
fail++;
}
}
displayMessage('---------------------------------');
displayMessage(ok + ' ok ; ' + fail + ' failed');
}
function wikibar_getColorCode(param){
var cbOnPickColor = function(colorCode, param){
param.params = colorCode;
param.button.toolItem.doMore(param);
};
wikibarColorTool.openColorPicker(param.button, cbOnPickColor, param);
}
function wikibar_getLinkUrl(param){
var url= prompt('Please enter the link target', (this.param? this.param : ''));
if (url && url.trim().length>0){
param.params = url;
this.doMore(param);
}
}
function wikibar_getTableRowCol(param){
var rc= prompt('Please enter (rows x cols) of the table', '2 x 3');
if (!rc || (rc.trim()).length<=0){ return; }
var arr = rc.toUpperCase().split('X');
if(arr.length != 2) { return; }
for(var i=0; i<arr.length; i++){
if(isNaN(arr[i].trim())) { return; }
}
var rows = parseInt(arr[0].trim(), 10);
var cols = parseInt(arr[1].trim(), 10);
var txtTable='';
for(var r=0; r<rows; r++){
for(var c=0; c<=cols; c++){
if(c===0){
txtTable += '|';
}else{
txtTable += ' |';
}
}
txtTable += '\n';
}
if(txtTable.trim().length>0){
param.params = txtTable.trim();
this.doMore(param);
}
}
function wikibar_getMacroParam(param){
var p = prompt('Please enter the parameters of macro \"' + this.key + '\":' +
'\nSyntax: ' + this.syntax +
'\n\nNote: '+
'\n%1,%2,... - parameter needed'+
'\n[%1] - optional parameter'+
'\n%N - more than one parameter(1~n)'+
'\n[%N] - any number of parameters(0~n)'+
'\n\nPS:'+
'\n1. Parameters should be seperated with space character'+
'\n2. Use \" to wrap the parameter that includes space character, ex: \"hello world\"'+
'\n3. Input the word(null) for the optional parameter ignored',
(this.param? this.param : '') );
if(!p) { return; }
p=p.readMacroParams();
for(var i=0; i<p.length; i++){
var s=p[i].trim();
if(s.indexOf(' ')>0){ p[i]="'"+s+"'"; }
if(s.toLowerCase()=='null'){ p[i]=null; }
}
param.params = p;
this.doMore(param);
}
function wikibar_getMorePalette(unused){
clearMessage();
displayMessage('Get more color palettes(*.gpl) from ColorZilla Palettes site', 'http:\/\/www.iosart.com/firefox/colorzilla/palettes.html');
displayMessage('Save it as a new tiddler with \"ColorPalettes\" tag');
}
function wikibar_createWikibar(title){
var theWikibar = document.getElementById('wikibar' + title);
if(theWikibar){
if(theWikibar.hasChildNodes()){
theWikibar.style.display = (theWikibar.style.display=='block'? 'none':'block');
return;
}
}
var tiddlerWrapper = document.getElementById('tiddler'+title);
var theTextarea = wikibar_resolveTiddlerEditor(tiddlerWrapper);
if(!theTextarea){
clearMessage();
displayMessage('WikiBar only works in tiddler edit mode now');
return;
}else{
if(!theTextarea.id){ theTextarea.id = 'editor'+title; }
if(!theTextarea.parentNode.id){ theTextarea.parentNode.id='editorWrapper'+title; }
}
if(theWikibar){
theWikibar = document.getElementById('wikibar'+title);
}else{
var editorWrapper = wikibar_resolveTiddlerEditorWrapper(theTextarea);
theWikibar = createTiddlyElement(tiddlerWrapper, 'div', 'wikibar'+title, 'toolbar');
addClass(theWikibar, 'wikibar');
var previewer = document.getElementById('previewer'+title);
if(previewer){
tiddlerWrapper.insertBefore(theWikibar, previewer);
}else{
tiddlerWrapper.insertBefore(theWikibar, editorWrapper);
}
}
wikibar_createMenu(theWikibar,wikibarStore,title,theTextarea);
if(config.options['chkWikibarSetEditorHeight'] && config.options['txtWikibarEditorRows']){
theTextarea.rows = config.options['txtWikibarEditorRows'];
}
setStylesheet(
'.wikibar{text-align:left;visibility:visible;margin:2px;padding:1px;}.previewer{overflow:auto;display:block;border:1px solid;}#colorPicker{position:absolute;display:none;z-index:10;margin:0px;padding:0px;}#colorPicker table{margin:0px;padding:0px;border:2px solid #000;border-spacing:0px;border-collapse:collapse;}#colorPicker td{margin:0px;padding:0px;border:1px solid;font-size:11px;text-align:center;cursor:auto;}#colorPicker .header{background-color:#fff;}#colorPicker .button{background-color:#fff;cursor:pointer;cursor:hand;}#colorPicker .button:hover{padding-top:3px;padding-bottom:3px;color:#fff;background-color:#136;}#colorPicker .cell{padding:4px;font-size:7px;cursor:crosshair;}#colorPicker .cell:hover{padding:10px;}.wikibarPopup{position:absolute;z-index:10;border:1px solid #014;color:#014;background-color:#cef;}.wikibarPopup table{margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;}.wikibarPopup .button:hover{color:#eee;background-color:#014;}.wikibarPopup .disabled{color:#888;}.wikibarPopup .disabled:hover{color:#888;background-color:#cef;}.wikibarPopup tr .seperator hr{margin:0;padding:0;background-color:#cef;width:100%;border:0;border-top:1px dashed #014;}.wikibarPopup tr .icon{font-family:verdana;font-weight:bolder;}.wikibarPopup tr .marker{font-family:verdana;font-weight:bolder;}.wikibarPopup td{font-size:0.9em;padding:2px;}.wikibarPopup input{border:0;border-bottom:1px solid #014;margin:0;padding:0;font-family:arial;font-size:100%;background-color:#fff;}',
'WikiBarStyleSheet');
}
function wikibar_createMenu(place,toolset,title,editor){
if(!wikibar_isValidMenuItem(toolset)){return;}
if(!(toolset.TYPE=='MAIN_MENU' || toolset.TYPE=='MENU')){ return; }
for(var key in toolset){
if(key.substring(0,9)=='SEPERATOR'){
wikibar_createMenuSeperator(place);
continue;
}
if(key.substring(0,8)=='DYNAITEM'){
var dynaTools = toolset[key](title,editor);
if(dynaTools.TYPE && dynaTools.TYPE=='MENU'){
wikibar_createMenuItem(place,dynaTools,null,editor,title);
}else{
dynaTools.TYPE = 'MENU';
wikibar_createMenu(place, dynaTools, title, editor);
}
continue;
}
if((toolset[key].TYPE!='MENU' && toolset[key].TYPE!='MAIN_MENU') && !toolset[key].HANDLER){continue;}
wikibar_createMenuItem(place,toolset,key,editor,title);
}
}
function wikibar_createMenuItem(place,toolset,key,editor,title){
if(!key){
var tool = toolset;
}else{
tool = toolset[key];
tool.key = key;
}
if(!wikibar_isValidMenuItem(tool)){return;}
var toolIsOnMainMenu = (toolset.TYPE=='MAIN_MENU');
var toolIsMenu = (tool.TYPE=='MENU');
var theButton;
if(toolIsOnMainMenu){
theButton = createTiddlyButton(
place,
'',
(tool.TOOLTIP? tool.TOOLTIP : ''),
(toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem),
'button');
theButton.innerHTML = (tool.CAPTION? tool.CAPTION : key);
theButton.isOnMainMenu = true;
addClass(theButton, (toolIsMenu? 'menu' : 'item'));
place.appendChild( document.createTextNode('\n') );
if(!toolIsMenu){
if(config.options['chkWikibarPopmenuOnMouseOver']){
theButton.onmouseover = function(e){ wikibarPopup.remove(); };
}
}
}else{
theButton=createTiddlyElement(place, 'tr',key,'button');
theButton.title = (tool.TOOLTIP? tool.TOOLTIP : '');
theButton.onclick = (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem);
var tdL = createTiddlyElement(theButton, 'td','','marker');
var td = createTiddlyElement(theButton, 'td');
var tdR = createTiddlyElement(theButton, 'td','','marker');
td.innerHTML = (tool.CAPTION? tool.CAPTION : key);
if(toolIsMenu){
tdR.innerHTML=' ›';
}
if(tool.SELECTED){
tdL.innerHTML = '√ ';
addClass(theButton, 'selected');
}
if(tool.DISABLED){
addClass(theButton, 'disabled');
}
}
theButton.tiddlerTitle = title;
theButton.toolItem = tool;
theButton.editor = editor;
theButton.tabIndex = 999;
if(toolIsMenu){
if(config.options['chkWikibarPopmenuOnMouseOver']){
theButton.onmouseover = wikibar_onClickMenuItem;
}
}
}
function wikibar_createMenuSeperator(place){
if(place.id.substring(0,7)=='wikibar') { return; }
var onclickSeperator=function(e){
if(!e){ e = window.event; }
e.cancelBubble = true;
if (e.stopPropagation){ e.stopPropagation(); }
return(false);
};
var theButton=createTiddlyElement(place,'tr','','seperator');
var td = createTiddlyElement(theButton, 'td','','seperator');
td.colSpan=3;
theButton.onclick=onclickSeperator;
td.innerHTML = '<hr>';
}
function wikibar_genWikibarAbout(){
var toolset={};
toolset.version = {
CAPTION: '<center>WikiBar ' +
config.macros.wikibar.major + '.' +
config.macros.wikibar.minor + '.' +
config.macros.wikibar.revision +
(config.macros.wikibar.beta? ' beta '+config.macros.wikibar.beta : '') +
'</center>',
HANDLER: function(){}
};
toolset.SEPERATOR = {};
toolset.author = {
CAPTION: '<center>Arphen Lin<br>arphenlin@gmail.com</center>',
TOOLTIP: 'send mail to the author',
HANDLER: function(){ window.open('mailto:arphenlin@gmail.com'); }
};
toolset.website = {
CAPTION: '<center>aiddlywiki.sourceforge.net</center>',
TOOLTIP: 'go to the web site of WikiBar',
HANDLER: function(){ window.open('http:\/\/aiddlywiki.sourceforge.net/'); }
};
return toolset;
}
function wikibar_genWikibarOptions(title, editor){
var toolset={};
toolset.popOnMouseOver = {
CAPTION:'popup menu on mouse over',
SELECTED: config.options['chkWikibarPopmenuOnMouseOver'],
HANDLER: function(param){
config.options['chkWikibarPopmenuOnMouseOver'] = !config.options['chkWikibarPopmenuOnMouseOver'];
saveOptionCookie('chkWikibarPopmenuOnMouseOver');
var title = param.button.tiddlerTitle;
var wikibar = document.getElementById('wikibar'+title);
if(wikibar){ wikibar.parentNode.removeChild(wikibar); }
wikibar_createWikibar(title);
}
};
toolset.setEditorSize = {
CAPTION:'set editor height: <input id=\"txtWikibarEditorRows\" type=text size=1 MAXLENGTH=3 value=\"' +
(config.options['txtWikibarEditorRows']? config.options['txtWikibarEditorRows']:editor.rows) + '\"> ok',
HANDLER: function(param){
var input = document.getElementById('txtWikibarEditorRows');
if(input){
var rows = parseInt(input.value, 10);
if(!isNaN(rows)){
var editor = param.button.editor;
editor.rows = rows;
}else{
rows=config.maxEditRows;
}
config.options['txtWikibarEditorRows'] = rows;
saveOptionCookie('txtWikibarEditorRows');
config.maxEditRows = rows;
}
}
};
toolset.setEditorSizeOnLoadingWikibar = {
CAPTION:'set editor height on loading wikibar',
SELECTED: config.options['chkWikibarSetEditorHeight'],
HANDLER: function(param){
config.options['chkWikibarSetEditorHeight'] = !config.options['chkWikibarSetEditorHeight'];
saveOptionCookie('chkWikibarSetEditorHeight');
if(config.options['chkWikibarSetEditorHeight']){
var rows = config.options['txtWikibarEditorRows'];
if(!isNaN(rows)){ rows = 15; }
var editor = param.button.editor;
editor.rows = rows;
config.options['txtWikibarEditorRows'] = rows;
saveOptionCookie('txtWikibarEditorRows');
}
}
};
toolset.SEPERATOR = {};
toolset.update = {
CAPTION: 'check for updates',
DISABLED: true,
HANDLER: function(){}
};
return toolset;
}
function wikibar_genPaletteSelector(){
try{
var cpTiddlers = store.getTaggedTiddlers('ColorPalettes');
if(!cpTiddlers) { return; }
var palettes=[];
palettes.push(wikibarColorTool.defaultPaletteName);
for(var i=0; i<cpTiddlers.length; i++){
palettes.push(cpTiddlers[i].title.trim());
}
var toolset={};
for(i=0; i<palettes.length; i++){
toolset[palettes[i]] = {
TOOLTIP: palettes[i],
SELECTED: (palettes[i]==wikibarColorTool.paletteName),
HANDLER: wikibar_doSelectPalette
};
}
return toolset;
}catch(ex){ return null; }
}
function wikibar_onClickItem(e){
if(!e){ e = window.event; }
var theTarget = resolveTarget(e);
if(theTarget.tagName=='INPUT'){
e.cancelBubble = true;
if (e.stopPropagation){ e.stopPropagation(); }
return;
}
var theButton = wikibar_resolveTargetButton(theTarget);
if(!theButton){ return(false); }
var o = theButton.toolItem;
if(!o) { return; }
var param = {
event: e,
button: theButton
};
if(o.HANDLER){ o.HANDLER(param); }
if(o.DISABLED){
e.cancelBubble = true;
if (e.stopPropagation){ e.stopPropagation(); }
}
return(false);
}
function wikibar_onClickMenuItem(e){
if(!e){ e = window.event; }
var theButton = wikibar_resolveTargetButton(resolveTarget(e));
if(!theButton){ return(false); }
e.cancelBubble = true;
if (e.stopPropagation){ e.stopPropagation(); }
var title = theButton.tiddlerTitle;
var editor = theButton.editor;
var tool = theButton.toolItem;
if(!tool) { return; }
var popup = wikibarPopup.create(this);
if(popup){
wikibar_createMenu(popup,tool,title,editor);
if(!popup.hasChildNodes()){
wikibarPopup.remove();
}else{
wikibarPopup.show(popup, false);
}
}
return(false);
}
var wikibarColorTool = {
defaultPaletteName : 'default',
defaultColumns : 16,
defaultPalette : [
'#FFF','#DDD','#CCC','#BBB','#AAA','#999','#666','#333','#111','#000','#FC0','#F90','#F60','#F30','#C30','#C03',
'#9C0','#9D0','#9E0','#E90','#D90','#C90','#FC3','#FC6','#F96','#F63','#600','#900','#C00','#F00','#F36','#F03',
'#CF0','#CF3','#330','#660','#990','#CC0','#FF0','#C93','#C63','#300','#933','#C33','#F33','#C36','#F69','#F06',
'#9F0','#CF6','#9C3','#663','#993','#CC3','#FF3','#960','#930','#633','#C66','#F66','#903','#C39','#F6C','#F09',
'#6F0','#9F6','#6C3','#690','#996','#CC6','#FF6','#963','#630','#966','#F99','#F39','#C06','#906','#F3C','#F0C',
'#3F0','#6F3','#390','#6C0','#9F3','#CC9','#FF9','#C96','#C60','#C99','#F9C','#C69','#936','#603','#C09','#303',
'#0C0','#3C0','#360','#693','#9C6','#CF9','#FFC','#FC9','#F93','#FCC','#C9C','#969','#939','#909','#636','#606',
'#060','#3C3','#6C6','#0F0','#3F3','#6F6','#9F9','#CFC','#9CF','#FCF','#F9F','#F6F','#F3F','#F0F','#C6C','#C3C',
'#030','#363','#090','#393','#696','#9C9','#CFF','#39F','#69C','#CCF','#C9F','#96C','#639','#306','#90C','#C0C',
'#0F3','#0C3','#063','#396','#6C9','#9FC','#9CC','#06C','#369','#99F','#99C','#93F','#60C','#609','#C3F','#C0F',
'#0F6','#3F6','#093','#0C6','#3F9','#9FF','#699','#036','#039','#66F','#66C','#669','#309','#93C','#C6F','#90F',
'#0F9','#6F9','#3C6','#096','#6FF','#6CC','#366','#069','#36C','#33F','#33C','#339','#336','#63C','#96F','#60F',
'#0FC','#6FC','#3C9','#3FF','#3CC','#399','#033','#39C','#69F','#00F','#00C','#009','#006','#003','#63F','#30F',
'#0C9','#3FC','#0FF','#0CC','#099','#066','#3CF','#6CF','#09C','#36F','#0CF','#09F','#06F','#03F','#03C','#30C'
],
colorPicker : null,
pickColorHandler: null,
userData: null
};
wikibarColorTool.paletteName = wikibarColorTool.defaultPaletteName;
wikibarColorTool.columns = wikibarColorTool.defaultColumns;
wikibarColorTool.palette = wikibarColorTool.defaultPalette;
wikibarColorTool.onPickColor = function(e){
if (!e){ e = window.event; }
var theCell = resolveTarget(e);
if(!theCell){ return(false); }
color = theCell.bgColor.toLowerCase();
if(!color) { return; }
wikibarColorTool.displayColorPicker(false);
if(wikibarColorTool.pickColorHandler){
wikibarColorTool.pickColorHandler(color, wikibarColorTool.userData);
}
return(false);
};
wikibarColorTool.onMouseOver = function(e){
if (!e){ e = window.event; }
var theButton = resolveTarget(e);
if(!theButton){ return(false); }
if(!wikibarColorTool) { return; }
color = theButton.bgColor.toUpperCase();
if(!color) { return; }
td=document.getElementById('colorPickerInfo');
if(!td) { return; }
td.bgColor = color;
td.innerHTML = '<span style=\"color:#000;\">'+color+'</span> ' +
'<span style=\"color:#fff;\">'+color+'</span>';
e.cancelBubble = true;
if (e.stopPropagation){ e.stopPropagation(); }
return(false);
};
wikibarColorTool.openColorPicker = function(theTarget, pickColorHandler, userData){
wikibarColorTool.skipClickDocumentEvent = true;
wikibarColorTool.pickColorHandler = pickColorHandler;
wikibarColorTool.userData = userData;
wikibarColorTool.moveColorPicker(theTarget);
};
wikibarColorTool.convert3to6HexColor = function(c){
c=c.trim();
var rx=/^\#(\d|[a-f])(\d|[a-f])(\d|[a-f])$/gi;
return (rx.test(c)? c.replace(rx, '#$1$1$2$2$3$3') : c);
};
wikibarColorTool.numToHexColor = function (n){
if(typeof(n)=='number' && (n>=0 && n<=255)) {
s = n.toString(16).toLowerCase();
return ((s.length==1)? '0'+s : s);
}else{
return null;
}
};
wikibarColorTool.renderColorPalette = function(){
if(wikibarColorTool.paletteName==wikibarColorTool.defaultPaletteName){
wikibarColorTool.palette=wikibarColorTool.defaultPalette;
wikibarColorTool.columns=wikibarColorTool.defaultColumns;
return;
}
tiddlerText = (store.getTiddlerText(wikibarColorTool.paletteName, '')).trim();
if(tiddlerText.length<=0) { return; }
var cpContents = tiddlerText.split('\n');
var colors=[];
columns = wikibarColorTool.defaultColumns;
var tmpArray=null;
errCount=0;
for(var i=0; i<cpContents.length; i++){
cpLine=cpContents[i].trim();
if( (!cpLine) || (cpLine.length<=0) || (cpLine.charAt(0) == '#') ){ continue; }
if(cpLine.substring(0,8).toLowerCase()=='columns:'){
tmpArray = cpLine.split(':');
try{
columns = parseInt(tmpArray[1],10);
}catch(ex){
columns = wikibarColorTool.defaultColumns;
}
}else{
tmpArray = cpLine.replace('\t', ' ').split(/[ ]{1,}/);
try{
color='';
for(var j=0; j<3; j++){
c=parseInt(tmpArray[j].trim(), 10);
if(isNaN(c)){
break;
}else{
c=wikibarColorTool.numToHexColor(c);
if(!c) {break;}
color+=c;
}
}
if(color.length==6){
colors.push('#'+color);
} else {
throw 'error';
}
}catch(ex){
}
}
}
if(colors.length>0){
wikibarColorTool.palette = colors;
wikibarColorTool.columns = columns;
}else{
throw 'renderColorPalette(): No color defined in the palette.';
}
};
wikibarColorTool.displayColorPicker = function(visible){
if(wikibarColorTool.colorPicker){
wikibarColorTool.colorPicker.style.display = (visible? 'block' : 'none');
}
};
wikibarColorTool.moveColorPicker = function(theTarget){
if(!wikibarColorTool.colorPicker){
wikibarColorTool.createColorPicker();
}
var cp = wikibarColorTool.colorPicker;
var rootLeft = findPosX(theTarget);
var rootTop = findPosY(theTarget);
var popupLeft = rootLeft;
var popupTop = rootTop;
var popupWidth = cp.offsetWidth;
var winWidth = findWindowWidth();
if(popupLeft + popupWidth > winWidth){
popupLeft = winWidth - popupWidth;
}
cp.style.left = popupLeft + 'px';
cp.style.top = popupTop + 'px';
wikibarColorTool.displayColorPicker(true);
};
wikibarColorTool.createColorPicker = function(unused, palette){
if(palette){ wikibarColorTool.paletteName=palette; }
wikibarColorTool.renderColorPalette();
wikibarColorTool.colorPicker = document.createElement('div');
wikibarColorTool.colorPicker.id = 'colorPicker';
document.body.appendChild(wikibarColorTool.colorPicker);
var theTable = document.createElement('table');
wikibarColorTool.colorPicker.appendChild(theTable);
var theTR = document.createElement('tr');
theTable.appendChild(theTR);
var theTD = document.createElement('td');
theTD.className = 'header';
theTD.colSpan = wikibarColorTool.columns;
theTD.innerHTML = wikibarColorTool.paletteName;
theTR.appendChild(theTD);
for(var i=0; i<wikibarColorTool.palette.length; i++){
if((i%wikibarColorTool.columns)===0){
theTR = document.createElement('tr');
theTable.appendChild(theTR);
}
theTD = document.createElement('td');
theTD.className = 'cell';
theTD.bgColor = wikibarColorTool.convert3to6HexColor(wikibarColorTool.palette[i]);
theTD.onclick = wikibarColorTool.onPickColor;
theTD.onmouseover = wikibarColorTool.onMouseOver;
theTR.appendChild(theTD);
}
rest = wikibarColorTool.palette.length % wikibarColorTool.columns;
if(rest>0){
theTD = document.createElement('td');
theTD.colSpan = wikibarColorTool.columns-rest;
theTD.bgColor = '#000000';
theTR.appendChild(theTD);
}
theTR = document.createElement('tr');
theTable.appendChild(theTR);
theTD = document.createElement('td');
theTD.colSpan = wikibarColorTool.columns;
theTD.id = 'colorPickerInfo';
theTR.appendChild(theTD);
};
wikibarColorTool.onDocumentClick = function(e){
if (!e){ e = window.event; }
if(wikibarColorTool.skipClickDocumentEvent) {
wikibarColorTool.skipClickDocumentEvent = false;
return true;
}
if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
wikibarColorTool.displayColorPicker(false);
}
return true;
};
function wikibar_doSelectPalette(param){
clearMessage();
var theButton = param.button;
if(!theButton.toolItem.key) { return; }
var palette = theButton.toolItem.key;
var oldPaletteName = wikibarColorTool.paletteName;
if(oldPaletteName != palette){
try{
wikibarColorTool.createColorPicker(theButton, palette);
displayMessage('Palette \"'+palette+'\" ('+ wikibarColorTool.palette.length +' colors) is selected');
}catch(ex){
errMsg = ex;
if(errMsg.substring(0,18)=='renderColorPalette'){
displayMessage('Invalid palette \"' + palette + '\", please check it out!');
wikibarColorTool.createColorPicker(theButton, oldPaletteName);
}
}
}
}
var wikibarPopup = {
skipClickDocumentEvent: false,
stack: []
};
wikibarPopup.resolveRootPopup = function(o){
if(o.isOnMainMenu){ return null; }
if(o.className.substring(0,12)=='wikibarPopup'){ return o;}
return wikibarPopup.resolveRootPopup(o.parentNode);
};
wikibarPopup.create = function(root){
for(var i=0; i<wikibarPopup.stack.length; i++){
var p=wikibarPopup.stack[i];
if(p.root==root){
wikibarPopup.removeFrom(i+1);
return null;
}
}
var rootPopup = wikibarPopup.resolveRootPopup(root);
if(!rootPopup){
wikibarPopup.remove();
}else{
wikibarPopup.removeFromRootPopup(rootPopup);
}
var popup = createTiddlyElement(document.body,'div','wikibarPopup'+root.toolItem.key,'wikibarPopup');
var pop = createTiddlyElement(popup,'table','','');
wikibarPopup.stack.push({rootPopup: rootPopup, root: root, popup: popup});
return pop;
};
wikibarPopup.show = function(unused,slowly){
var curr = wikibarPopup.stack[wikibarPopup.stack.length-1];
var overlayWidth = 1;
var rootLeft, rootTop, rootWidth, rootHeight, popupLeft, popupTop, popupWidth;
if(curr.rootPopup){
rootLeft = findPosX(curr.rootPopup);
rootTop = findPosY(curr.root);
rootWidth = curr.rootPopup.offsetWidth;
popupLeft = rootLeft + rootWidth - overlayWidth;
popupTop = rootTop;
}else{
rootLeft = findPosX(curr.root);
rootTop = findPosY(curr.root);
rootHeight = curr.root.offsetHeight;
popupLeft = rootLeft;
popupTop = rootTop + rootHeight;
}
var winWidth = findWindowWidth();
popupWidth = curr.popup.offsetWidth;
if(popupLeft + popupWidth > winWidth){
popupLeft = rootLeft - popupWidth + overlayWidth;
}
curr.popup.style.left = popupLeft + 'px';
curr.popup.style.top = popupTop + 'px';
curr.popup.style.display = 'block';
addClass(curr.root, 'highlight');
if(config.options.chkAnimate){
anim.startAnimating(new Scroller(curr.popup,slowly));
}else{
window.scrollTo(0,ensureVisible(curr.popup));
}
};
wikibarPopup.remove = function(){
if(wikibarPopup.stack.length > 0){
wikibarPopup.removeFrom(0);
}
};
wikibarPopup.removeFrom = function(from){
for(var t=wikibarPopup.stack.length-1; t>=from; t--){
var p = wikibarPopup.stack[t];
removeClass(p.root,'highlight');
p.popup.parentNode.removeChild(p.popup);
}
wikibarPopup.stack = wikibarPopup.stack.slice(0,from);
};
wikibarPopup.removeFromRootPopup = function(from){
for(var t=0; t<wikibarPopup.stack.length; t++){
var p = wikibarPopup.stack[t];
if(p.rootPopup==from){
wikibarPopup.removeFrom(t);
break;
}
}
};
wikibarPopup.onDocumentClick = function(e){
if (!e){ e = window.event; }
if(wikibarPopup.skipClickDocumentEvent){
wikibarPopup.skipClickDocumentEvent=false;
return true;
}
if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
wikibarPopup.remove();
}
return true;
};
var wikibarStore = {
TYPE: 'MAIN_MENU',
help:{
TYPE:'MENU',
CAPTION: '<font face=\"verdana\">?</font>',
TOOLTIP: 'about WikiBar',
options:{
TYPE:'MENU',
DYNAITEM: wikibar_genWikibarOptions
},
about:{
TYPE:'MENU',
DYNAITEM: wikibar_genWikibarAbout
}
},
preview:{
TOOLTIP: 'preview this tiddler',
CAPTION: '<font face=\"verdana\">∞</font>',
HANDLER: wikibar_doPreview
},
line:{
TOOLTIP: 'horizontal line',
CAPTION: '<font face=\"verdana\">—</font>',
syntax: '\n----\n',
HANDLER: wikibar_editFormatByCursor
},
crlf:{
TOOLTIP: 'new line',
CAPTION: '<font face=\"verdana\">¶</font>',
syntax: '\n',
HANDLER: wikibar_editFormatByCursor
},
selectAll:{
TOOLTIP: 'select all',
CAPTION: '<font face=\"verdana\">§</font>',
HANDLER: wikibar_editSelectAll
},
deleteSelected:{
TOOLTIP: 'delete selected',
CAPTION: '<font face=\"verdana\">×</font>',
syntax: '',
HANDLER: wikibar_editFormat
},
textFormat:{
TYPE: 'MENU',
CAPTION: 'text',
TOOLTIP: 'text formatters',
ignore:{
TOOLTIP: 'ignore wiki word',
CAPTION: 'ignore wikiWord',
syntax: '~user_text',
hint: 'wiki_word',
HANDLER: wikibar_editFormatByWord
},
bolder:{
TOOLTIP: 'bolder text',
CAPTION: '<strong>bolder</strong>',
syntax: "''user_text''",
hint: 'bold_text',
HANDLER: wikibar_editFormatByWord
},
italic:{
TOOLTIP: 'italic text',
CAPTION: '<em>italic</em>',
syntax: '\/\/user_text\/\/',
hint: 'italic_text',
HANDLER: wikibar_editFormatByWord
},
underline:{
TOOLTIP: 'underline text',
CAPTION: '<u>underline</u>',
syntax: '__user_text__',
hint: 'underline_text',
HANDLER: wikibar_editFormatByWord
},
strikethrough:{
TOOLTIP: 'strikethrough text',
CAPTION: '<strike>strikethrough</strike>',
syntax: '==user_text==',
hint: 'strikethrough_text',
HANDLER: wikibar_editFormatByWord
},
superscript:{
TOOLTIP: 'superscript text',
CAPTION: 'X<sup>superscript</sup>',
syntax: '^^user_text^^',
hint: 'superscript_text',
HANDLER: wikibar_editFormatByWord
},
subscript:{
TOOLTIP: 'subscript text',
CAPTION: 'X<sub>subscript</sub>',
syntax: '~~user_text~~',
hint: 'subscript_text',
HANDLER: wikibar_editFormatByWord
},
comment:{
TOOLTIP: 'comment text',
CAPTION: 'comment text',
syntax: '/%user_text%/',
hint: 'comment_text',
HANDLER: wikibar_editFormatByWord
},
monospaced:{
TOOLTIP: 'monospaced text',
CAPTION: '<code>monospaced</code>',
syntax: '{{{user_text}}}',
hint: 'monospaced_text',
HANDLER: wikibar_editFormatByWord
}
},
paragraph:{
TYPE: 'MENU',
TOOLTIP: 'paragarph formatters',
list:{
TYPE: 'MENU',
TOOLTIP: 'list tools',
bullet:{
TOOLTIP: 'bullet point',
syntax: '*user_text',
hint: 'bullet_text',
HANDLER: wikibar_editFormatByLine
},
numbered:{
TOOLTIP: 'numbered list',
syntax: '#user_text',
hint: 'numbered_text',
HANDLER: wikibar_editFormatByLine
}
},
heading:{
TYPE: 'MENU',
heading1:{
CAPTION:'<h1>Heading 1</h1>',
TOOLTIP: 'Heading 1',
syntax: '!user_text',
hint: 'heading_1',
HANDLER: wikibar_editFormatByLine
},
heading2:{
CAPTION:'<h2>Heading 2<h2>',
TOOLTIP: 'Heading 2',
syntax: '!!user_text',
hint: 'heading_2',
HANDLER: wikibar_editFormatByLine
},
heading3:{
CAPTION:'<h3>Heading 3</h3>',
TOOLTIP: 'Heading 3',
syntax: '!!!user_text',
hint: 'heading_3',
HANDLER: wikibar_editFormatByLine
},
heading4:{
CAPTION:'<h4>Heading 4</h4>',
TOOLTIP: 'Heading 4',
syntax: '!!!!user_text',
hint: 'heading_4',
HANDLER: wikibar_editFormatByLine
},
heading5:{
CAPTION:'<h5>Heading 5</h5>',
TOOLTIP: 'Heading 5',
syntax: '!!!!!user_text',
hint: 'heading_5',
HANDLER: wikibar_editFormatByLine
}
},
comment:{
TYPE: 'MENU',
commentByLine:{
CAPTION:'comment by line',
TOOLTIP: 'line comment',
syntax: '/%user_text%/',
hint: 'comment_text',
HANDLER: wikibar_editFormatByLine
},
commentByBlock:{
CAPTION:'comment by block',
TOOLTIP: 'block comment',
syntax: '/%\nuser_text\n%/',
hint: 'comment_text',
byBlock: true,
HANDLER: wikibar_editFormatByLine
}
},
monospaced:{
TYPE: 'MENU',
monosByLine:{
CAPTION: 'monospaced by line',
TOOLTIP: 'line monospaced',
syntax: '{{{\nuser_text\n}}}',
hint: 'monospaced_text',
HANDLER: wikibar_editFormatByLine
},
monosByBlock:{
CAPTION: 'monospaced by block',
TOOLTIP: 'block monospaced',
syntax: '{{{\nuser_text\n}}}',
hint: 'monospaced_text',
byBlock: true,
HANDLER: wikibar_editFormatByLine
}
},
quote:{
TYPE: 'MENU',
quoteByLine:{
CAPTION: 'quote by line',
TOOLTIP: 'line quote',
syntax: '>user_text',
hint: 'quote_text',
HANDLER: wikibar_editFormatByLine
},
quoteByBlcok:{
CAPTION: 'quote by block',
TOOLTIP: 'block quote',
syntax: '<<<\nuser_text\n<<<',
hint: 'quote_text',
byBlock: true,
HANDLER: wikibar_editFormatByLine
}
},
plugin:{
TYPE: 'MENU',
code:{
CAPTION: 'code area',
TOOLTIP: 'block monospaced for plugin',
syntax: '\n\/\/{{{\nuser_text\n\/\/}}}\n',
hint: 'monospaced_plugin_code',
byBlock: true,
HANDLER: wikibar_editFormatByLine
},
commentByLine:{
CAPTION: 'comment by line',
TOOLTIP: 'line comment',
syntax: '\/\/user_text',
hint: 'plugin_comment',
HANDLER: wikibar_editFormatByLine
},
commentByBlock:{
CAPTION: 'comment by block',
TOOLTIP: 'block comment',
syntax: '\/\***\nuser_text\n***\/',
hint: 'plugin_comment',
byBlock: true,
HANDLER: wikibar_editFormatByLine
}
},
css:{
TYPE: 'MENU',
code:{
CAPTION: 'code area',
TOOLTIP: 'block monospaced for css',
syntax: '\n\nuser_text\n\n',
hint: 'monospaced_css_code',
byBlock: true,
HANDLER: wikibar_editFormatByLine
},
commentByLine:{
CAPTION: 'comment by line',
TOOLTIP: 'line comment',
syntax: '',
hint: 'css_comment',
HANDLER: wikibar_editFormatByLine
},
commentByBlock:{
CAPTION: 'comment by block',
TOOLTIP: 'block comment',
syntax: '',
hint: 'css_comment',
byBlock: true,
HANDLER: wikibar_editFormatByLine
}
}
},
color:{
TYPE: 'MENU',
TOOLTIP: 'color tools',
highlight:{
CAPTION:'highlight text',
TOOLTIP: 'highlight text',
syntax: '@@user_text@@',
hint: 'highlight_text',
HANDLER: wikibar_editFormatByWord
},
color:{
CAPTION:'text color',
TOOLTIP: 'text color',
hint: 'your_text',
syntax: '@@color(%1):user_text@@',
HANDLER: wikibar_getColorCode,
doMore: wikibar_editFormatByWord
},
bgcolor:{
CAPTION:'background color',
TOOLTIP: 'background color',
hint: 'your_text',
syntax: '@@bgcolor(%1):user_text@@',
HANDLER: wikibar_getColorCode,
doMore: wikibar_editFormatByWord
},
colorcode:{
CAPTION:'color code',
TOOLTIP: 'insert color code',
syntax: '%1',
HANDLER: wikibar_getColorCode,
doMore: wikibar_editFormatByCursor
},
'color palette':{
TYPE:'MENU',
DYNAITEM: wikibar_genPaletteSelector,
SEPERATOR:{},
morePalette:{
CAPTION:'more palettes',
TOOLTIP:'get more palettes',
HANDLER: wikibar_getMorePalette
}
}
},
link:{
TYPE: 'MENU',
TOOLTIP: 'insert link',
wiki:{
CAPTION:'wiki link',
TOOLTIP: 'wiki link',
syntax: '[[user_text]]',
hint: 'wiki_word',
HANDLER: wikibar_editFormatByWord
},
pretty:{
CAPTION: 'pretty link',
TOOLTIP: 'pretty link',
syntax: '[[user_text|%1]]',
hint: 'pretty_word',
param: 'PrettyLink Target',
HANDLER: wikibar_getLinkUrl,
doMore: wikibar_editFormatByWord
},
url:{
TOOLTIP: 'url link',
syntax: '[[user_text|%1]]',
hint: 'your_text',
param: 'http:\/\/...',
HANDLER: wikibar_getLinkUrl,
doMore: wikibar_editFormatByWord
},
image:{
TOOLTIP: 'image link',
syntax: '[img[user_text|%1]]',
hint: 'alt_text',
param: 'image/icon.jpg',
HANDLER: wikibar_getLinkUrl,
doMore: wikibar_editFormatByWord
}
},
macro:{},
more:{
TYPE: 'MENU',
TOOLTIP: 'more tools',
table:{
TYPE: 'MENU',
TOOLTIP: 'table',
table:{
CAPTION:'create table',
TOOLTIP: 'create a new table',
syntax: '\n%1\n',
HANDLER: wikibar_getTableRowCol,
doMore: wikibar_editFormatByWord
},
header:{
TOOLTIP: 'table header text',
syntax: '|user_text|c',
hint: 'table_header',
HANDLER: wikibar_editFormatByWord
},
cell:{
TOOLTIP: 'create a tabel cell',
syntax: '|user_text|',
hint: 'your_text',
HANDLER: wikibar_editFormatByWord
},
columnHeader:{
CAPTION:'column header',
TOOLTIP: 'create a column header cell',
syntax: '|!user_text|',
hint: 'column_header',
HANDLER: wikibar_editFormatByWord
},
cell:{
TYPE: 'MENU',
CAPTION: 'cell options',
bgcolor:{
CAPTION: 'background color',
TOOLTIP: 'cell bgcolor',
syntax: '|bgcolor(%1):user_text|',
hint: 'your_text',
HANDLER: wikibar_getColorCode,
doMore: wikibar_editFormatByTableCell
},
alignLeft:{
CAPTION: 'align left',
TOOLTIP: 'left align cell text',
syntax: '|user_text|',
hint: 'your_text',
HANDLER: wikibar_editFormatByTableCell
},
alignCenter:{
CAPTION: 'align center',
TOOLTIP: 'center align cell text',
syntax: '| user_text |',
hint: 'your_text',
HANDLER: wikibar_editFormatByTableCell
},
alignRight:{
CAPTION: 'align right',
TOOLTIP: 'right align cell text',
syntax: '| user_text|',
hint: 'your_text',
HANDLER: wikibar_editFormatByTableCell
}
}
},
html:{
TYPE: 'MENU',
html:{
CAPTION: '<html>',
TOOLTIP: 'html tag',
syntax: '<html>\nuser_text\n</html>',
hint: 'html_content',
byBlock: true,
HANDLER: wikibar_editFormatByLine
}
}
},
addon:{
TYPE: 'MENU',
TOOLTIP:'3rd party tools',
'about addons':{
TOOLTIP: 'list loaded addons',
HANDLER: wikibar_doListAddons
},
SEPERATOR:{}
}
};
addEvent(document, 'click', wikibarColorTool.onDocumentClick);
addEvent(document, 'click', wikibarPopup.onDocumentClick);
wikibar_install();
//}}}
/***
|Name|WikifyPlugin|
|Source|http://www.TiddlyTools.com/#WikifyPlugin|
|Documentation|http://www.TiddlyTools.com/#WikifyPluginInfo|
|Version|1.1.4|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|substitute fields, slices, or computed values into a wiki-syntax format string and render results dynamically|
The {{{<<wikify>>}}} macro allows you to easily retrieve values from custom tiddler fields, tiddler slices, computed values (using javascript) or just plain old literals, and assemble them into small bits of generated wiki-syntax text content that can be rendered directly into a tiddler, or used in the ViewTemplate or EditTemplate to add dynamically-generated content to each tiddler.
The {{{<<wikiCalc>>}}} macro performs the same processing as {{{<<wikify>>}}} and, in addition, passes the assembled text content through javascript's {{{eval()}}} function before rendering the results. This allows you to, for example, construct and compute mathematical expressions that use input values extracted from tiddler fields or slices.
!!!!!Documentation
> see [[WikifyPluginInfo]]
!!!!!Revisions
<<<
2009.03.29 [1.1.4] in handler(), pass 'tiddler' value to wikify() to fix macro errors in rendered content
|please see [[WikifyPluginInfo]] for additional revision details|
2007.06.22 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.WikifyPlugin= {major: 1, minor: 1, revision: 4, date: new Date(2009,3,29)};
config.macros.wikify={
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var fmt=params.shift();
var values=[];
var out="";
if (!fmt.match(/\%[0-9]/g) && params.length) // format has no markers, just join all params with spaces
out=fmt+" "+params.join(" ");
else { // format param has markers, get values and perform substitution
while (p=params.shift()) values.push(this.getFieldReference(place,p));
out=fmt.format(values);
}
if (macroName=="wikiCalc") out=eval(out).toString();
wikify(out.unescapeLineBreaks(),place,null,tiddler);
},
getFieldReference: function(place,p) { // "slicename::tiddlername" or "fieldname@tiddlername" or "fieldname"
if (typeof p != "string") return p; // literal non-string value... just return it...
var parts=p.split(config.textPrimitives.sliceSeparator);
if (parts.length==2) {// maybe a slice reference?
var tid=parts[0]; var slice=parts[1];
if (!tid || !tid.length || tid=="here") { // no target (or "here"), use containing tiddler
tid=story.findContainingTiddler(place);
if (tid) tid=tid.getAttribute("tiddler")
else tid="SiteSlices"; // fallback for 'non-tiddler' areas (e.g, header, sidebar, etc.)
}
var val=store.getTiddlerSlice(tid,slice); // get tiddler slice value
}
if (val==undefined) {// not a slice, or slice not found, maybe a field reference?
var parts=p.split("@");
var field=parts[0];
if (!field || !field.length) field="checked"; // missing fieldname, fallback: checked@tiddlername
var tid=parts[1];
if (!tid || !tid.length || tid=="here") { // no target (or "here"), use containing tiddler
tid=story.findContainingTiddler(place);
if (tid) tid=tid.getAttribute("tiddler")
else tid="SiteFields"; // fallback for 'non-tiddler' areas (e.g, header, sidebar, etc.)
}
var val=store.getValue(tid,field);
}
// not a slice or field, or slice/field not found... return value unchanged
return val===undefined?p:val;
}
}
//}}}
//{{{
// define alternative macroName for triggering pre-rendering call to eval()
config.macros.wikiCalc=config.macros.wikify;
//}}}
/***
|''Name:''|YourSearchPlugin|
|''Version:''|2.1.0 (2006-10-12)|
|''Source:''|http://tiddlywiki.abego-software.de/#YourSearchPlugin ([[del.icio.us|http://del.icio.us/post?url=http://tiddlywiki.abego-software.de/index.html%23YourSearchPlugin]])|
|''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-2006 [[abego Software|http://www.abego-software.de]]|
|''~CoreVersion:''|2.1.0|
|''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.
!Revision history
* v2.1.0 (2006-10-12)
** Release version with TiddlyWiki 2.1 support
*** Support (Extended) Field search
*** Support parenthesis in Boolean Search
*** Support direct regular expression input
*** Support JavaScript Expressions for filtering
*** "new tiddler" feature (create tiddler based on search text)
* v2.0.2 (2006-02-13)
** Bugfix for Firefox 1.5.0.1 related to the "Show prefix" checkbox. Thanks to Ted Pavlic for reporting and to BramChen for fixing.
** Internal
*** Make "JSLint" conform
* v2.0.1 (2006-02-05)
** Support "Exact Word Match" (use '=' to prefix word)
** Support default filter settings (when no filter flags are given in search term)
** Rework on the "less than 3 chars search text" feature (thanks to EricShulman)
** Better support SinglePageMode when doing "Open all tiddlers" (thanks to EricShulman)
** Support Firefox 1.5.0.1
** Bug: Fixed a hilite bug in "classic search mode" (thanks to EricShulman)
* v2.0.0 (2006-01-16)
** Add User Interface
* v1.0.1 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.0 (2005-12-28)
** initial version
!Source Code
***/
//{{{
//============================================================================
//============================================================================
// YourSearchPlugin
//============================================================================
//============================================================================
// Ensure that the Plugin is only installed once.
//
if (!version.extensions.YourSearchPlugin) {
version.extensions.YourSearchPlugin = {
major: 2, minor: 1, revision: 0,
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-2006 (www.abego-software.de)"
};
if (!window.abego) window.abego = {};
// define the Array forEach when not yet defined (e.g. by Mozilla)
if (!Array.forEach) {
Array.forEach = function(obj, callback, thisObj) {
for (var i = 0,len = obj.length; i < len; i++)
callback.call(thisObj, obj[i], i, obj);
};
Array.prototype.forEach = function(callback, thisObj) {
for (var i = 0,len = this.length; i < len; i++)
callback.call(thisObj, this[i], i, this);
};
}
abego.toInt = function(s, defaultValue) {
if (!s) return defaultValue;
var n = parseInt(s);
return (n == NaN) ? defaultValue : n;
};
abego.createEllipsis = function(place) {
var e = createTiddlyElement(place,"span");
e.innerHTML = "…";
};
//#concept Object
//
abego.shallowCopy = function(object) {
if (!object)
return object;
var result = {};
for (var n in object)
result[n] = object[n];
return result;
};
// Returns a shallow copy of the options, or a new, empty object if options is null/undefined.
//
// @param options [may be null/undefined]
//
//#concept Object, Options
//#import abego.shallowCopy
//
abego.copyOptions = function(options) {
return !options ? {} : abego.shallowCopy(options);
};
//#import abego.define-namespace
// returns the number of occurances of s in the text
abego.countStrings = function(text, s) {
if (!s)
return 0;
var len = s.length;
var n = 0;
var lastIndex = 0;
while (1) {
var i = text.indexOf(s, lastIndex);
if (i < 0)
return n;
n++;
lastIndex = i+len;
}
return n;
};// Returns the content of the first "braced" text {...}
// Also takes care of nested braces
//
// Returns undefined when no braced text is found or it is not properly nested
//
// @param [optional] when defined and a braced text is found lastIndexRef.lastIndex will contain the index of the char following the (final) closing brace on return.
//
abego.getBracedText = function(text, offset,lastIndexRef) {
if (!offset) offset = 0;
var re = /\{([^\}]*)\}/gm;
re.lastIndex = offset;
var m = re.exec(text);
if (m) {
// The matching stopped at the first closing brace.
// But if the matched text contains opening braces
// this is not the final closing brace.
// Handle this case specially, find the "corresponding" closing brace
var s = m[1];
var nExtraOpenBrace = abego.countStrings(s,"{");
if (!nExtraOpenBrace) {
if (lastIndexRef)
lastIndexRef.lastIndex = re.lastIndex;
// simple case: no nested braces
return s;
}
// special case: "nested braces"
var len = text.length;
for (var i = re.lastIndex; i < len && nExtraOpenBrace; i++) {
var c = text.charAt(i);
if (c == "{")
nExtraOpenBrace++;
else if (c == "}")
nExtraOpenBrace--;
}
if (!nExtraOpenBrace) {
// found the corresponding "}".
if (lastIndexRef)
lastIndexRef.lastIndex = i-1;
return text.substring(m.index+1, i-1);
}
}
// no return means: return undefined;
};
// Returns an array with those items from the array that pass the given test
//
// @param test an one-arg boolean function that returns true when the item should be added.
// @param testObj [optional] the receiver for the test function (global if undefined or null)
// @param result [optional] an array. When define the selected items are added to this array, otherwise a new array is used.
//
//#import Array.prototype.forEach
//
abego.select = function(array,test,testObj,result) {
if (!result) result = [];
array.forEach(function(t) {
if (test.call(testObj,t))
result.push(t);
});
return result;
};
// Class abego.TiddlerFilterTerm =================================================================
//
// Used to check if a tiddler contains a given text.
//
// A list of fields (standard and/or extended) may be specified to restrict the search to certain fields.
//
// When no explicit fields are given the fields defined by defaultFields are checked, plus all extended
// fields (when options.withExtendedFields is true).
//
// @param options [may be null/undefined]
// options.fields @seeParam abego.MultiFieldRegExpTester.fields
// options.withExtendedFields @seeParam abego.MultiFieldRegExpTester.withExtendedFields
// options.caseSensitive [Default: false]
// options.fullWordMatch [Default: false]
// options.textIsRegExp [Default: false] when true the given text is already a regExp
//
//#import abego.MultiFieldRegExpTester
//
abego.TiddlerFilterTerm = function(text,options) {
if (!options) options = {};
var reText = text;
if (!options.textIsRegExp) {
reText = text.escapeRegExp();
if (options.fullWordMatch)
reText = "\\b"+reText+"\\b";
}
var regExp = new RegExp(reText, "m"+(options.caseSensitive ? "" : "i"));
this.tester = new abego.MultiFieldRegExpTester(regExp, options.fields, options.withExtendedFields);
}
abego.TiddlerFilterTerm.prototype.test = function(tiddler) {
return this.tester.test(tiddler);
}
//#import abego.define-namespace
// Recognize a string like
// "Some Title. Some content text #Tag1 #Tag2 Tag3"
// with the tags and the text being optional.
// Also the period at the end of the title is optional when no content text is specified)
//
// Returns the result in an object with properties "title" and "params",
// with "params" following the parseParams format, containing the "tag" and "text" arguments.
//
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 = [[]];
// add the text parameter
var text = m[2]?m[2].trim():"";
r.push({name: "text", value: text});
r[0].text = [text];
return {title: m[1].trim(), params: r};
} else
return {title: s.trim(),params: [[]]};
}
// options.defaultFields [@seeOptionDefault abego.TiddlerFilterTerm.fields] fields to check when no fields are explicitly specified in queryText.
// options.withExtendedFields [@seeOptionDefault abego.TiddlerFilterTerm.withExtendedFields] when true and no fields are explicitly specified in queryText also the extended fields are considered (in addition to the ones in defaultFields).
// @seeOptions abego.TiddlerFilterTerm (-fields -fullWordMatch -withExtendedFields)
//
//#import abego.getBracedText
//#import abego.copyOptions
//#import abego.TiddlerFilterTerm
//
abego.parseTiddlerFilterTerm = function(queryText,offset,options) {
// group 1: {...} (JavaScript expression)
// group 2: '=' (full word match (optional))
// group 3: [!%#] (field selection short cuts)
// group 4: fieldName ':'
// group 5: String literal "..."
// group 6: RegExp literal /.../
// group 7: scheme '://' nonSpaceChars
// group 8: word
var re = /\s*(?:(?:\{([^\}]*)\})|(?:(=)|([#%!])|(?:(\w+)\s*\:(?!\/\/))|(?:(?:("(?:(?:\\")|[^"])+")|(?:\/((?:(?:\\\/)|[^\/])+)\/)|(\w+\:\/\/[^\s]+)|([^\s\)\-\"]+)))))/mg;
var shortCuts = {'!':'title','%':'text','#':'tags'};
var fieldNames = {};
var fullWordMatch;
re.lastIndex = offset;
while (1) {
var i = re.lastIndex;
var m = re.exec(queryText);
if (!m || m.index != i)
throw "Word or String literal expected";
if (m[1]) {
var lastIndexRef = {};
var code = abego.getBracedText(queryText,0,lastIndexRef);
if (!code)
throw "Invalid {...} syntax";
var f = Function("tiddler","return ("+code+");");
return {func: f,
lastIndex:lastIndexRef.lastIndex,
markRE: null};
}
if (m[2])
fullWordMatch = true;
else if (m[3])
fieldNames[shortCuts[m[3]]] = 1;
else if (m[4])
fieldNames[m[4]] = 1;
else {
var textIsRegExp = m[6];
var text = m[5] ? window.eval(m[5]) : m[6] ? m[6] : m[7] ? m[7] : m[8];
var options = abego.copyOptions(options);
options.fullWordMatch = fullWordMatch;
options.textIsRegExp = textIsRegExp;
var fields = [];
for (var n in fieldNames)
fields.push(n);
if (fields.length == 0) {
options.fields = options.defaultFields;
} else {
options.fields = fields;
options.withExtendedFields = false;
}
var term = new abego.TiddlerFilterTerm(text,options);
var markREText = textIsRegExp ? text : text.escapeRegExp();
if (markREText && fullWordMatch)
markREText = "\\b"+markREText+"\\b";
return {func: function(tiddler) {return term.test(tiddler);},
lastIndex:re.lastIndex,
markRE: markREText ? "(?:"+markREText+")" : null};
}
}
};
// Class abego.BoolExp =================================================================
//
// Allows the execution/evaluation of a boolean expression, according to this syntax:
//
// boolExpression : unaryExpression (("AND"|"OR"|"&&"|"||")? unaryExpression)*
// ;
//
// unaryExpression : ("not"|"-")? primaryExpression
// ;
//
// primaryExpression : "(" boolExpression ")"
// | Term
// ;
//
// For flexibility the Term syntax is defined by a separate parse function.
//
// Notice that there is no precedence between "AND" and "OR" operators, i.e. they are evaluated from left to right.
//
// To evaluate the expression in a given context use code like this:
//
// var be = new abego.BoolExp(s, termParseFunc);
// var result = be.exec(context);
//
// @param s the text defining the expression
// @param parseTermFunc a Function(text,offset,options) that parses the text starting at offset for a "Term" and returns an object with properties {func: Function(context), lastIndex: ...}. func is the function to be used to evaluate the term in the given context.
// @param options [may be null/undefined] (is also passed to the parseTermFunc)
// options.defaultOperationIs_OR [Default: false] When true the concatenation of unaryExpressions (without an operator) is interpreted as an "OR", otherwise as an "AND".
// options.caseSensitive [default: false]
//
abego.BoolExp = function(s, parseTermFunc, options) {
this.s = s;
var defaultOperationIs_OR = options && options.defaultOperationIs_OR;
var reStart = /\s*(?:(\-|not)|(\())/gi; // group 1: NOT, group2 "("
var reCloseParenthesis = /\s*\)/g; // match )
var reAndOr = /\s*(?:(and|\&\&)|(or|\|\|))/gi; // group 1: AND, group 2: OR
var reNonWhiteSpace = /\s*[^\)\s]/g;
var reNot_Parenthesis = /\s*(\-|not)?(\s*\()?/gi;
var parseUnaryExpression = function(offset) {
reNot_Parenthesis.lastIndex = offset;
var m = reNot_Parenthesis.exec(s);
var negate;
var result;
if (m && m.index == offset) {
offset = reNot_Parenthesis.lastIndex;
negate = m[1];
if (m[2]) {
// case: (...)
var e = parseBoolExpression(offset);
reCloseParenthesis.lastIndex = e.lastIndex;
if (!reCloseParenthesis.exec(s))
throw "Missing ')'";
result = {func: e.func, lastIndex: reCloseParenthesis.lastIndex};
}
}
if (!result)
result = parseTermFunc(s,offset,options);
if (negate) {
result.func = (function(f){return function(context) {return !f(context);}})(result.func);
// don't mark patterns that are negated
// (This is essential since the marking may also be used to calculate "ranks". If we
// would also count the negated matches (i.e. that should not exist) the rank may get too high)
result.markRE = null;
}
return result;
};
var parseBoolExpression = function(offset) {
var result = parseUnaryExpression(offset);
while (1) {
var l = result.lastIndex;
reAndOr.lastIndex = l;
var m = reAndOr.exec(s);
var isOrCase;
var nextExp;
if (m && m.index == l) {
isOrCase = !m[1];
nextExp = parseUnaryExpression(reAndOr.lastIndex);
} else {
// no "AND" or "OR" found.
// Maybe it is a concatenations of parseUnaryExpression without operators
try {
nextExp = parseUnaryExpression(l);
} catch (e) {
// no unary expression follows. We are done
return result;
}
isOrCase = defaultOperationIs_OR;
}
result.func = (function(func1, func2, isOrCase) {
return isOrCase
? function(context) {return func1(context) || func2(context);}
: function(context) {return func1(context) && func2(context);};
})(result.func,nextExp.func,isOrCase);
result.lastIndex = nextExp.lastIndex;
if (!result.markRE)
result.markRE = nextExp.markRE;
else if (nextExp.markRE)
result.markRE = result.markRE + "|" + nextExp.markRE;
}
};
var expr = parseBoolExpression(0);
this.evalFunc = expr.func;
if (expr.markRE)
this.markRegExp = new RegExp(expr.markRE, options.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;
};
// Class abego.MultiFieldRegExpTester ==================================================================
//
// @param fields [optional; Default: ["title","text","tags"]] array of names of fields to be considered
// @param withExtendedFields [optional; Default: false] when true also extended fields are considered (in addition to the ones given in 'fields')
//
abego.MultiFieldRegExpTester = function(re, fields, withExtendedFields) {
this.re = re;
this.fields = fields ? fields : ["title","text","tags"];
this.withExtendedFields = withExtendedFields;
}
// Returns the name of the first field found that value succeeds the given test,
// or null when no such field is found
//
abego.MultiFieldRegExpTester.prototype.test = function(tiddler) {
var re = this.re;
// Check the fields explicitly specified
for (var i = 0; i < this.fields.length; i++) {
var s = store.getValue(tiddler, this.fields[i]);
if (typeof s == "string" && re.test(s))
return this.fields[i];
}
// Check the extended fields (if required)
if (this.withExtendedFields)
return store.forEachField(
tiddler,
function(tiddler, fieldName, value) {
return typeof value == "string" && re.test(value)?fieldName:null;
}, true);
return null;
}
// Class abego.TiddlerQuery ==================================================================
//
//#import abego.select
//#import abego.MultiFieldRegExpTester
//
abego.TiddlerQuery = function(queryText,caseSensitive,useRegExp,defaultFields,withExtendedFields) {
if (useRegExp) {
this.regExp = new RegExp(queryText, caseSensitive ? "mg" : "img");
this.tester = new abego.MultiFieldRegExpTester(this.regExp, defaultFields, withExtendedFields);
} else {
this.expr = new abego.BoolExp(
queryText,
abego.parseTiddlerFilterTerm, {
defaultFields: defaultFields,
caseSensitive: caseSensitive,
withExtendedFields: withExtendedFields});
}
this.getQueryText = function() {
return queryText;
};
this.getUseRegExp = function() {
return useRegExp;
};
this.getCaseSensitive = function() {
return caseSensitive;
};
this.getDefaultFields = function() {
return defaultFields;
};
this.getWithExtendedFields = function() {
return withExtendedFields;
};
}
// Returns true iff the query includes the given tiddler
//
// @param tiddler [may be null/undefined]
//
abego.TiddlerQuery.prototype.test = function(tiddler) {
if (!tiddler) return false;
if (this.regExp) {
return this.tester.test(tiddler);
}
return this.expr.exec(tiddler);
};
// Returns an array with those tiddlers from the tiddlers array that match the query.
//
abego.TiddlerQuery.prototype.filter = function(tiddlers) {
return abego.select(tiddlers,this.test,this);
};
abego.TiddlerQuery.prototype.getMarkRegExp = function() {
if (this.regExp) {
// Only use the regExp for marking when it does not match the empty string.
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();
};
// Class abego.PageWiseRenderer ================================================
//
// Subclass or instance must implement getItemsPerPage function;
// They should also implement onPageChanged and refresh the container of the
// PageWiseRenderer on that event.
//
//#import abego.toInt
//
abego.PageWiseRenderer = function() {
this.firstIndexOnPage = 0; // The index of the first item of the lastResults list displayed on the search result page
};
merge(abego.PageWiseRenderer.prototype, {
setItems: function(items) {
this.items = items;
this.setFirstIndexOnPage(0);
},
// Maximum number of pages listed in the navigation bar (before or after the current page)
//
getMaxPagesInNavigation: function() {
return 10;
},
getItemsCount: function(items) {
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(index) {
this.firstIndexOnPage = Math.min(Math.max(0, index), this.getItemsCount()-1);
},
getFirstIndexOnPage: function() {
// Ensure that the firstIndexOnPage is really a page start.
// This may have become violated when getItemsPerPage has changed,
// (e.g. when switching between previewText and simple mode.)
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(pageIndex,oldPageIndex) {
},
renderPage: function(itemRenderer) {
if (itemRenderer.beginRendering)
itemRenderer.beginRendering(this);
try {
// When there are items found add them to the result page (pagewise)
if (this.getItemsCount()) {
// Add the items of the current page
var lastIndex = this.getLastIndexOnPage();
var iInPage = -1;
for (var i=this.getFirstIndexOnPage(); i <= lastIndex; i++) {
iInPage++;
itemRenderer.render(this,this.items[i],i,iInPage);
}
}
} finally {
if (itemRenderer.endRendering)
itemRenderer.endRendering(this);
}
},
addPageNavigation: function(place) {
if (!this.getItemsCount()) return;
var self = this;
var onNaviButtonClick = function(e) {
if (!e) var e = window.event;
var pageIndex = abego.toInt(this.getAttribute("page"),0);
var oldPageIndex = self.getCurrentPageIndex();
if (pageIndex == oldPageIndex)
return;
var index = pageIndex * self.getItemsPerPage();
self.setFirstIndexOnPage(index);
self.onPageChanged(pageIndex,oldPageIndex);
};
var button;
var currentPageIndex = this.getCurrentPageIndex();
var lastPageIndex = this.getLastPageIndex();
if (currentPageIndex > 0) {
button = createTiddlyButton(place, "Previous", "Go to previous page (Shortcut: Alt-'<')", onNaviButtonClick, "prev");
button.setAttribute("page",(currentPageIndex-1).toString());
button.setAttribute("accessKey","<");
}
for (var i = -this.getMaxPagesInNavigation(); i < this.getMaxPagesInNavigation(); i++) {
var pageIndex = currentPageIndex+i;
if (pageIndex < 0) continue;
if (pageIndex > lastPageIndex) break;
var pageNo = (i+currentPageIndex+1).toString();
var buttonClass = pageIndex == currentPageIndex ? "currentPage" : "otherPage";
button = createTiddlyButton(place, pageNo, "Go to page %0".format([pageNo]), onNaviButtonClick, buttonClass);
button.setAttribute("page",(pageIndex).toString());
}
if (currentPageIndex < lastPageIndex) {
button = createTiddlyButton(place, "Next", "Go to next page (Shortcut: Alt-'>')", onNaviButtonClick, "next");
button.setAttribute("page",(currentPageIndex+1).toString());
button.setAttribute("accessKey",">");
}
}
});
// Class abego.LimitedTextRenderer ===========================================================
//
// Renders a given text, ensuring that a given limit of number of characters
// is not exceeded.
//
// A "markRegExp" may be specified. Substring matching this regular expression
// ("matched strings") are rendered with the class "marked".
//
// if the given text is longer than the limit the matched strings are preferred
// to be included in the rendered text (with some leading and trailing "context text").
//
// Example:
// var renderer = new abego.LimitedTextRenderer();
//
// var place = ... // a DOM element that should contain the rendered (limited) text
// var s = "This is another 'Hello World' example, as saying 'Hello' is always nice. So let's say it again: >Hello!<";
// var maxLen = 50;
// var markRE = /hello/gi;
// renderer.render(place,s,maxLen,markRE);
//
//#import abego.createEllipsis
//
abego.LimitedTextRenderer = function() {
var minMatchWithContextSize = 40;
var maxMovementForWordCorrection = 4; // When a "match" context starts or end on a word the context borders may be changed to at most this amount to include or exclude the word.
//----------------------------------------------------------------------------
//
// Ranges
//
// Objects with a "start" and "end" property (not a specific class).
//
// In a corresponding "Ranges array" these objects are sorted by their start
// and no Range object intersects/touches any other in the array.
//
//----------------------------------------------------------------------------
// Adds the Range [startIndex,endIndex[ to the ranges, ensuring that the Ranges
// in the array are sorted by their start and no Range object
// intersects/touches any other in the array (i.e. possibly the new Range is
// "merged" with existing ranges)
//
// @param ranges array of Range objects
//
var addRange = function(ranges, startIndex, endIndex) {
var n = ranges.length;
// When there are no ranges in ranges, just add it.
if (n == 0) {
ranges.push({start: startIndex, end: endIndex});
return;
}
var i = 0;
for (; i < n; i++) {
var range = ranges[i];
// find the first range that intersects or "touches" [startIndex, endIndex[
if (range.start <= endIndex && startIndex <= range.end) {
// Found.
var r;
// find the first range behind the new range that does not interfere
var rIndex = i+1;
for (; rIndex < n; rIndex++) {
r = ranges[rIndex];
if (r.start > endIndex || startIndex > range.end) {
break;
}
}
// Replace the ranges i to rIndex-1 with the union of the new range with these ranges.
var unionStart = startIndex;
var unionEnd = endIndex;
for (var j = i; j < rIndex; j++) {
r = ranges[j];
unionStart = Math.min(unionStart, r.start);
unionEnd = Math.max(unionEnd, r.end);
}
ranges.splice(i, rIndex-i, {start: unionStart, end: unionEnd});
return;
}
// if we found a range R that is right of the new range there is no
// intersection and we can insert the new range before R.
if (range.start > endIndex) {
break;
}
}
// When we are here the new range does not interfere with any range in ranges and
// i is the index of the first range right to it (or ranges.length, when the new range
// becomes the right most range).
ranges.splice(i, 0, {start: startIndex, end: endIndex});
};
// Returns the total size of all Ranges in ranges
//
var getTotalRangesSize = function(ranges) {
var totalRangeSize = 0;
for (var i=0; i < ranges.length; i++) {
var range = ranges[i];
totalRangeSize += range.end-range.start;
}
return totalRangeSize;
};
//----------------------------------------------------------------------------
var isWordChar = function(c) {
return (c >= "a" && c <= "z") || (c >= "A" && c <= "Z") || c == "_";
};
// Returns the bounds of the word in s around offset as a {start: , end:} object.
//
// Returns null when the char at offset is not a word char.
//
var getWordBounds = function(s, offset) {
// Handle the "offset is not in word" case
if (!isWordChar(s[offset])) return null;
for (var i = offset-1; i >= 0 && isWordChar(s[i]); i--)
{/*empty*/}
var startIndex = i+1;
var n = s.length;
for (i = offset+1; i < n && isWordChar(s[i]); i++)
{/*empty*/}
return {start: startIndex, end: i};
};
var moveToWordBorder = function(s, offset, isStartOffset) {
var wordBounds;
if (isStartOffset) {
wordBounds = getWordBounds(s, offset);
} else {
if (offset <= 0) return offset;
wordBounds = getWordBounds(s, offset-1);
}
if (!wordBounds) return offset;
if (isStartOffset) {
if (wordBounds.start >= offset-maxMovementForWordCorrection) return wordBounds.start;
if (wordBounds.end <= offset+maxMovementForWordCorrection) return wordBounds.end;
} else {
if (wordBounds.end <= offset+maxMovementForWordCorrection) return wordBounds.end;
if (wordBounds.start >= offset-maxMovementForWordCorrection) return wordBounds.start;
}
return offset;
};
// Splits s into a sequence of "matched" and "unmatched" substrings, using the
// matchRegExp to do the matching.
//
// Returns an array of objects with a "text" property containing the substring text.
// Substrings that are "matches" also contain a boolean "isMatch" property set to true.
//
// @param matchRegExp [may be null] when null no matching is performed and the returned
// array just contains one item with s as its text
//
var getTextAndMatchArray = function(s, matchRegExp) {
var result = [];
if (matchRegExp) {
var startIndex = 0;
var n = s.length;
var currentLen = 0;
do {
matchRegExp.lastIndex = startIndex;
var match = matchRegExp.exec(s);
if (match) {
if (startIndex < match.index) {
var t = s.substring(startIndex, match.index);
result.push({text:t});
}
result.push({text:match[0], isMatch:true});
startIndex = match.index + match[0].length;
} else {
result.push({text: s.substr(startIndex)});
break;
}
} while (true);
} else {
result.push({text: s});
}
return result;
};
var getMatchedTextCount = function(textAndMatches) {
var result = 0;
for (var i=0; i < textAndMatches.length; i++) {
if (textAndMatches[i].isMatch) {
result++;
}
}
return result;
};
var getContextRangeAround = function(s, startIndex, endIndex, matchCount, maxLen) {
// Partition the available space into equal sized areas for each match and one
// for the text start.
// But the size should not go below a certain limit
var size = Math.max(Math.floor(maxLen/(matchCount+1)), minMatchWithContextSize);
// Substract the size of the range to get the size of the context.
var contextSize = Math.max(size-(endIndex-startIndex), 0);
// Two thirds of the context should be before the match, one third after.
var contextEnd = Math.min(Math.floor(endIndex+contextSize/3), s.length);
var contextStart = Math.max(contextEnd - size, 0);
// If the contextStart/End is inside a word and the end of the word is
// close move the pointers accordingly to make the text more readable.
contextStart = moveToWordBorder(s, contextStart, true);
contextEnd = moveToWordBorder(s, contextEnd, false);
return {start: contextStart, end: contextEnd};
};
// Get all ranges around matched substrings with their contexts
//
var getMatchedTextWithContextRanges = function(textAndMatches, s, maxLen) {
var ranges = [];
var matchCount = getMatchedTextCount(textAndMatches);
var pos = 0;
for (var i=0; i < textAndMatches.length; i++) {
var t = textAndMatches[i];
var text = t.text;
if (t.isMatch) {
var range = getContextRangeAround(s, pos, pos+text.length, matchCount, maxLen);
addRange(ranges, range.start, range.end);
}
pos += text.length;
}
return ranges;
};
var fillUpRanges = function(s, ranges, maxLen) {
var remainingLen = maxLen - getTotalRangesSize(ranges);
while (remainingLen > 0) {
if (ranges.length == 0) {
// No matches added yet. Make one large range.
addRange(ranges, 0, moveToWordBorder(s, maxLen, false));
return;
} else {
var range = ranges[0];
var startIndex;
var maxEndIndex;
if (range.start == 0) {
// The first range already starts at the beginning of the string.
// When there is a second range fill to the next range start or to the maxLen.
startIndex = range.end;
if (ranges.length > 1) {
maxEndIndex = ranges[1].start;
} else {
// Only one range. Add a range after that with the complete remaining len
// (corrected to "beautify" the output)
addRange(ranges, startIndex, moveToWordBorder(s, startIndex+remainingLen, false));
return;
}
} else {
// There is unused space between the start of the text and the first range.
startIndex = 0;
maxEndIndex = range.start;
}
var endIndex = Math.min(maxEndIndex, startIndex+remainingLen);
addRange(ranges, startIndex, endIndex);
remainingLen -= (endIndex-startIndex);
}
}
};
// Write the given ranges of s, using textAndMatches for marking portions of the text.
//
var writeRanges = function(place, s, textAndMatches, ranges, maxLen) {
if (ranges.length == 0) return;
// Processes the text between startIndex and endIndex of the textAndMatches
// "writes" them (as DOM elements) at the given place, possibly as "marked" text.
//
// When endIndex is not the end of the full text an ellisis is appended.
//
var writeTextAndMatchRange = function(place, s, textAndMatches, startIndex, endIndex) {
var t;
var text;
// find the first text item to write
var pos = 0;
var i = 0;
var offset = 0;
for (;i < textAndMatches.length; i++) {
t = textAndMatches[i];
text = t.text;
if (startIndex < pos+text.length) {
offset = startIndex - pos;
break;
}
pos += text.length;
}
var remainingLen = endIndex - startIndex;
for (; i < textAndMatches.length && remainingLen > 0; i++) {
t = textAndMatches[i];
text = t.text.substr(offset);
offset = 0;
if (text.length > remainingLen) text = text.substr(0,remainingLen);
if (t.isMatch) {
createTiddlyElement(place,"span",null,"marked",text);
} else {
createTiddlyText(place, text);
}
remainingLen -= text.length;
}
if (endIndex < s.length) {
abego.createEllipsis(place);
}
};
// When the first range is not at the start of the text write an ellipsis("...")
// (Ellipses between ranges are written in the writeTextAndMatchRange method)
if (ranges[0].start > 0) abego.createEllipsis(place);
var remainingLen = maxLen;
for (var i = 0; i < ranges.length && remainingLen > 0; i++) {
var range = ranges[i];
var len = Math.min(range.end - range.start, remainingLen);
writeTextAndMatchRange(place, s, textAndMatches, range.start, range.start+len);
remainingLen -= len;
}
};
this.render = function(place,s,maxLen,markRegExp) {
if (s.length < maxLen) maxLen = s.length;
var textAndMatches = getTextAndMatchArray(s, markRegExp);
var ranges = getMatchedTextWithContextRanges(textAndMatches, s, maxLen);
// When the maxLen is not yet reached add more ranges
// starting from the beginning until either maxLen or
// the end of the string is reached.
fillUpRanges(s, ranges, maxLen);
writeRanges(place, s, textAndMatches, ranges, maxLen);
};
};
(function() {
function alertAndThrow(msg) {
alert(msg);
throw msg;
};
if (version.major < 2 || (version.major == 2 && version.minor < 1))
alertAndThrow("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 = {};
//----------------------------------------------------------------------------
// The Search Core
//----------------------------------------------------------------------------
// Model Variables
var lastResults; // Array of tiddlers that matched the last search
var lastQuery; // The last Search query (TiddlerQuery)
var setLastResults = function(array) {
lastResults = array;
};
var getLastResults = function() {
return lastResults ? lastResults : [];
};
var getLastResultsCount = function() {
return lastResults ? lastResults.length : 0;
};
// Standard Ranking Weights
var matchInTitleWeight = 4;
var precisionInTitleWeight = 10;
var matchInTagsWeight = 2;
var getMatchCount = function(s, re) {
var m = s.match(re);
return m ? m.length : 0;
};
var standardRankFunction = function(tiddler, query) {
// Count the matches in the title and the tags
var markRE = query.getMarkRegExp();
if (!markRE) return 1;
var matchesInTitle = tiddler.title.match(markRE);
var nMatchesInTitle = matchesInTitle ? matchesInTitle.length : 0;
var nMatchesInTags = getMatchCount(tiddler.getTags(), markRE);
// Calculate the "precision" of the matches in the title as the ratio of
// the length of the matches to the total length of the title.
var lengthOfMatchesInTitle = matchesInTitle ? matchesInTitle.join("").length : 0;
var precisionInTitle = tiddler.title.length > 0 ? lengthOfMatchesInTitle/tiddler.title.length : 0;
// calculate a weighted score
var rank= nMatchesInTitle * matchInTitleWeight
+ nMatchesInTags * matchInTagsWeight
+ precisionInTitle * precisionInTitleWeight
+ 1;
return rank;
};
// @return Tiddler[]
//
var findMatches = function(store, searchText,caseSensitive,useRegExp,sortField,excludeTag) {
lastQuery = null;
var candidates = store.reverseLookup("tags",excludeTag,false);
try {
var defaultFields = [];
if (config.options.chkSearchInTitle) defaultFields.push("title");
if (config.options.chkSearchInText) defaultFields.push("text");
if (config.options.chkSearchInTags) defaultFields.push("tags");
lastQuery = new abego.TiddlerQuery(
searchText,caseSensitive, useRegExp,defaultFields,config.options.chkSearchExtendedFields);
} catch (e) {
// when an invalid query is given no tiddlers are matched
return [];
}
var results = lastQuery.filter(candidates);
// Rank the results
var rankFunction = abego.YourSearch.getRankFunction();
for (var i = 0; i < results.length; i++) {
var tiddler = results[i];
var rank = rankFunction(tiddler, lastQuery);
// Add the rank information to the tiddler.
// This is used during the sorting, but it may also
// be used in the result, e.g. to display some "relevance"
// information in the result
tiddler.searchRank = rank;
}
// sort the result, taking care of the rank and the sortField
if(!sortField) {
sortField = "title";
}
var sortFunction = function (a,b) {
var searchRankDiff = a.searchRank - b.searchRank;
if (searchRankDiff == 0) {
if (a[sortField] == b[sortField]) {
return(0);
} else {
return (a[sortField] < b[sortField]) ? -1 : +1;
}
} else {
return (searchRankDiff > 0) ? -1 : +1;
}
};
results.sort(sortFunction);
return results;
};
//----------------------------------------------------------------------------
// The Search UI (Result page)
//----------------------------------------------------------------------------
// Visual appearance of the result page
var maxCharsInTitle = 80;
var maxCharsInTags = 50;
var maxCharsInText = 250;
var maxCharsInField = 50;
var itemsPerPageDefault = 25; // Default maximum number of items on one search result page
var itemsPerPageWithPreviewDefault = 10; // Default maximum number of items on one search result page when PreviewText is on
// DOM IDs
var yourSearchResultID = "yourSearchResult";
var yourSearchResultItemsID = "yourSearchResultItems";
var lastSearchText; // The last search text, as passed to findMatches
var resultElement; // The (popup) DOM element containing the search result [may be null]
var searchInputField; // The "search" input field
var searchButton; // The "search" button
var lastNewTiddlerButton;
var initStylesheet = function() {
if (version.extensions.YourSearchPlugin.styleSheetInited)
return;
version.extensions.YourSearchPlugin.styleSheetInited = true;
setStylesheet(store.getTiddlerText("YourSearchStyleSheet"),"yourSearch");
}
var isResultOpen = function() {
return resultElement != null && resultElement.parentNode == document.body;
};
var closeResult = function() {
if (isResultOpen()) {
document.body.removeChild(resultElement);
}
};
// Closes the Search Result window and displays the tiddler
// defined by the "tiddlyLink" attribute of this element
//
var closeResultAndDisplayTiddler = function(e)
{
closeResult();
var title = this.getAttribute("tiddlyLink");
if(title) {
var withHilite = this.getAttribute("withHilite");
var oldHighlightHack = highlightHack;
if (withHilite && withHilite=="true" && lastQuery) {
highlightHack = lastQuery.getMarkRegExp();
}
story.displayTiddler(this,title);
highlightHack = oldHighlightHack;
}
return(false);
};
// Adjusts the resultElement's size and position, relative to the search input field.
//
var adjustResultPositionAndSize = function() {
if (!searchInputField) return;
var root = searchInputField;
// Position the result below the root and resize it if necessary.
var rootLeft = findPosX(root);
var rootTop = findPosY(root);
var rootHeight = root.offsetHeight;
var popupLeft = rootLeft;
var popupTop = rootTop + rootHeight;
// Make sure the result is not wider than the window
var winWidth = findWindowWidth();
if (winWidth < resultElement.offsetWidth) {
resultElement.style.width = (winWidth - 100)+"px";
winWidth = findWindowWidth();
}
// Ensure that the left and right of the result are not
// clipped by the window. Move it to the left or right, if necessary.
var popupWidth = resultElement.offsetWidth;
if(popupLeft + popupWidth > winWidth)
popupLeft = winWidth - popupWidth-30;
if (popupLeft < 0) popupLeft = 0;
// Do the actual moving
resultElement.style.left = popupLeft + "px";
resultElement.style.top = popupTop + "px";
resultElement.style.display = "block";
};
var scrollVisible = function() {
// Scroll the window to make the result page (and the search Input field) visible.
if (resultElement) window.scrollTo(0,ensureVisible(resultElement));
if (searchInputField) window.scrollTo(0,ensureVisible(searchInputField));
};
// Makes sure the result page has a good size and position and visible
// (may scroll the window)
//
var ensureResultIsDisplayedNicely = function() {
adjustResultPositionAndSize();
scrollVisible();
};
var indexInPage; // The index (in the current page) of the tiddler currently rendered.
var currentTiddler; // While rendering the page the tiddler that is currently rendered.
var pager = new abego.PageWiseRenderer();
var MyItemRenderer = function(parent) {
// Load the template how to display the items that represent a found tiddler
this.itemHtml = store.getTiddlerText("YourSearchItemTemplate");
if (!this.itemHtml) alertAndThrow("YourSearchItemTemplate not found");
// Locate the node that shall contain the list of found tiddlers
this.place = document.getElementById(yourSearchResultItemsID);
if(!this.place)
this.place = createTiddlyElement(parent,"div",yourSearchResultItemsID);
};
merge(MyItemRenderer.prototype,{
render: function(pager,object,index,indexOnPage) {
// Define global variables, referenced by macros during applyHtmlMacros
indexInPage = indexOnPage;
currentTiddler = object;
var item = createTiddlyElement(this.place,"div",null, "yourSearchItem");
item.innerHTML = this.itemHtml;
applyHtmlMacros(item,null);
refreshElements(item,null);
},
endRendering: function(pager) {
// The currentTiddler must only be defined while rendering the found tiddlers
currentTiddler = null;
}
});
// Refreshes the content of the result with the current search result
// of the selected page.
//
// Assumes that the result is already open.
//
var refreshResult = function() {
if (!resultElement || !searchInputField) return;
// Load the template for the YourSearchResult
var html = store.getTiddlerText("YourSearchResultTemplate");
if (!html) html = "<b>Tiddler YourSearchResultTemplate not found</b>";
resultElement.innerHTML = html;
// Expand the template macros etc.
applyHtmlMacros(resultElement,null);
refreshElements(resultElement,null);
var itemRenderer = new MyItemRenderer(resultElement);
pager.renderPage(itemRenderer);
ensureResultIsDisplayedNicely();
};
pager.getItemsPerPage = function() {
var n = (config.options.chkPreviewText)
? abego.toInt(config.options.txtItemsPerPageWithPreview, itemsPerPageWithPreviewDefault)
: abego.toInt(config.options.txtItemsPerPage, itemsPerPageDefault);
return (n > 0) ? n : 1;
};
pager.onPageChanged = function() {
refreshResult();
};
var showResult = function() {
if (!resultElement) {
resultElement = createTiddlyElement(document.body,"div",yourSearchResultID,"yourSearchResult");
} else if (resultElement.parentNode != document.body) {
document.body.appendChild(resultElement);
}
refreshResult();
};
var reopenResultIfApplicable = function() {
if (searchInputField == null || !config.options.chkUseYourSearch) return;
if ((searchInputField.value == lastSearchText) && lastSearchText && !isResultOpen()) {
// For speedup we check re-use the previously created resultElement, if possible.
if (resultElement && (resultElement.parentNode != document.body)) {
document.body.appendChild(resultElement);
ensureResultIsDisplayedNicely();
} else {
showResult();
}
}
};
var invalidateResult = function() {
closeResult();
resultElement = null;
lastSearchText = null;
};
//-------------------------------------------------------------------------
// Close the search result page when the user clicks on the document
// (and not into the searchInputField, on the search button or in the result)
// or presses the ESC key
// Returns true if e is either self or a descendant (child, grandchild,...) of self.
//
// @param self DOM:Element
// @param e DOM:Element or null
//
var isDescendantOrSelf = function(self, e) {
while (e != null) {
if (self == e) return true;
e = e.parentNode;
}
return false;
};
var onDocumentClick = function(e) {
if (e.target == searchInputField) return;
if (e.target == searchButton) return;
if (resultElement && isDescendantOrSelf(resultElement, e.target)) return;
closeResult();
};
var onDocumentKeyup = function(e) {
// Close the search result page when the user presses "ESC"
if (e.keyCode == 27) closeResult();
};
addEvent(document,"click",onDocumentClick);
addEvent(document,"keyup",onDocumentKeyup);
// Our Search Macro Hijack Function ==========================================
// Helper
var myStorySearch = function(text,useCaseSensitive,useRegExp)
{
lastSearchText = text;
setLastResults(findMatches(store, text,useCaseSensitive,useRegExp,"title","excludeSearch"));
highlightHack = lastQuery ? lastQuery.getMarkRegExp() : null;
pager.setItems(getLastResults());
showResult();
highlightHack = null;
};
var myMacroSearchHandler = function(place,macroName,params,wikifier,paramString,tiddler)
{
initStylesheet();
lastSearchText = "";
var searchTimeout = null;
var doSearch = function(txt)
{
if (config.options.chkUseYourSearch)
myStorySearch(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);
else
story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);
lastSearchText = txt.value;
};
var clickHandler = function(e)
{
doSearch(searchInputField);
return false;
};
var keyHandler = function(e)
{
if (!e) var e = window.event;
searchInputField = this;
switch(e.keyCode)
{
case 13:
if (e.ctrlKey && lastNewTiddlerButton && isResultOpen())
lastNewTiddlerButton.onclick.apply(lastNewTiddlerButton,[e]);
else
doSearch(this);
break;
case 27:
// When the result is open, close it,
// otherwise clear the content of the input field
if (isResultOpen()) {
closeResult();
} else {
this.value = "";
clearMessage();
}
break;
}
if (String.fromCharCode(e.keyCode) == this.accessKey || e.altKey)
{
reopenResultIfApplicable();
}
if(this.value.length<3 && searchTimeout) clearTimeout(searchTimeout);
if(this.value.length > 2)
{
if (this.value != lastSearchText)
{
if (!config.options.chkUseYourSearch || config.options.chkSearchAsYouType)
{
if(searchTimeout)
clearTimeout(searchTimeout);
var txt = this;
searchTimeout = setTimeout(function() {doSearch(txt);},500);
}
}
else
{
if(searchTimeout)
clearTimeout(searchTimeout);
}
};
if (this.value.length == 0)
{
closeResult();
}
};
var focusHandler = function(e)
{
this.select();
clearMessage();
reopenResultIfApplicable();
};
var args = paramString.parseParams("list",null,true);
var buttonAtRight = getFlag(args, "buttonAtRight");
var sizeTextbox = getParam(args, "sizeTextbox", this.sizeTextbox);
var btn;
if (!buttonAtRight)
btn = createTiddlyButton(place,this.label,this.prompt,clickHandler);
var txt = createTiddlyElement(place,"input",null,null,null);
if(params[0])
txt.value = params[0];
txt.onkeyup = keyHandler;
txt.onfocus = focusHandler;
txt.setAttribute("size",sizeTextbox);
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 (buttonAtRight)
btn = createTiddlyButton(place,this.label,this.prompt,clickHandler);
searchInputField = txt;
searchButton = btn;
};
//----------------------------------------------------------------------------
// Support for Macros
//----------------------------------------------------------------------------
var openAllFoundTiddlers = function() {
closeResult();
var results = getLastResults();
var n = results.length;
if (n) {
var titles=[];
for(var i = 0; i<n; i++)
titles.push(results[i].title);
story.displayTiddlers(null,titles);
}
};
var createOptionWithRefresh = function(place, optionParams, wikifier,tiddler) {
invokeMacro(place,"option",optionParams,wikifier,tiddler);
// The option macro appended the component at the end of the place.
var elem = place.lastChild;
var oldOnClick = elem.onclick;
elem.onclick = function(e) {
var result = oldOnClick.apply(this, arguments);
refreshResult();
return result;
};
return elem;
};
var removeTextDecoration = function(s) {
var removeThis = ["''", "{{{", "}}}", "//", "<<<", "/***", "***/"];
var reText = "";
for (var i = 0; i < removeThis.length; i++) {
if (i != 0) reText += "|";
reText += "("+removeThis[i].escapeRegExp()+")";
}
return s.replace(new RegExp(reText, "mg"), "").trim();
};
// Returns the "shortcut number" of the currentTiddler.
// I.e. When the user presses Alt-n the given tiddler is opened/display.
//
// @return 0-9 or -1 when no number is defined
//
var getShortCutNumber = function() {
var i = indexInPage;
return (i >= 0 && i <= 9)
? (i < 9 ? (i+1) : 0)
: -1;
};
var limitedTextRenderer = new abego.LimitedTextRenderer();
var renderLimitedText = function(place, s, maxLen) {
limitedTextRenderer.render(place,s,maxLen,lastQuery.getMarkRegExp())
}
// When any tiddler are changed reset the result.
//
var oldTiddlyWikiSaveTiddler = TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler = function(title,newTitle,newBody,modifier,modified,tags,fields) {
oldTiddlyWikiSaveTiddler.apply(this, arguments);
invalidateResult();
};
var oldTiddlyWikiRemoveTiddler = TiddlyWiki.prototype.removeTiddler;
TiddlyWiki.prototype.removeTiddler = function(title) {
oldTiddlyWikiRemoveTiddler.apply(this, arguments);
invalidateResult();
};
//----------------------------------------------------------------------------
// Macros
//----------------------------------------------------------------------------
// ====Macro yourSearch ================================================
config.macros.yourSearch = {
// Standard Properties
label: "yourSearch",
prompt: "Gives access to the current/last YourSearch result",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
if (params.length == 0) return;
var name = params[0];
var func = config.macros.yourSearch.funcs[name];
if (func) func(place,macroName,params,wikifier,paramString,tiddler);
},
tests: {
"true" : function() {return true;},
"false" : function() {return false;},
"found" : function() {return getLastResultsCount() > 0;},
"previewText" : function() {return config.options.chkPreviewText;}
},
funcs: {
itemRange: function(place) {
if (getLastResultsCount()) {
var lastIndex = pager.getLastIndexOnPage();
var s = "%0 - %1".format([pager.getFirstIndexOnPage()+1,lastIndex+1]);
createTiddlyText(place, s);
}
},
count: function(place) {
createTiddlyText(place, getLastResultsCount().toString());
},
query: function(place) {
if (lastQuery) {
createTiddlyText(place, lastQuery.toString());
}
},
version: function(place) {
var t = "YourSearch %0.%1.%2".format(
[version.extensions.YourSearchPlugin.major,
version.extensions.YourSearchPlugin.minor,
version.extensions.YourSearchPlugin.revision]);
var e = createTiddlyElement(place, "a");
e.setAttribute("href", "http://tiddlywiki.abego-software.de/#YourSearchPlugin");
e.innerHTML = '<font color="black" face="Arial, Helvetica, sans-serif">'+t+'<font>';
},
copyright: function(place) {
var e = createTiddlyElement(place, "a");
e.setAttribute("href", "http://www.abego-software.de");
e.innerHTML = '<font color="black" face="Arial, Helvetica, sans-serif">© 2005-2006 <b><font color="red">abego</font></b> Software<font>';
},
newTiddlerButton: function(place) {
if (lastQuery) {
var r = abego.parseNewTiddlerCommandLine(lastQuery.getQueryText());
var btn = config.macros.newTiddler.createNewTiddlerButton(place,r.title,r.params,"new tiddler","Create a new tiddler based on search text. (Shortcut: Ctrl-Enter; Separators: '.', '#')",null,"text");
// Close the result before the new tiddler is created.
var oldOnClick = btn.onclick;
btn.onclick = function() {
closeResult();
oldOnClick.apply(this,arguments);
}
lastNewTiddlerButton = btn;
}
},
linkButton: function(place,macroName,params,wikifier,paramString,tiddler) {
if (params < 2) return;
var tiddlyLink = params[1];
var text = params < 3 ? tiddlyLink : params[2];
var tooltip = params < 4 ? text : params[3];
var accessKey = params < 5 ? null : params[4];
var btn = createTiddlyButton(place,text,tooltip,closeResultAndDisplayTiddler,null,null, accessKey);
btn.setAttribute("tiddlyLink",tiddlyLink);
},
closeButton: function(place,macroName,params,wikifier,paramString,tiddler) {
var button = createTiddlyButton(place, "close", "Close the Search Results (Shortcut: ESC)", closeResult);
},
openAllButton: function(place,macroName,params,wikifier,paramString,tiddler) {
var n = getLastResultsCount();
if (n == 0) return;
var title = n == 1 ? "open tiddler" : "open all %0 tiddlers".format([n]);
var button = createTiddlyButton(place, title, "Open all found tiddlers (Shortcut: Alt-O)", openAllFoundTiddlers);
button.setAttribute("accessKey","O");
},
naviBar: function(place,macroName,params,wikifier,paramString,tiddler) {
pager.addPageNavigation(place);
},
"if": function(place,macroName,params,wikifier,paramString,tiddler) {
if (params.length < 2) return;
var testName = params[1];
var negate = (testName == "not");
if (negate) {
if (params.length < 3) return;
testName = params[2];
}
var test = config.macros.yourSearch.tests[testName];
var showIt = false;
try {
if (test) {
showIt = test(place,macroName,params,wikifier,paramString,tiddler) != negate;
} else {
// When no predefined test is specified try to evaluate it as a JavaScript expression.
showIt = (!eval(testName)) == negate;
}
} catch (ex) {
}
if (!showIt) {
place.style.display="none";
}
},
chkPreviewText: function(place,macroName,params,wikifier,paramString,tiddler) {
var optionParams = params.slice(1).join(" ");
var elem = createOptionWithRefresh(place, "chkPreviewText", wikifier,tiddler);
elem.setAttribute("accessKey", "P");
elem.title = "Show text preview of found tiddlers (Shortcut: Alt-P)";
return elem;
}
}
};
// ====Macro foundTiddler ================================================
config.macros.foundTiddler = {
// Standard Properties
label: "foundTiddler",
prompt: "Provides information on the tiddler currently processed on the YourSearch result page",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var name = params[0];
var func = config.macros.foundTiddler.funcs[name];
if (func) func(place,macroName,params,wikifier,paramString,tiddler);
},
funcs: {
title: function(place,macroName,params,wikifier,paramString,tiddler) {
if (!currentTiddler) return;
var shortcutNumber = getShortCutNumber();
var tooltip = shortcutNumber >= 0
? "Open tiddler (Shortcut: Alt-%0)".format([shortcutNumber.toString()])
: "Open tiddler";
var btn = createTiddlyButton(place,null,tooltip,closeResultAndDisplayTiddler,null);
btn.setAttribute("tiddlyLink",currentTiddler.title);
btn.setAttribute("withHilite","true");
renderLimitedText(btn, currentTiddler.title, maxCharsInTitle);
if (shortcutNumber >= 0) {
btn.setAttribute("accessKey",shortcutNumber.toString());
}
},
tags: function(place,macroName,params,wikifier,paramString,tiddler) {
if (!currentTiddler) return;
renderLimitedText(place, currentTiddler.getTags(), maxCharsInTags);
},
text: function(place,macroName,params,wikifier,paramString,tiddler) {
if (!currentTiddler) return;
renderLimitedText(place, removeTextDecoration(currentTiddler.text), maxCharsInText);
},
field: function(place,macroName,params,wikifier,paramString,tiddler) {
if (!currentTiddler) return;
var name = params[1];
var len = params.length > 2 ? abego.toInt(params[2],maxCharsInField) : maxCharsInField;
var v = store.getValue(currentTiddler,name);
if (v)
renderLimitedText(place, removeTextDecoration(v), len);
},
// Renders the "shortcut number" of the current tiddler, to indicate to the user
// what number to "Alt-press" to open the tiddler.
//
number: function(place,macroName,params,wikifier,paramString,tiddler) {
var numberToDisplay = getShortCutNumber();
if (numberToDisplay >= 0) {
var text = "%0)".format([numberToDisplay.toString()]);
createTiddlyElement(place,"span",null,"shortcutNumber",text);
}
}
}
};
//----------------------------------------------------------------------------
// Configuration Stuff
//----------------------------------------------------------------------------
var opts = {chkUseYourSearch:true,
chkPreviewText:true,
chkSearchAsYouType:true,
chkSearchInTitle:true,
chkSearchInText:true,
chkSearchInTags:true,
chkSearchExtendedFields:true,
txtItemsPerPage:itemsPerPageDefault,
txtItemsPerPageWithPreview:itemsPerPageWithPreviewDefault};
for (var n in opts)
if (config.options[n] == undefined) config.options[n] = opts[n];
//----------------------------------------------------------------------------
// Shadow Tiddlers
//----------------------------------------------------------------------------
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.";
//----------------------------------------------------------------------------
// Install YourSearch
//----------------------------------------------------------------------------
// Overwrite the TiddlyWiki search handler and verify after a while
// that nobody else has overwritten it.
config.macros.search.handler = myMacroSearchHandler;
var checkForOtherHijacker = function() {
// Check that still our search handler is installed
if (config.macros.search.handler != myMacroSearchHandler) {
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(checkForOtherHijacker, 5000);
// === Public API =================================
abego.YourSearch.getStandardRankFunction = function() {
return standardRankFunction;
};
abego.YourSearch.getRankFunction = function() {
return abego.YourSearch.getStandardRankFunction();
};
abego.YourSearch.getCurrentTiddler = function() {
return currentTiddler;
};
abego.YourSearch.closeResult = function() {
closeResult();
}
})();
} // of "install only once"
// Used Globals (for JSLint) ==============
// ... JavaScript Core
/*global alert,clearTimeout,confirm */
// ... TiddlyWiki Core
/*global Tiddler, applyHtmlMacros, clearMessage, createTiddlyElement, createTiddlyButton, createTiddlyText, ensureVisible ,findPosX, highlightHack, findPosY,findWindowWidth, invokeMacro, saveChanges, refreshElements, story */
//}}}
/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005-2006 ([[www.abego-software.de|http://www.abego-software.de]])
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/
/***
Macro: allTagsExcept
Author: Clint Checketts
Version: 1.0 Sept 8, 2005
usage: {{{<< allTagsExcept systemConfig systemTiddlers >>}}} This will show all tags but those listed (e.g. systemConfig and systemTiddlers
<<allTagsExcept systemConfig systemTiddlers framedLinks admin ProxyService systemServer TiddlyHomeSystem >>
***/
//{{{
version.extensions.allTagsExcept = {major: 0, minor: 1, revision: 0, date: new Date(2005,8,15)};
config.macros.allTagsExcept = {tooltip: "Show tiddlers tagged with '%0'",noTags: "There are no tags to display"};
config.macros.allTagsExcept.handler = function(place,macroName,params)
{
var tags = store.getTags();
var theTagList = createTiddlyElement(place,"ul",null,null,null);
if(tags.length == 0)
createTiddlyElement(theTagList,"li",null,"listTitle",this.noTags);
for (var t=0; t<tags.length; t++) {
var includeTag = true;
for (var p=0;p<params.length; p++) if (tags[t][0] == params[p]) includeTag = false;
if (includeTag){
var theListItem =createTiddlyElement(theTagList,"li",null,null,null);
var theTag = createTiddlyButton(theListItem,tags[t][0] + " (" + tags[t][1] + ")",this.tooltip.format([tags[t][0]]),onClickTag);
theTag.setAttribute("tag",tags[t][0]);
}
}
}
//}}}
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\book.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[book.gif|book.gif]] - {{{type=image/gif, size=572 bytes, encoded=775 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/book.gif|./images/book.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/book.gif|http://www.symbex.net.au/Wiki/images/book.gif]]|
image
<<<
usage: {{{[img[tooltip|book.gif]] or [img[tooltip|book.gif][link]]}}}
[img[tooltip|book.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEAAOAOZcAGpqc32HqGBlif7+/qXf+pzO5o2a6Jil8urw+mZzx4aT4v78
/uHp+pys9Jun9G16zZC5zZmm84+d65Gd7Gt5zYqa5Wl2ypaj8Ovt7HKA03uI2aOv
rtHP0Kapq2BrtFZlwWRxx4KRqWNnflddgpSg7oOQ3298z1ppw19twYeU5Jej8ff3
+aKswo6a6XqH2V1qwEBOQ1RhuHF+0FhnvZyo9Pj3+md1yVFbmn+M3Fpnvn6K266x
r3yj0IWVzZejrMzOzWBuxJuv74GO34SR4T9TRmFwyoqW5bCzsml0t5CSoEdepWpq
dHZ7mnaD1mNwxXiI63iF15Of7VNhuE5dtHWC03d4gGBwzlpee52p9mVkZ0hWr3B5
lv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAFwALAAAAAAQAA4AAAeZgFyCg1wBW1mEiYKGERMK
AoqLWlhYFwZCVJCEPj2UWA5RKRomTppcAFcEDZQqLSVNFi9SV4IAT1sEQTQkRjoy
IDNTSiOnVlpbBQcSQ1AUKDEeRVqIV8bIFTgZCTlIH0RbLILVxxAuD0AnWiJJCAyD
41s8NjdbHAMrG4jvxkshPwMYjmSpoqgakwU1OgyMJAhGlR0LGQ6KmCgQADs=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\disk.gif}}}|
| attached on:|6 June 2009 by YourName|
| embedded:|[[disk.gif|disk.gif]] - {{{type=image/gif, size=1225 bytes, encoded=1661 bytes}}}|
| local file:|//none//|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/disk.gif|http://www.symbex.net.au/Wiki/images/disk.gif]]|
image
<<<
usage: {{{[img[tooltip|disk.gif]] or [img[tooltip|disk.gif][link]]}}}
[img[tooltip|disk.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhFAAUAPcAAAAhvQAhxgAhzgAp1gAp5wAp7wAx5wgYYwgYewgYzgghnAgh
zggh1ggh3ggptQgpzggp1ggp3ggp5wgp7wgp9wgx3ggx5wg5xhAYWhAYrRAYvRAY
3hAhnBAhrRAh1hAh3hAh5xAppRAprRAxjBAxtRAxxhAxzhAx1hA5xhA5zhA59xBC
1hghaxgphBgpnBgptRgxhBgxjBgxlBgxzhgx1hg57xhC3hhC7yEpcyEpjCExWiEx
eyExjCE5Yykxeyk5jClCrSlKvSlKxilS1ila1iljpSlztTE5YzFCxjFKnDFKxjFS
nDFalDFazjGczjlClDlSjDlSxjlS3jla1jljxjlzxjmE1jmUvTmUxjmUzjmcxkJS
UkJSnEJStUJSzkJS1kJahEJatUJavUJjhEJjtUKUxkKUzkKU50pSvUpac0pz50qE
50qM70rO70rO91JjlFJ751KEzlKE3lKE51KE71KMzlKM3lKM51LO71LO91pje1pj
hFpjjFpjlFpre1prhFprjFp7vVp71lqE51qE71qM1lqM51q991rG91rO71rO92Nr
a2NrjGNzlGN7vWOEnGOEpWOExmOEzmOE52OMzmOM72trc2trnGt7jGt7pWt7zmuE
pWuU53NzjHOExnOMxnOc1nOc53uEpXuM1nuM3nuc1nuc3nul3oSEjISMnISc3oSl
3oS974yEjIyUpYyUtYyc54yltYy974y995SUlJSUnJSUpZScnJScpZSlrZS955S9
75S995yUnJyUpZycnJylzpy1vZy1xpy195y956WlxqW1xqW93q2tra2txq3G57Wl
tbW11rXG57XW9729vb3Ozr3O573e973n98bG3sbO78bW78be58bn98bv98bv/87O
xs7e587e987n987n/87v787v987v/87399bW1tbW59bn59bn79bn99bv79bv/9b3
99b3/97n597n797n997n/97v3t7v797v99739973/+fe7+f39+f3/+f/9+/v7+/3
9/f39////////////ywAAAAAFAAUAAAI/gBlyYHDydm1a9GOCfPk6NEjUJMmAdPH
bxCAB0Gu3YsHLVgmF0DA9Ahjo8SPZPsGLXigpFu7bchqvdHwZdMYMTcqhGhETiUE
JNWoxUSVpsOXXJjC5CTBp5fKBUqaFevVytKRDl6M4VJqIUQfWoMemAhy7FWqRVt0
oCFVjVmXGxJE8Kk16IIaU5984GCBgcWPJFyeKLkx4QWjWnMqEIjwwIMHEB88RGCw
wAOECBVk7KE1Z4CFFDNm0KAxA4VpFDNSrCDCQ0+vOw+GyNK1a9cwYsR25eY1q1Ac
GHroLpiSbd06dfOMq6M3b546WJpy7Ok1Z4GXaefOoXt3ztw7d+7Qr3krFYnHdDYB
okhr166cPXPk3JVrZ44b+RGb1ziggk0evXT/rUPPPfokt4okmvUiBwdkSGMOONyc
A8413nQHDjbkmVeLIAgsMU024GQTzogkZjPNKZHssEctlDBhxCGJ4NEGInnggUiM
iRxyxm/TjQJFEVaUcUUWZWBxRRlFYlFGFY740Akt5bjCCCB/+PFHlVZeeWUjonRi
yy/86IMMLbXQcgstvZxZpppk/vJMQAAAOw==
---END_DATA---
%/
/***
|''Name''|eMailMacro|
|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#eMailMacro]]|
|''Version''|0.97|
|''Status''|stable|
|''Author''|Rick Magers, FND|
|''Contributors''|HeX|
|''License''|public domain|
|''~CoreVersion''|2.1|
|''Type''|macro|
|''Requires''|N/A|
|''Overrides''|N/A|
|''Description''|create an e-mail from tiddler contents|
!Usage
{{{
<<email
[tiddler:"name"]
[to:"address"]
[cc:"address"]
[bcc:"address"]
[subject:"text"]
[maxChars:"number"]
[filterMacro:"true"]
[label:"text"]
[tooltip:"text"]
[permalink:"true"]
[class:"customClass"]
>>
}}}
All parameters are optional.
Multiple recipients can be added by separating the addresses with a comma.
!!Example
<<email subject:"Hello World" to:"foo@bar.baz,bar@foo.baz" label:"mail to Foo" tooltip:"send this tiddler to Foo" permalink:"true">>
!!Adding the macro to the toolbar
After importing this plugin tiddler, the [[ViewTemplate]] needs to be modified by adding {{{<span macro='email'></span>}}} to the toolbar:
{{{
<div class='toolbar'>
<span macro='toolbar newHere +editTiddler deleteTiddler permalink references jump closeOthers -closeTiddler'>
<span macro='email'></span>
</div>
}}}
(The respective version of the ViewTemplate might differ from the one displayed here.)
!Limitations
* limited number of characters for the message body (due to [[inherent limitations|http://www.boutell.com/newfaq/misc/urllength.html]] of {{{mailto:}}} links)
* the user's combination of browser and e-mail client needs to support the respective features of the mailto protocol
!Revision History
!!v0.1 (2007-06-16)
* initial release [[by Rick Magers|http://groups.google.com/group/TiddlyWiki/browse_thread/thread/ff7ae93cbe94345e/f6699532351f0802?#f6699532351f0802]]
!!v0.8 (2007-07-05)
* various modifications to enhance support for special characters ([[by FND and HeX|http://groups.google.com/group/TiddlyWikiDev/browse_thread/thread/ed196a32b295d2c9]])
!!v0.9 (2007-10-08)
* code refactoring
* added parameters for various fields
!!v0.91 (2007-10-10)
* fixed malformed mailto string (additional ampersand in some cases)
!!v0.95 (2007-12-27)
* added parameter for removing {{{<<email>>}}} macro calls from output (thanks [[ELS|http://www.tiddlytools.com]])
* using custom {{{escapeHTML()}}} function instead of {{{htmlDecode()}}}
!!v0.96 (2007-12-28)
* added parameter for specifying a target tiddler
* added parameter for limiting the number of characters returned from the tiddler body (default: 2000)
* some code refactoring
!!v0.97 (2009-03-19)
* added permalink parameter
!To Do
* documentation
* further enhance handling of special characters
!Code
***/
//{{{
(function() {
config.macros.email = {
subject: "default title",
body: "default contents",
label: "e-mail",
tooltip: "e-mail this tiddler",
btnClass: "button",
maxChars: 2000
};
config.macros.email.handler = function(place, macroName, params, wikifier, paramString, tiddler) {
// process parameters
var prms = paramString.parseParams(null, null, true);
var label = getParam(prms, "label") || this.label;
var tooltip = getParam(prms, "tooltip") || this.tooltip;
var btnClass = getParam(prms, "class") || this.btnClass;
var msgTo = getParam(prms, "to");
var msgCC = getParam(prms, "cc");
var msgBCC = getParam(prms, "bcc");
var msgSubject = getParam(prms, "subject");
var title = getParam(prms, "tiddler") || tiddler.title;
var filterMacro = getParam(prms, "filterMacro") == "true";
var permalink = getParam(prms, "permalink") == "true";
var maxChars = getParam(prms, "maxChars") || this.maxChars;
// retrieve tiddler contents
if(!msgSubject) {
if(store.getTiddler(title) || store.isShadowTiddler(title)) {
msgSubject = strEscape(title);
} else {
msgSubject = this.subject;
}
}
var msgBody = store.getTiddlerText(title, this.body);
if(permalink) {
config.commands.permalink.handler(null, null, tiddler.title); // XXX: hacky
msgBody = window.location.toString() + "\n\n" + msgBody;
}
if(filterMacro) {
msgBody = msgBody.replace(/<<email(.*|\n)?\>\>/gi, "");
}
msgBody = strEscape(msgBody);
// compose message
var msg = "";
if(msgTo) {
msg += msgTo;
}
msg += "?";
msg += "subject=" + msgSubject;
if(msgCC) {
msg += "&cc=" + msgCC;
}
if(msgBCC) {
msg += "&bcc=" + msgBCC;
}
msg += "&body=" + msgBody;
if(msg.length > maxChars) {
msg = msg.substr(0, maxChars);
}
// create link
wikify("[[" + label + "|" + "mailto:" + msg + "]]", place);
place.lastChild.className = btnClass;
place.lastChild.title = tooltip;
};
var strEscape = function(str) {
return entitify(escape(escapeHTML(str)));
};
/* inspired by the Prototype library (http://prototype.conio.net) */
var escapeHTML = function(str) {
var div = document.createElement("div");
var text = document.createTextNode(str);
div.appendChild(text);
return div.innerHTML;
};
// handle special characters
var entitify = function(str) {
return str
.replace(/%A2/g, "¢")
.replace(/%A3/g, "£")
.replace(/%A5/g, "¥")
.replace(/%AB/g, "«")
.replace(/%BB/g, "»")
.replace(/%B5/g, "µ")
.replace(/%C4/g, "Ä")
.replace(/%C5/g, "Å")
.replace(/%C6/g, "Æ")
.replace(/%D6/g, "Ö")
.replace(/%D8/g, "Ø")
.replace(/%DC/g, "Ü")
.replace(/%DF/g, "ß")
.replace(/%E4/g, "ä")
.replace(/%E5/g, "å")
.replace(/%E6/g, "æ")
.replace(/%F0/g, "ð")
.replace(/%F6/g, "ö")
.replace(/%F8/g, "ø")
.replace(/%FC/g, "ü")
.replace(/%u20AC/g, "€");
};
})();
//}}}
config.tasks.viewTabs = {
text: "editA",
tooltip: "Edit a specific tiddler",
content: "|width:18em;<<tiddler EditATiddler>>|"
};
config.backstageTasks.splice(config.backstageTasks.indexOf("save")+0,0,"viewTabs");
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\file.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[file.gif|file.gif]] - {{{type=image/gif, size=145 bytes, encoded=199 bytes}}}|
| local file:|/%LOCAL_LINK%/[[file:///F:/TiddlyWiki/TW jQuery/TreeView/images/file.gif|file:///F:/TiddlyWiki/TW jQuery/TreeView/images/file.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/file.gif|http://www.symbex.net.au/Wiki/images/file.gif]]|
image
<<<
usage: {{{[img[tooltip|file.gif]] or [img[tooltip|file.gif][link]]}}}
[img[tooltip|file.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhDwAOALMAAGpsYoy3oamMQdS9fDmJdP////9tcH98XwAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAAUALAAAAAAPAA4AAAQ+sBRBK5VYiizH5l82eCBX
jCS2GayRhZOpvkVgHwWg0XKM4azCAaATZnA9pAQ3sAUIhOWxZ/xRlcKDdsuVRAAA
Ow==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\folder-closed.gif}}}|
| attached on:|4 June 2009 by YourName|
| embedded:|[[folder-closed.gif|folder-closed.gif]] - {{{type=image/gif, size=887 bytes, encoded=1202 bytes}}}|
| local file:|/%LOCAL_LINK%/[[file:///F:/TiddlyWiki/TW jQuery/TreeView/images/folder-closed.gif|file:///F:/TiddlyWiki/TW jQuery/TreeView/images/folder-closed.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/folder-closed.gif|http://www.symbex.net.au/Wiki/images/folder-closed.gif]]|
image
<<<
usage: {{{[img[tooltip|folder-closed.gif]] or [img[tooltip|folder-closed.gif][link]]}}}
[img[tooltip|folder-closed.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEAAOAPcAAJdaH+C6eP/inq1zLf/////Sg59oJMOHNAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAAQALAAAAAAQAA4AAAhUAAkIHEiwoMGDBw8oPIBw
4ACCDxEeEECxQIAACxUSZNiQo8CJFEOKBABRpEkBEQUOOCkyJQEDBWLKnGmAIICZ
OAuQHAhgQE6ZOwcaGEq0aMOjBAICADs=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\folder.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[folder.gif|folder.gif]] - {{{type=image/gif, size=141 bytes, encoded=190 bytes}}}|
| local file:|/%LOCAL_LINK%/[[file:///F:/TiddlyWiki/TW jQuery/TreeView/images/folder.gif|file:///F:/TiddlyWiki/TW jQuery/TreeView/images/folder.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/folder.gif|http://www.symbex.net.au/Wiki/images/folder.gif]]|
image
<<<
usage: {{{[img[tooltip|folder.gif]] or [img[tooltip|folder.gif][link]]}}}
[img[tooltip|folder.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEAAOALMAAJdaH+C6eP/inq1zLf/////Sg59oJMOHNAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAAQALAAAAAAQAA4AAAQ6kMhJq7336IPnoB92CGQR
BJtGcR0rjWQsA6A83HhODDEvx4WPoRAkGo8hQPGInAAGzCbFQK1aO1hCBAA7
---END_DATA---
%/
<<forEachTiddler
where
'tiddler.tags.contains("Fag") && tiddler.fields["fredag"]=="true" '
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"fredagshold\" er oprettede endnu//"'
>>
@@padding-left:0.6em;font-size:12pt;{{black{[[Infoindeks|InfoTiddler]]}}}@@@@padding-left:0.5em;font-size:7pt;<script label="(genopfrisk)">
story.forEachTiddler(function(t,e)
{story.refreshTiddler(t,null,true)});
refreshDisplay();
return false;
</script>@@
<<forEachTiddler
where
'tiddler.tags.contains("info")'
script
'
function getFirstLine(s) {
var m = s.match(/\s*(.*)/);
return m != null && m.length >= 1 ? m[1] : "";
}
'
write
'"@@[["+tiddler.title+"]]@@ → ~~//"+getFirstLine(tiddler.text)+"//~~\n"'
>><<newTiddler title: 'Ny information' tag: 'info' label:'Nyt til infoTavlen'>>
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\leftbackdo6.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[leftbackdo6.gif|leftbackdo6.gif]] - {{{type=image/gif, size=64 bytes, encoded=89 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/leftbackdo6.gif|./images/leftbackdo6.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/leftbackdo6.gif|http://www.symbex.net.au/Wiki/images/leftbackdo6.gif]]|
image
<<<
usage: {{{[img[tooltip|leftbackdo6.gif]] or [img[tooltip|leftbackdo6.gif][link]]}}}
[img[tooltip|leftbackdo6.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhbgACAIAAAHKOqgAzZiH5BAAAAAAALAAAAABuAAIAAAIXDIynyesNn4x0
2lqB3rz7D4biSJZmVwAAOw==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\leftbackdrkgreenqu9.jpg}}}|
| attached on:|1 June 2009 by YourName|
| embedded:|[[leftbackdrkgreenqu9.jpg|leftbackdrkgreenqu9.jpg]] - {{{type=image/jpeg, size=992 bytes, encoded=1344 bytes}}}|
| local file:|//none//|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/leftbackdrkgreenqu9.jpg|http://www.symbex.net.au/Wiki/images/leftbackdrkgreenqu9.jpg]]|
image
<<<
usage: {{{[img[tooltip|leftbackdrkgreenqu9.jpg]] or [img[tooltip|leftbackdrkgreenqu9.jpg][link]]}}}
[img[tooltip|leftbackdrkgreenqu9.jpg]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/jpeg;base64,
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8L
CwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUF
BQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e
Hh4eHh4eHh4eHh4eHh7/wAARCAACAG4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCw
mnaem3ZY2q7cbcRKMY24xx28tP8AvhfQUJp2npt2WNqu3G3ESjGNuMcdvLT/AL4X
0FFFfMn5+Cadp6bdljartxtxEoxjbjHHby0/74X0FCadp6bdljartxtxEoxjbjHH
by0/74X0FFFAAmnaem3ZY2q7cbcRKMY24xx28tP++F9BQmnaem3ZY2q7cbcRKMY2
4xx28tP++F9BRRQAJp2npt2WNqu3G3ESjGNuMcdvLT/vhfQUJp2npt2WNqu3G3ES
jGNuMcdvLT/vhfQUUUACadp6bdljartxtxEoxjbjHHby0/74X0FCadp6bdljartx
txEoxjbjHHby0/74X0FFFAAmnaem3ZY2q7cbcRKMY24xx28tP++F9BQmnaem3ZY2
q7cbcRKMY24xx28tP++F9BRRQAJp2npt2WNqu3G3ESjGNuMcdvLT/vhfQU63srO3
YNb2kETKu0FIwpAwoxx2wiD6KPQUUVnV/hy9GJ7H/9k=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\mainmenugray7ef.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[mainmenugray7ef.gif|mainmenugray7ef.gif]] - {{{type=image/gif, size=105 bytes, encoded=142 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/mainmenugray7ef.gif|./images/mainmenugray7ef.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/mainmenugray7ef.gif|http://www.symbex.net.au/Wiki/images/mainmenugray7ef.gif]]|
image
<<<
usage: {{{[img[tooltip|mainmenugray7ef.gif]] or [img[tooltip|mainmenugray7ef.gif][link]]}}}
[img[tooltip|mainmenugray7ef.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhAQBkAPMPALa2trm5ub29vb+/v8TExMbGxsvLy9HR0dfX19vb29zc3OHh
4efn5+vr6+zs7O7u7iH5BAAAAAAALAAAAAABAGQAAAQW8D3X2FIJHVPIEAEgjmRp
nmiqrqwZAQA7
---END_DATA---
%/
<<forEachTiddler
where
'tiddler.tags.contains("Fag") && tiddler.fields["mandag"]=="true" '
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"mandagshold\" er oprettede endnu//"'
>>
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\minus.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[minus.gif|minus.gif]] - {{{type=image/gif, size=837 bytes, encoded=1133 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/minus.gif|./images/minus.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/minus.gif|http://www.symbex.net.au/Wiki/images/minus.gif]]|
image
<<<
usage: {{{[img[tooltip|minus.gif]] or [img[tooltip|minus.gif][link]]}}}
[img[tooltip|minus.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhCQAJAPcAAAAAAICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAJAAkAAAgiAAMIHEjwn8GD/wQiPKhw
YcIA/wBIlPjQYUWHDRcS3BggIAA7
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\navbargrayhw1.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[navbargrayhw1.gif|navbargrayhw1.gif]] - {{{type=image/gif, size=1012 bytes, encoded=1373 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/navbargrayhw1.gif|./images/navbargrayhw1.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/navbargrayhw1.gif|http://www.symbex.net.au/Wiki/images/navbargrayhw1.gif]]|
image
<<<
usage: {{{[img[tooltip|navbargrayhw1.gif]] or [img[tooltip|navbargrayhw1.gif][link]]}}}
[img[tooltip|navbargrayhw1.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhCgA8APcAAL29zr3GzsbGzsbG1sbO1s7O1s7W3tbW3tbe3t7e597n5+fn
7+fv7+/v7+/v9+/39/f39/f/////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////ywAAAAACgA8AAAI2QABCBxIkEEDBggTIkzAsKFDAgUIQJwY
MYDFixYBYNxoUUAAAR5BfhQwgABJAgMEoFQpsaVJiRFjxoRYwECBmjhrGthpk+fO
A0CDCkVwAAFRo0UPOFyKIIECpwyfSp1KdYHVq1gXMLC6davWgw3CGgTbwEFYs2XP
PjC7lq0DCHDjyp1Lt67cCHDx5rXLt6/fv4ADCx5MuDBfvXohJFZcd3Hix3YhM947
Fy9ixnglQNC8GS5nzHEzd+4surRnxpozi07dWTNr1qtby3Y9WzFtCa5dq74dAffm
gAAAOw==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW Help\ScienceImages\navbargrayhw1.png}}}|
| attached on:|26 May 2009 by YourName|
| embedded:|[[navbargrayhw1.png|navbargrayhw1.png]] - {{{type=image/png, size=303 bytes, encoded=410 bytes}}}|
| local file:|//none//|
| remote link:|//none//|
image
<<<
usage: {{{[img[tooltip|navbargrayhw1.png]] or [img[tooltip|navbargrayhw1.png][link]]}}}
[img[tooltip|navbargrayhw1.png]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAIAAADQc7xaAAAABmJLR0QA/wD/AP+g
vaeTAAAA5ElEQVR42u2TS67DIAxF7wHvfz0ddd699KO+fqbugDYlQKBSVOkNmgGK
fLDvxQY2252WPw6ncwfb+e/Ww/tjN/tyvfdwDKGHQx/HuAqPiscVxW1dtsX/am2k
/c2JDa4D4O5AAVKwlyrJpt3TkpcwuUtpUVVfwbvFB9o/3MYMJgZyh3JcLsF7oIhq
XuIDa7T0yZw3OW/nZFvyH1PyTAncJRRe0s3zYxliLu2TNkveTJWj7N7LhPCGNC9r
C7aeT1C4PJWo023SrbRBCs9RUfIUtLJbc+uNnudbTVnT58lOug60TpaCD9FINRTx
kClXAAAAAElFTkSuQmCC
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\navbargreenhw1.gif}}}|
| attached on:|1 June 2009 by YourName|
| embedded:|[[navbargreenhw1.gif|navbargreenhw1.gif]] - {{{type=image/gif, size=966 bytes, encoded=1308 bytes}}}|
| local file:|//none//|
| remote link:|/%REMOTE_LINK%/[[htttp://www.symbex.net.ai/Wiki/images/navbargreenhw1.gif|htttp://www.symbex.net.ai/Wiki/images/navbargreenhw1.gif]]|
image
<<<
usage: {{{[img[tooltip|navbargreenhw1.gif]] or [img[tooltip|navbargreenhw1.gif][link]]}}}
[img[tooltip|navbargreenhw1.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhCgA8APcAAK33nLX/pb3/pb3/rcb/rcb/tc7/tdb/tdb/vd7/vd7/xuf/
xu//xu//zv//////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////ywAAAAACgA8AAAIqwABCBxIMEECBQgOJkRooKHDhwMERJwY
IGIAABczYsQYoKPHjyBDigwgsWLJiRMlqkQ5oKXLlgRiypQ5gECBmDdt4tR5s2eB
h0CDAj2AwEBRBAeMGkWKgGnTp1ChGpxKdaoCg1cPal2wdSvXBWAVgE0AtqzZs2jT
ql3Ltq3bt3Djyp1Lt67du3jzzmUAlu8Cv2z5Ci7rt0FZw4T7Kk68ALFhvo//mh0c
mUFAAAA7
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\navbarred.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[navbarred.gif|navbarred.gif]] - {{{type=image/gif, size=984 bytes, encoded=1332 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/navbarred.gif|./images/navbarred.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/navbarred.gif|http://www.symbex.net.au/Wiki/images/navbarred.gif]]|
image
<<<
usage: {{{[img[tooltip|navbarred.gif]] or [img[tooltip|navbarred.gif][link]]}}}
[img[tooltip|navbarred.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhCgA8APcAAP+9zv/Gzv/G1v/O1v/W3v/e3v/e5//n5//n7//v7//v9//3
9///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////ywAAAAACgA8AAAIvQABCBxIMIHBgwgNKFzIcIDDhxADSJwo
EQDFixgxChgQYKOAAAM+QnwIcqTJAQQcpkyJkoDLlS9jynRZgECBmjdtEmDIs4CB
Az8VAh1KtCiCA0cRJEWKIIFSp06bIpzaVEECq1ivKlhwletWqwvCil2wdazZs2gX
MAi7dm3at3Djyp1Lt67du3jhunWrdixfv4DZiv0buK/hw4MNtz28WHDjvYL7MlhM
2bFktZUhZ8Z8ebPnzJQnY24bekFAAAA7
---END_DATA---
%/
<<forEachTiddler
where
'tiddler.tags.contains("Fag") && tiddler.fields["onsdag"]=="true" '
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"onsdagshold\" er oprettede endnu//"'
>>
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\openbook.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[openbook.gif|openbook.gif]] - {{{type=image/gif, size=397 bytes, encoded=540 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/openbook.gif|./images/openbook.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/openbook.gif|http://www.symbex.net.au/Wiki/images/openbook.gif]]|
image
<<<
usage: {{{[img[tooltip|openbook.gif]] or [img[tooltip|openbook.gif][link]]}}}
[img[tooltip|openbook.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEAAQANU5AKat0evq6d7d3Zy12tji9pKp16WkuXZ/q7O2xo2MjLi4qoOc
zby8rLS0s8G/u7i2prKxr6WnpJKp2MbU8cTEw7/P772+rFx6tnCLws/b8+bl5cPG
09fh9b/Arru4uK+smfPy6Tlcoqyxr9HQzq2yss/b9LK0p8bT8XCLw4Oczv//+0lq
q8jIyD5Uf2aAtMrO4XRzcy5Sm6WkoZ6z3tnZ2Ts7O0RERMPDw////////wAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAADkALAAAAAAQABAAAAaqwBoqRywajbUU7EgkJAzF
WqGwLN5gCcABmqvNCJ7qNSL4bA63rqSEI8GuAhzugUAUbrXFSS6CxeUmLwEzNjUY
FXI0DjRyOAovNIQ1FxOJECyNDJCSKxlyIzKYchabhSEcOBoUoY0dpTUxBDgCDaxy
LwCDNjctMQMBNDIvOAEAAC8ghDm8vsEsMgChNCrKy70DMjIDLtzc1dYuMS4tvTHm
LTZGNzbsN+7v7kEAOw==
---END_DATA---
%/
<<tagCloud Ondskaben Resume TiddlyHomeSystem Værktøj authorbook excludeList excludeLists excludeSearch script settings systemConfig [[Eksempel emne]] [[Eksempel underemne]] EksempelSlide#1 EksempelSlide#2 EksempelSlide#3 killbookmark template>>
MainMenu
[[Eksempel emne]]
<<slideShow>>
<<forEachTiddler
where
'tiddler.tags.contains("Fag") && tiddler.fields["tirsdag"]=="true" '
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"tirsdagshold\" er oprettede endnu//"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("Fag") && tiddler.fields["torsdag"]=="true" '
sortBy
'tiddler.title.toUpperCase()'
write '"[["+tiddler.fields["laerer"] +"]] <<siteMap [["+tiddler.title+"]] . sliders$)) "'
none '"//ingen \"torsdagshold\" er oprettede endnu//"'
>>
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-black-line.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-black-line.gif|treeview-black-line.gif]] - {{{type=image/gif, size=1877 bytes, encoded=2543 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-black-line.gif|./images/treeview-black-line.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-black-line.gif|http://www.symbex.net.au/Wiki/images/treeview-black-line.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-black-line.gif]] or [img[tooltip|treeview-black-line.gif][link]]}}}
[img[tooltip|treeview-black-line.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEADwBvcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAQAPAGAAj/AP8JHPgPAMGDCA0iXFiQ
4UKFDglCjChwIkWLETE61MgQgMePHx9SlDhyIEeRJRumPJkwpcqSLA/GJLnS5UyT
NnPW3AlTZ0+eI29W9BmU6EWjGZFuVNqRKcqfUIsCPTo1adWlV5tmfSo1KlWvVsFi
FauVLNevXdOiXRtWbVu2Y93GhVtWbl26Z9/qnbv3bt+8fAP7FQx4sOHCiFtuVWyW
sd3EMp06xjv5b2XClw9nhkyzceTFnz13fry5dGjSpymntrwac2vNrznjBD1adW3W
t13nhr1b9lDas0UHR93bdPHYxofbVo6buW7nvKH7fkncpfXr2LNr3869e/TfwsFX
/xe/nHxz88/Rf6denv159+nhrxcqfzr9+5KR6z/OX3py9fbl1x+A/9VXIH7AEbif
fwsqOKCBDUL4IILhScjghAJeqKGDG1rI4YcehkjheCJmCOKI7aH4norxsTifiSUm
GGOFLgYoY40HwohjhDtieKOOQP4oJI1BEjkkiT12mOSJRSLZZIpPrhhli1O+eCSU
V0qZJZVbWmnkl052aSOYWJKppZlcoullmGqOyeabZcJ5ppxp0rlmnHjOmWede96p
5598AupnoIQOaqibfSIqqKKFMnpojmJC2qakdjpqKaWJYrqopo1y+iiPVV4KaqSj
TlpqpZ6K6qOpq6J6aqavbv8aa6ezftoqrLfKmiutu9qqZKipBlurqr+S2iuxTBpb
LKvLunqssM8OC22zuFKrq7W8Yutrssxy66y2yM74rbfVknutudmiu6245bJ7rrvp
wrvukvKGS++9wEqrb7T8gjutuvbm2y/A/9ZbML7KEryvvwsrPLDBDUP8MMLdSszw
xAJfrLHDG1vM8cceh0zxuCJnDPLI7aL8rsrxsjyvySUnHHPFLgcsc80Hw4xzxDtj
fLPOQP8sNM1BEz00yT13nPTJRSPddMpPrxx1y1O/fDTUV0udNdVbW2301053bTPY
WJOttdlco+112GqPzfbbZcN9ttxp07123HjPnXfde9//rffffAPud+CED264230j
LrjihTN+eM5iQ9625HY7bjnliWO+uOaNc/44z1VfDnrko09eeuWei+6z6aujfnrm
r28ee+ezf9467LfLnjvtu9uudOipB1+76r+T3jvxTBtfPOvLu3688M8PD33zuFOv
u/W8Y+978sxz77z2yM/8vffVk3+9+dmjv7345bN/vvvpw7/+0vKHT//9wEuvf/T8
gz+9+vbLX/8A+L/6FRB/yiPg/vy3QAUO0IANhOADEdg9CTJwggK8oAYduEELcvCD
HgwhBccnwgyCcITtQ+H7VBg/Fs7PhCVMYAwr6MIAyrCGB4QhDiO4QwzeUIdA/KEQ
MmkYRCIOkYQ97GAST1hEJDYxhU9cYRRbOMUXHhGKV5RiFqm4RSsa8YtO7KINaQgS
kAQEADs=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-black.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-black.gif|treeview-black.gif]] - {{{type=image/gif, size=1216 bytes, encoded=1649 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-black.gif|./images/treeview-black.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-black.gif|http://www.symbex.net.au/Wiki/images/treeview-black.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-black.gif]] or [img[tooltip|treeview-black.gif][link]]}}}
[img[tooltip|treeview-black.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhYACFAPcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAABgAIUAAAj/AP8JHEiwoMGDCBMqXMjw
H4CHABRCbEixosWLBCNi3Mixo0WNHkOKFAlypMmTKFOqPAmx5cOVMEkeLBmz5seB
IGna3LkwJ06eQBlGdOmwZdCjGX8K1In0qM+lTaNCNchU6k6XRq1araoVKdeuQb+C
5Sl2rM2yZmOiTRuS6Vq2Hd3CxThR4kuqcy++Rbg3b9+8gAMLBou17mCTcg8jnql4
Md7GMokShbwxMeW4jC9jfqy5cuG/nTmHljl6JOjSolFzPK1aaWuhmV/3jB3aMN+7
BVmb1e0QNW/ZwIMLF/z5N2TLw3O7Nt74ae/keCVnhe6cueLq0FNPzY7zM/fv4MOL
nR+/m7z21tNn4gaOnHv77O+p0zb/nHxx8fGTYw+/H/xQo5PJt511h/X3XX7D3Uff
ggw26GB9CxLYmYS7racehWNhSJmGxz3o4YcK+jcffCMKqBx/RU0UoH4lsnieiyf6
592HNNZoY20Octicfhbm1qOJEeYoZIM6BhbigS0mmKRwCDKZ4ksrKvmilDEiOSWT
M96o5ZZcdunll2AaFBAAOw==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-default-line.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-default-line.gif|treeview-default-line.gif]] - {{{type=image/gif, size=1993 bytes, encoded=2701 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-default-line.gif|./images/treeview-default-line.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-default-line.gif|http://www.symbex.net.au/Wiki/images/treeview-default-line.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-default-line.gif]] or [img[tooltip|treeview-default-line.gif][link]]}}}
[img[tooltip|treeview-default-line.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEADwBvcAAAAAAICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAQAPAGAAj/AP8JHEiwoEGBAQ4qXHgw
IcOHCx1CnEhQIkWKCTP+03ixYceLFj8yDClSIcmSBk+irLhyZMuIL03G9DizoMqX
N1vmXLkTZc+SP0UG/Ti0Y1GQNW0mZbkUYVOnT49ifLqRqtSJVyFmfbjVZVSrYL+K
bdoV5tilZWWeTZqWJtmwb9fWbJsSLlq7bPHO1TuTrlK5ffnG9Ms0ruG7gAcLxrlY
Z2Oej31GBjpZaGWil6lq3sy5M9fMSBMzFu2YNGTTklFTVm2ZNWbXRkFPhR36cF7a
s23vxY1Vdm/eWn0HB/6ZuFfdgY2bRa5YuVrmo6GXln6aemrrq7G31v6ae2znbhF7
/68tvvzt8bnN70b/m/1w98XhH1efXP5y+s3tP8cfnf90/9UBeJ2A2RG4nYHdIfid
fuGdpyB5Dka43oPpSVgfhe1h+J6G8XE4n4X5eXgfiP2R+J+JAaI4oIoFsnigiwnC
uKCI+8kI4YQ2VojjjhfmmKGPGwLZoZAf8hgikSMaWaKSJzKZopMrQtmilC9SGaOV
MyJZI5Y39siljl6GeeSXP5IZpJlDolmkmEuy2aSbT8IZpZxT0lmlnVfimaWaSerZ
5Zh+ggnooG0S+qahcSI6p6J1Mnqno3lCumegZVJ6pqVpYrqmpH8W6umhnyYa6qKj
Nlrqo6dGmuqknAq6aqegxv8qqqyk0mqqrajiqqqurL7qKq+wzipsrcPeWmyux+6a
bK/A/rpssMRGa6y0yFKrrLXMPussttBO6221314bbrbcbjtut+CmK6665J5rLrvo
ritvu/C+O2+89N5rb7784uvvvv9W2qrAvhLcrMHaIlyuwu4yXK/D+kLcL8AUSxzw
pQNjXLDGB3OcsMcLg9ywyA+THLHJE1tcMcoXZ5qxyxvD3LHMH9Mcss0j41yyzifz
nDLLK/vc8qYxEz2z0TUjfbPSOTO9s9M9Q/2z0EFLPXSfL1tdNdZFc32010mDvbTY
TZP9tNlRoz211iq3DbTbVMPN9tt0x1333Hbnjffeal//vaWmfW/9d9aBy1343Yfr
nTjfg3fd+NePhx352JOXXfnZl6ed+dqLd7653w3y+bngoQM+uuGnI5664qszXjrh
rXv+uuOzQ1675LdTnrvlu2Peu+a/cx778MGDXhd4xzOYPI3Fk768ls2jHr3q07Ne
vevPi3697Nmbvj3x3cP+/fjh016+7efjnr7u6/Pevu/vAx+/8OT/pbz9zM9vPP7Q
6+88/9rzn/QESD0CWs+A2AOg9xDIPQWKj4Hgc6D5JIg+CqrPguzDoPs0CD8Oys+D
9INg/QqTPxDuj4T9M+H/UBhAFQ7QhQWE4QFlmEAWLpCGDbThA3EYQR1O0IcVBOIF
poWYQSJu0IgdROIHlRhCHo5wIISBonBmyMQTShF5ThShFrPIxSqu8Ir38+ILxRhD
MlIRjCU0Yw3RmEI15pCNLXRjD+F4Qzk+ESphpOMO7bhFPnZRjz8EZBAFOURCFtGQ
R0RkEhW5REY20Y+QdKQV8ZhGSX6Rkm205Bg1WUZOnhGTcfTkGkFZR1G+kZR7NOUc
URlIVg7SlYWE5SFlmUhaLtIpGslIQAAAOw==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-default.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-default.gif|treeview-default.gif]] - {{{type=image/gif, size=1222 bytes, encoded=1657 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-default.gif|./images/treeview-default.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-default.gif|http://www.symbex.net.au/Wiki/images/treeview-default.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-default.gif]] or [img[tooltip|treeview-default.gif][link]]}}}
[img[tooltip|treeview-default.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhYACFAPcAAAAAAICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAABgAIUAAAj/AP8JHEiwoMGDCBMqXMjw
H4CHABRCbEixosWLBCNi3Mixo0WNHkOKFAlypMmTKFOqPBmgpUuXK2OKDHCQpsyb
G206HKgTp8+GOkH2/EkUIU2ID//RXFq0KcGgPJ1KfTpQ6NSrQwVmvfrzpVeuYMOK
VTq2rFmnW8+qXTsyLVuSb4uWjBq34USJSetynIvRrd6qfwMLHszV60vCIbf6RcxQ
MeOOjh/ndIiULFPJFCNjtqh5c+aanjkbbhm6tNTFplOvRK26tUnWpvm6Xigbdty7
CXGrls3ZM+/ZwIMLjzua9HC6BW2Hhqr1OHKrzskijchU+WPmZKNjt7658/Di3KOL
ox9Pvrx5ir+jp8dcOXfe1uuP1xYff/j88/iVFhfvXfh2/oA1px1lE1X3XYDZOfff
gAaFJxl4+UUo4YTO1SechcFhSJhuB3EYW4QazhYihSS2BiGDyQHYoIopDjidZQkC
119wM8oImnb7lajjjjz+NSJ8IALnYUbv9aiag0YyhmSSf52o4I1ProgiVS5WZqB/
UB5X42xbuuYkk2CGKeaYZJY5W0AAOw==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-famfamfam-line.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-famfamfam-line.gif|treeview-famfamfam-line.gif]] - {{{type=image/gif, size=807 bytes, encoded=1092 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-famfamfam-line.gif|./images/treeview-famfamfam-line.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-famfamfam-line.gif|http://www.symbex.net.au/Wiki/images/treeview-famfamfam-line.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-famfamfam-line.gif]] or [img[tooltip|treeview-famfamfam-line.gif][link]]}}}
[img[tooltip|treeview-famfamfam-line.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhAQABAPcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAABAAEAAAgEAP8FBAA7
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-famfamfam.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-famfamfam.gif|treeview-famfamfam.gif]] - {{{type=image/gif, size=1280 bytes, encoded=1734 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-famfamfam.gif|./images/treeview-famfamfam.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-famfamfam.gif|http://www.symbex.net.au/Wiki/images/treeview-famfamfam.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-famfamfam.gif]] or [img[tooltip|treeview-famfamfam.gif][link]]}}}
[img[tooltip|treeview-famfamfam.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhYACFAPcAAAAAADFrGDlzIUJzIVKEMXOcY71CAL1KANZaCMZaId5rIfdz
APd7GIS1Y4y9Y5S1e++EQvetc5S1jKW9nLXWlLXGrbnSpN6lhOetjOe1lO+1lNbn
vf/Stf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAABgAIUAAAj/AP8JHEiwoMGDCBMqXMjw
H4CHABRCbEixosWLBCNi3Mixo0WNHkOKFAlypMmTKFOqXMmypcuXMGPKnCnQQoEC
BCbQ3JmwQgMKGxwQeMCzKEECFCh0cOBAgNGnSDtIpRDgqdEBDhp0aNDUalEJBBxQ
EErUK08JAwIMkGC2rdu3cOPKnUu3Ls2SdlvizVtxosSHfDfuDYxyMOHDiBMrXsy4
sdsMCQwkuOCYYwYFGjhEUJChMsYEGiAwYAAhgeeLBjhI7cDAwGmLCSIwWLAAgenX
FDEkmI3gAGXcFCFL/g28uPHjyJMrl7icoeHKfhNGB/68ucDq1rNr3869u1WbOHVy
3fcJlCx3pEqZOt0edWrV7Vi1cl2vHaxY89zRqmXrvb///wAGOBB2zRG4GETVTYeb
gcoxmJyDyEEo4IQUHgdeTt2RF9RQ5yW1VFfsKeUed/FtBWJ9YY3FYX5prVXhizDG
eJiExtFYnI18KWiQjqfhuCCAPsoo5JBE8iTcZN1dltlmnW0Hmmik3aZdaqu1xl1s
s9UmZXa68eZbkpEhWeSYZJapUpA9AhkhYNKxaeabcMYp55yMHUmcdkpqxtmVoY1W
GndUSmWlk7LRZht3Xdb2JXd20unoo5BGKumkBwUEADs=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\treeview-gold-line.gif}}}|
| attached on:|4 June 2009 by YourName|
| embedded:|[[treeview-gold-line.gif|treeview-gold-line.gif]] - {{{type=image/gif, size=1878 bytes, encoded=2543 bytes}}}|
| local file:|/%LOCAL_LINK%/[[file:///F:/TiddlyWiki/TW jQuery/TreeView/images/treeview-gold-line.gif|file:///F:/TiddlyWiki/TW jQuery/TreeView/images/treeview-gold-line.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-gold-line.gif|http://www.symbex.net.au/Wiki//images/treeview-gold-line.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-gold-line.gif]] or [img[tooltip|treeview-gold-line.gif][link]]}}}
[img[tooltip|treeview-gold-line.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEADwBvcAAAAAAPdzc///1v//////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////yH5BAEAAAAALAAAAAAQAPAGAAj+AAEIHAhAAMGDCA0iXFiQ
4UKFDglCjChwIkWLETE61MhQgMePHx9SlDhyIEeRJRumPJkwpcqSLA/GJLnS5UyT
NnPW3AlTZ0+eI29W9BmU6EWjGZFuVNqRKcqfUIsCPTo1adWlV5tmfSo1KlWvVsFi
FauVLNevXdOiXRtWbVu2Y93GhVtWbl26Z9/qnbv3bt+8fAP7FQx4sOHCiFtuVWyW
sd3EMp06xjv5b2XClw9nhkyzceTFnz13fry5dGjSpymntrwac2vNrznjBD1adW3W
t13nhr1b9lDas0UHR93bdPHYxofbVo6buW7nvKH7fkncpfXr2LNr3869e/TfwsH+
Vxe/nHxz88/Rf6denv159+nhrxcqfzr9+5KR6z/OX3py9fbl1x+A/9VXIH7AEbif
fwsqOKCBDUL4IILhScjghAJeqKGDG1rI4YcehkjheCJmCOKI7aH4norxsTifiSUm
GGOFLgYoY40HwohjhDtieKOOQP4oJI1BEjkkiT12mOSJRSLZZIpPrhhli1O+eCSU
V0qZJZVbWmnkl052aSOYWJKppZlcoullmGqOyeabZcJ5ppxp0rlmnHjOmWede96p
5598AupnoIQOaqibfSIqqKKFMnpojmJC2qakdjpqKaWJYrqopo1y+iiPVV4KaqSj
TlpqpZ6K6qOpq6J6aqb+r24aa6ezftoqrLfKmiutu9qqZKipBlurqr+S2iuxTBpb
LKvLunqssM8OC22zuFKrq7W8Yutrssxy66y2yM74rbfVknutudmiu6245bJ7rrvp
wrvukvKGS++9wEqrb7T8gjutuvbm2y/A/9ZbML7KEryvvwsrPLDBDUP8MMLdSszw
xAJfrLHDG1vM8cceh0zxuCJnDPLI7aL8rsrxsjyvySUnHHPFLgcsc80Hw4xzxDtj
fLPOQP8sNM1BEz00yT13nPTJRSPddMpPrxx1y1O/fDTUV0udNdVbW2301053bTPY
WJOttdlco+112GqPzfbbZcN9ttxp07123HjPnXf+3XvfrffffAPud+CED264230j
LrjihTN+eM5iQ9625HY7bjnliWO+uOaNc/44z1VfDnrko09eeuWei+6z6aujfnrm
r28ee+ezf9467LfLnjvtu9uudOipB1+76r+T3jvxTBtfPOvLu3688M8PD33zuFOv
u/W8Y+978sxz77z2yM/8vffVk3+9+dmjv7345bN/vvvpw7/+0vKHT//9wEuvf/T8
gz+9+vbLX/8A+L/6FRB/yiPg/vy3QAUO0IANhOADEdg9CTJwggK8oAYduEELcvCD
HgwhBccnwgyCcITtQ+H7VBg/Fs7PhCVMYAwr6MIAyrCGB4QhDiO4QwzeUIc3QPyh
EGkYRCIOkYQ97GAST1hEJDYxhU9cYRRbOMUXHhGKV5RiFqm4RSsa8YtO7KINaQgS
kAQEAAA7
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\treeview-gold.gif}}}|
| attached on:|5 June 2009 by YourName|
| embedded:|[[treeview-gold.gif|treeview-gold.gif]] - {{{type=image/gif, size=1179 bytes, encoded=1596 bytes}}}|
| local file:|//none//|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-gold.gif|http://www.symbex.net.au/Wiki/images/treeview-gold.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-gold.gif]] or [img[tooltip|treeview-gold.gif][link]]}}}
[img[tooltip|treeview-gold.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhYACFAPcAAAAAAP//1v//////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////yH5BAEAAAAALAAAAABgAIUAAAj+AAEIHEiwoMGDCBMqXMiw
ocOHECNKnEixosWLGDNq3Mixo8ePIEMKDECyZEmRKCUGOLgypcuGLQHEjPmyJsuB
M23qNLgygICTJmnudJlz5NCjRWUeHSrU6FKdQU0+Xdp06s6qVm1izfpyK9eUXr+K
DCsWJNmyHs+i5ah2rca2buPKnUtXbtSTdTNWhZs34d6+GP8CtthTgOGeUgdHFKx4
IuPGi29CVnmX7+SCli9L1kyY88XMnnGGrgh6dOnQpz2n5rx6tOvXsGNzrdw672PZ
op0qxY05927eon0CTYw7ae26xoETvM2btvLn0KNLn069uvWvxyFnb7xdcffB3+l5
OofOvLjv8GuTk5f5k6RM4rLVP5evvHz8ytfz69/Pv7///wAGKOCABJqF33o8RWdf
bAvCVthh7+FlXoII9lbhcgoeWOCGHHbo4YcgOqgferaNaCJ14823WX0rAtfga4i1
F6F7zbVYI4Uq4lifhiH26OOPQAYppEsBAQA7
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-gray-line.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-gray-line.gif|treeview-gray-line.gif]] - {{{type=image/gif, size=1877 bytes, encoded=2543 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-gray-line.gif|./images/treeview-gray-line.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-default.gif|http://www.symbex.net.au/Wiki/images/treeview-default.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-gray-line.gif]] or [img[tooltip|treeview-gray-line.gif][link]]}}}
[img[tooltip|treeview-gray-line.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEADwBvcAAAAAAICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAQAPAGAAj/AP8JHPgvAMGDCA0iXFiQ
4UKFDglCjChwIkWLETE61MgwgMePHx9SlDhyIEeRJRumPJkwpcqSLA/GJLnS5UyT
NnPW3AlTZ0+eI29W9BmU6EWjGZFuVNqRKcqfUIsCPTo1adWlV5tmfSo1KlWvVsFi
FauVLNevXdOiXRtWbVu2Y93GhVtWbl26Z9/qnbv3bt+8fAP7FQx4sOHCiFtuVWyW
sd3EMp06xjv5b2XClw9nhkyzceTFnz13fry5dGjSpymntrwac2vNrznjBD1adW3W
t13nhr1b9lDas0UHR93bdPHYxofbVo6buW7nvKH7fkncpfXr2LNr3869e/TfwsFX
/xe/nHxz88/Rf6denv159+nhrxcqfzr9+5KR6z/OX3py9fbl1x+A/9VXIH7AEbif
fwsqOKCBDUL4IILhScjghAJeqKGDG1rI4YcehkjheCJmCOKI7aH4norxsTifiSUm
GGOFLgYoY40HwohjhDtieKOOQP4oJI1BEjkkiT12mOSJRSLZZIpPrhhli1O+eCSU
V0qZJZVbWmnkl052aSOYWJKppZlcoullmGqOyeabZcJ5ppxp0rlmnHjOmWede96p
5598AupnoIQOaqibfSIqqKKFMnpojmJC2qakdjpqKaWJYrqopo1y+iiPVV4KaqSj
TlpqpZ6K6qOpq6J6aqavbv8aa6ezftoqrLfKmiutu9qqZKipBlurqr+S2iuxTBpb
LKvLunqssM8OC22zuFKrq7W8Yutrssxy66y2yM74rbfVknutudmiu6245bJ7rrvp
wrvukvKGS++9wEqrb7T8gjutuvbm2y/A/9ZbML7KEryvvwsrPLDBDUP8MMLdSszw
xAJfrLHDG1vM8cceh0zxuCJnDPLI7aL8rsrxsjyvySUnHHPFLgcsc80Hw4xzxDtj
fLPOQP8sNM1BEz00yT13nPTJRSPddMpPrxx1y1O/fDTUV0udNdVbW2301053bTPY
WJOttdlco+112GqPzfbbZcN9ttxp07123HjPnXfde9//rffffAPud+CED264230j
LrjihTN+eM5iQ9625HY7bjnliWO+uOaNc/44z1VfDnrko09eeuWei+6z6aujfnrm
r28ee+ezf9467LfLnjvtu9uudOipB1+76r+T3jvxTBtfPOvLu3688M8PD33zuFOv
u/W8Y+978sxz77z2yM/8vffVk3+9+dmjv7345bN/vvvpw7/+0vKHT//9wEuvf/T8
gz+9+vbLX/8A+L/6FRB/yiPg/vy3QAUO0IANhOADEdg9CTJwggK8oAYduEELcvCD
HgwhBccnwgyCcITtQ+H7VBg/Fs7PhCVMYAwr6MIAyrCGB4QhDiO4QwzeUIdA/KEQ
MmkYRCIOkYQ97GAST1hEJDYxhU9cYRRbOMUXHhGKV5RiFqm4RSsa8YtO7KINaQgS
kAQEADs=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-gray.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-gray.gif|treeview-gray.gif]] - {{{type=image/gif, size=1230 bytes, encoded=1665 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-gray.gif|./images/treeview-gray.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-gray.gif|http://www.symbex.net.au/Wiki/images/treeview-gray.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-gray.gif]] or [img[tooltip|treeview-gray.gif][link]]}}}
[img[tooltip|treeview-gray.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhYACFAPcAAAAAAICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAABgAIUAAAj/AP8JHEiwoMGDCBMqXMjw
H4CHABRCbEixosWLBCNi3Mixo0WNHkOKFAlypMmTKFOqPBmgpUuXK2OKDHCQpsyb
G206HKgTp8+GOkH2/EkUIU2ID/+9HFq0aFCeTaMafCqQqVSnNa9qXfpSq9eqX8OC
FfvVKlmsZ7emVbv2ZkmobWW+HRu34kSJSafW/RjS7N6Dc/8KHkw4LVeYhUda9ZvY
4uLGM7NC9ngUqdKuky8+zsxxM2eMnj87PsxYNMPSpimiTn2adV/XlGF3XA07MG3X
tlPfTbib4O29gR3rlk28uPHjVUkjl1zwd2qqSpfrFShUenOHlpdah+7cNHfrvpmD
qyfdHbz58+jTqzcZHH1705Z55y2e+3x98/fB518ffT159KFtN1B1531XIHYTaSed
geYxOJ542ynH34QUVmjhThW+h99xvQE2H3Ea6mdhiBeWWKCEDUK4oIrLBbgiUhEp
2CKLyLk443QNomjijjz2mBmJ0gG5nJCTdViQkTdSWB5xS8rWJGxPivbfgTg+WKWA
V76YHWZJhkfldV96meNhPpZp5plopqnmmggFBAA7
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TW jQuery\TreeView\images\treeview-red-line.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-red-line.gif|treeview-red-line.gif]] - {{{type=image/gif, size=1877 bytes, encoded=2543 bytes}}}|
| local file:|/%LOCAL_LINK%/[[file:///F:/TiddlyWiki/TW jQuery/TreeView/images/treeview-red-line.gif|file:///F:/TiddlyWiki/TW jQuery/TreeView/images/treeview-red-line.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-red-line.gif|http://www.symbex.net.au/Wiki/images/treeview-red-line.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-red-line.gif]] or [img[tooltip|treeview-red-line.gif][link]]}}}
[img[tooltip|treeview-red-line.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhEADwBvcAAAAAAPV2dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAQAPAGAAj/AP8JHPgvAMGDCA0iXFiQ
4UKFDglCjChwIkWLETE61MgwgMePHx9SlDhyIEeRJRumPJkwpcqSLA/GJLnS5UyT
NnPW3AlTZ0+eI29W9BmU6EWjGZFuVNqRKcqfUIsCPTo1adWlV5tmfSo1KlWvVsFi
FauVLNevXdOiXRtWbVu2Y93GhVtWbl26Z9/qnbv3bt+8fAP7FQx4sOHCiFtuVWyW
sd3EMp06xjv5b2XClw9nhkyzceTFnz13fry5dGjSpymntrwac2vNrznjBD1adW3W
t13nhr1b9lDas0UHR93bdPHYxofbVo6buW7nvKH7fkncpfXr2LNr3869e/TfwsFX
/xe/nHxz88/Rf6denv159+nhrxcqfzr9+5KR6z/OX3py9fbl1x+A/9VXIH7AEbif
fwsqOKCBDUL4IILhScjghAJeqKGDG1rI4YcehkjheCJmCOKI7aH4norxsTifiSUm
GGOFLgYoY40HwohjhDtieKOOQP4oJI1BEjkkiT12mOSJRSLZZIpPrhhli1O+eCSU
V0qZJZVbWmnkl052aSOYWJKppZlcoullmGqOyeabZcJ5ppxp0rlmnHjOmWede96p
5598AupnoIQOaqibfSIqqKKFMnpojmJC2qakdjpqKaWJYrqopo1y+iiPVV4KaqSj
TlpqpZ6K6qOpq6J6aqavbv8aa6ezftoqrLfKmiutu9qqZKipBlurqr+S2iuxTBpb
LKvLunqssM8OC22zuFKrq7W8Yutrssxy66y2yM74rbfVknutudmiu6245bJ7rrvp
wrvukvKGS++9wEqrb7T8gjutuvbm2y/A/9ZbML7KEryvvwsrPLDBDUP8MMLdSszw
xAJfrLHDG1vM8cceh0zxuCJnDPLI7aL8rsrxsjyvySUnHHPFLgcsc80Hw4xzxDtj
fLPOQP8sNM1BEz00yT13nPTJRSPddMpPrxx1y1O/fDTUV0udNdVbW2301053bTPY
WJOttdlco+112GqPzfbbZcN9ttxp07123HjPnXfde9//rffffAPud+CED264230j
LrjihTN+eM5iQ9625HY7bjnliWO+uOaNc/44z1VfDnrko09eeuWei+6z6aujfnrm
r28ee+ezf9467LfLnjvtu9uudOipB1+76r+T3jvxTBtfPOvLu3688M8PD33zuFOv
u/W8Y+978sxz77z2yM/8vffVk3+9+dmjv7345bN/vvvpw7/+0vKHT//9wEuvf/T8
gz+9+vbLX/8A+L/6FRB/yiPg/vy3QAUO0IANhOADEdg9CTJwggK8oAYduEELcvCD
HgwhBccnwgyCcITtQ+H7VBg/Fs7PhCVMYAwr6MIAyrCGB4QhDiO4QwzeUIdA/KEQ
MmkYRCIOkYQ97GAST1hEJDYxhU9cYRRbOMUXHhGKV5RiFqm4RSsa8YtO7KINaQgS
kAQEADs=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki\TWExperiments\jQuery\images\treeview-red.gif}}}|
| attached on:|31 May 2009 by YourName|
| embedded:|[[treeview-red.gif|treeview-red.gif]] - {{{type=image/gif, size=1230 bytes, encoded=1665 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./images/treeview-red.gif|./images/treeview-red.gif]]|
| remote link:|/%REMOTE_LINK%/[[http://www.symbex.net.au/Wiki/images/treeview-red.gif|http://www.symbex.net.au/Wiki/images/treeview-red.gif]]|
image
<<<
usage: {{{[img[tooltip|treeview-red.gif]] or [img[tooltip|treeview-red.gif][link]]}}}
[img[tooltip|treeview-red.gif]]
<<<
/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhYACFAPcAAAAAAPV2dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAABgAIUAAAj/AP8JHEiwoMGDCBMqXMjw
H4CHABRCbEixosWLBCNi3Mixo0WNHkOKFAlypMmTKFOqPBmgpUuXK2OKDHCQpsyb
G206HKgTp8+GOkH2/EkUIU2ID/+9HFq0aFCeTaMafCqQqVSnNa9qXfpSq9eqX8OC
FfvVKlmsZ7emVbv2ZkmobWW+HRu34kSJSafW/RjS7N6Dc/8KHkw4LVeYhUda9ZvY
4uLGM7NC9ngUqdKuky8+zsxxM2eMnj87PsxYNMPSpimiTn2adV/XlGF3XA07MG3X
tlPfTbib4O29gR3rlk28uPHjVUkjl1zwd2qqSpfrFShUenOHlpdah+7cNHfrvpmD
qyfdHbz58+jTqzcZHH1705Z55y2e+3x98/fB518ffT159KFtN1B1531XIHYTaSed
geYxOJ542ynH34QUVmjhThW+h99xvQE2H3Ea6mdhiBeWWKCEDUK4oIrLBbgiUhEp
2CKLyLk443QNomjijjz2mBmJ0gG5nJCTdViQkTdSWB5xS8rWJGxPivbfgTg+WKWA
V76YHWZJhkfldV96meNhPpZp5plopqnmmggFBAA7
---END_DATA---
%/
<<newTiddler label:"whatsThis" title:" What's This" tag:"whatsThis" focus:"text">>
//{{{
config.options.chkDisableTabsBar=false;
config.options.chkHttpReadOnly = false;
/*config.options.chkAutoSave = true;*/
config.options.chkSaveBackups = false;
config.options.chkAnimate = false;
config.options.chkShowRightSidebar= false;
config.options.chkShowLeftSidebar= true;
config.options.chkSinglePageMode= true;
config.options.chkSinglePagePermalink= false;
config.options.chkSearchTitles=true;
config.options.chkSearchText=true;
config.options.chkSearchTags=true;
config.options.chkSearchFields=true;
config.options.chkSearchTitlesFirst=false;
config.options.chkSearchList=true;
config.options.chkSearchByDate=false;
config.options.chkSearchIncremental=false;
config.options.chkSearchShadows=false;
//}}}