Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
<data>{"bibdata":"DL 2001","wherekept":"Kathrine Østergaard Petersen","author":"Jesper Wung-Sun","primtopic":"Fra barn til voksen"}</data>
Kilde:[[Dansklærerforeningen 2001|http://www.dansklf.dk/page.dsp?page=3278]]
Denne roman lægger sig i forlængelse af rækken af dannelsesromaner skrevet for og til unge. Den kan i undervisningen gå hen og blive en afløser for Rifbjergs Den kroniske uskyld, fordi den på den ene side giver et tidstypisk billede af unges kombination af kompromisløshed og forsoning med skæbnen og på den anden side hævder individets ret og pligt til både selvstændighed og ansvar for andre. Den er i hvert fald allerede blevet et hit for mange elever i skolens ældste klasser og i ungdomsudddannelsernes 1. klasser. Læsningen vil overordnet være præget af en umiddelbar optagethed af romanens eksistentielle problemstilling, en søgen efter en mening i det tilsyneladende meningsløse, en søgen der primært er baseret på læserens identifikation med en af de to altdominerende hovedpersoner, Jeppe eller Cecilie, og deres håbløse kamp mod kræften, for livet og for lykken og Jeppes efterfølgende tro på en fremtid. Romanen slutter trods alt med et håb og en tro på fremtiden. (Alt andet ville heller ikke være til at bære).
<<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"'>>
Tekst, der skrives her, slettes ved oprettelse af ny fællesjournal på samme dato - så skriv her til allersidst
<<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"'>>
<data>{"author":"Martin Petersen","bibdata":"2000","wherekept":"Boanna Stig Frølund","primtopic":"Krig"}</data>
Kilde: [[Cvu Jelling|http://www.aha.cvujelling.dk/Dansk/B%C3%B8rnelitteratur/24.3/Adamsfest.htm]]
Studieopgave hold 24.3. Lærerfaglig analyse af børne-ungdomsromaner
Efterår 2005. Helle, Annemette og Rasmus
Romanen Adams fest er skrevet af Martin Petersen og udgivet af Høst & Søns Forlag i 2000. Den handler om en ung mand, der efter en krigssituation har mistet sin hukommelse og nu kæmper for at overleve. Sammen med andre indbyggere forsøger han at genetablere et civiliseret samfund i en krigshærget by.
Forfatterportræt[1]:
Forfatter, født i København, 1950.
Martin Petersen har skrevet 3 romaner og 1 digtsamling for voksne og 8
romaner for børn og unge. Sidst udkomne roman er "Indtoget i
Kautokeino" (Samleren, 2004). Arbejder p.t. på en ungdomsroman.
Forfatteren er læreruddannet, og har arbejdet i folkeskolen i tyve år frem til 1998 og udgivet bøger siden 1987. Han startede med sangtekster og revynumre, siden blev det digte, og nu er det romaner.
Priser og pral:
· Kulturministeriets børnebogspris, 1999 for "Med ilden i ryggen".
· Dansk skolebibliotekarforenings børnebogspris, 2001 for "Adams fest", "Med ilden i ryggen" samt en infowebside om sidstnævnte.
· Frie Grundskolers Lærerforenings børnekulturpris, 2000.
Nomineret til
· Årets historiske bog, 2004 på "historie-online.dk", en webside der drives af Dansk Historisk Fællesråd, for "Indtoget i Kautokeino".
”Skrivningen er det primære for en forfatter, men foredrags- og undervisningsvirksomhed omkring såvel kreativ skrivning som egne bøger er også spændende arbejdsområder for mig.
For nylig er jeg desuden kommet i gang med en interessant "storytelling" for en privat virksomhed.”
Genre og tema:
Romanen er fiktionsprosa og tilhører den episke genre. Handlingen fortælles af hovedpersonen på en måde, hvor læseren gennem stadig flere detaljer får større overblik over fortællingen. Romanen er realistisk, og selvom handlingen er opdigtet, kan den af læseren genkendes, og de virkelighedsnære og konkrete sociale forhold, som forfatteren beskriver, gengiver mange detaljer og psykologiske træk hos personerne. I tekstens underbestemthed er det også en eksistentialistisk dannelsesroman, der handler om, hvad det vil sige at eksistere – opnå mening i livet ud fra de valg man træffer og derved skaber sin identitet og personlighed. Vi har i analysen valgt at fortolke handlingen ud fra en ideologisk og religiøs grundtanke, hvor personerne symboliserer menneskets indre etiske værdier eller mangel på samme.
Resume:
Romanens handling tager udgangspunkt i krigens slutning, hvor alt er kaos og de sidste bombardementer raser. Hovedpersonen er såret, men sanser det ikke i sin kamp for at søge ly og overleve. Da der omsider bliver stilhed, går han rundt - identitetsløs og uden hukommelse - søgende efter husly og føde i byens ruiner. Her møder han Sandra, der giver ham navnet Adam. I den korte nat hjælper de på hver sin måde hinanden til overlevelse, og da de skilles mærker de begge en dyb afhængighedsfølelse.
I hverdagens overlevelseskamp møder Adam forskellige mennesker i alle aldre, der hver på sin måde hjælper ham videre i livet – især børnene Bjanka og Jussi har stor værdi. Adam og Sandra er på forskellig vis ramt af krigen, hvilket gør det svært at kæmpe sammen. Han husker intet og vil gerne vide – hun husker alt og vil gerne glemme. Denne markante forskel får Sandra til at fortsætte sit liv som prostitueret blandt sejrherrerne, til stor frustration for Adam, der ønsker at skabe trygge og kærlige rammer i deres ramponerede liv. Med håb om at genvinde Sandra, fortsætter han sin identitetsløse tilværelse - også selvom, der efterhånden indføres lov og orden. Konsekvensen er, at han frasiger sig hjælpen til overlevelse i form af rationeringsmærker og arbejde for ham og sin ”nye familie”, men i stedet ernærer de sig med tyveri og sortbørshandel.
I et forsøg på at møde Sandra søger han sejrherrernes område. Dette medfører dog stor skuffelse, og han drukner sine sorger i alkohol og en anden kvinde. I erkendelsen om at være på gale veje, men stadig med håb om at genvinde Sandra, organiserer Adam en fest, der samler dem og byens beboere med håb om en fælles fremtid.
Festen bliver en succes, dog uden at han genvinder Sandra, vis skæbne ender fatalt den efterfølgende nat. Hendes skæbne er medvirkende til, at Adams identitet legaliseres, og i romanens slutning er han godt på vej i sit nye liv.
Komposition:
I romanens komposition tager vi udgangspunkt i tekstens overbestemthed:
Det er en episk beretning om Adam – et menneske, der er bombet tilbage til sit urinstinkt og gennem handlingen dannes sammen med den nye kultur.
Fortællingen har et kronologisk forløb, der udspiller sig over et lille års tid – det er koldt i begyndelsen og atter frostvejr i slutningen. Undervejs er der flashbacks, hvor hans hukommelse langsomt genvindes. Handlingen tager dog et spring efter Sandras fatale skæbne, hvorefter vi hører om Adams legaliserede tilværelse.
Dette kan vi illustrere ved hjælp af berettermodellen[2]:
Spændingen er høj ved romanens begyndelse, hvor krigen hærger, og falder da han søger ud fra sig skjul.
Herefter stiger spændingen gradvist – først ved forelskelsen – senere ved de forskellige prøvelser, som Adam bliver udsat for.
Situationen, hvor han af Zakarias bliver sendt ud for at bestjæle sejrherrerne og eventuelt likvidere, kan betegnes som ”point of no return”.
Konflikten – med Sandra som mål – optrappes både på grund hans illegalitet og hans opsøgning af sejrherrerne.
Handlingens klimaks er festen - efterfulgt af Sandras tragiske skæbne.
Spændingen udtones efter anholdelsen af Adam, og handlingen springer herefter til et længere flashback, hvor læseren for indblik i konfliktens løsning.
Sprogbruget er implicit, da man allerede i begyndelsen af romanen kan finde sammenhæng med Skabelsesberetningen og Syndefaldsmyten 1.Mosebog 1-3. Heri ligger der et skjult budskab om tekstens underbestemthed. Også med forfatterens valg af ordklasser – først substantiver senere overvejende brug af pronominer og adverbier – hvilket også kan illustrere processen fra den primitive tilværelse til dannelsen af en kultur. I begyndelsen var det mørkt[3]……
Ved hjælp af troper understreger Martin Petersen tekstens underbestemthed – dannelsen af mennesket.
Dette er også illustreret først i romanen med fine eksempler på billedsprog, fx sammenligninger som mavede sig som en baby og kravlede som en hund. [4].
Jo længere frem i historien vi når, desto færre troper støder vi på.
Forfatteren har valgt en indre synsvinkel på 1. personfortæller i jegform. Dette ved vi, fordi Adam bliver omtalt som jeg. Hele tiden får vi at vide, hvad Adam føler, mener og tænker. Derimod ved vi intet om, hvad der foregår i hovederne på resten af bogens personer.
Miljø:
Det fysiske og historiske miljø, som historien er fortalt i, er fiktivt, da vi ikke kan identificere hverken tid eller sted. Vi gætter dog på, at den ligger i tidsrummet mellem 1920´erne og frem til 1970´erne. Dog med stor sandsynlighed for, at det er i perioden lige efter 2.Verdenskrig. Det er værd at lægge mærke til, at de sejrende ankommer i køretøjer.
Vi får ikke meget af vide om, hvorhenne romanen finder sted, men vi gætter på, at den udspilles i enten Tyskland, eller det østlige Europa – fx Jugoslavien ( i dag Serbien, Kroatien, Slovenien m.m. ).
Det eneste vi med sikkerhed kan sige er, at selve forløbet foregår i en by med forholdsvis mange indbyggere, og disse hører ikke til de sejrende fra krigens afslutning.
Det fysiske sted har base i resterne af et byhus, hvor Adam slår sig ned. Herfra finder han, og senere hen Bjanka og Jussi, den nødvendige tryghed i deres såkaldte hverdag. I starten er ruinen fugtig, snavset og ussel, men snart får de etableret et hyggeligt, men dog primitivt hjem, som bliver holdepunktet for de tre i et kaotisk liv.
Forfatterens hensigt med sammenblandingen af tid og miljø er, at krigsvilkårene er de samme, hvor end den udspilles og danner rammen om mennesket og kulturens dannelse.
Uanset, hvor civiliseret et samfund har været før en eventuel krigs ødelæggelse, ændres normer og moral. Mennesket bliver primitivt, når de basale behov frarøves.
Personer:
Primær hovedperson:
Adam
Fysiske kendetegn: Hovedpersonen er en ung mand i alderen 16 – 19 år. Adam har lidt skade under krigshandlingerne og har fået et stort sår i baghovedet. Han er ussel klædt i beskidte og iturevne klæder. Han er træt, sulten og tørstig første gang vi møder ham.
Psykiske kendetegn: Han lider af hukommelsestab, han er angst, bange og i begyndelsen føler han sig mere som et dyr end et menneske. De basale behov er dyriske, for moralen eksisterer overhovedet ikke, da han plyndrer en død soldat. Efter mødet med Sandra vækkes hans menneskelige følelser, der medfører en bevidstgørelse af hans handlinger, som på sigt giver mening i tilværelsen.
Sociale kendetegn: Adam er uden identitet, familie, penge eller bolig. Han har ingen tilhørsforhold til byen, men har slået sig ned i den nærmeste ruin. Adams sociale status er i begyndelsen lav ligesom de øvrige indbyggeres, dog finder han af og til arbejde som løsarbejder. Da sejrherrerne under opbygningen af det nye samfund indfører identitetskort, vælger Adam at fortsætte et liv som subsistensløs med ruinen som fast samlingssted for ham og børnene. Dette vælger han ud fra et socialt hensyn til børnene, der ellers ville ende på børnehjem, men også som en sikkerhed for at Sandra kan finde ham igen.
Hans sociale udvikling går fra at være lukket og afvisende til at være social, omsorgsfuld og beskyttende.
Kulturelle kendetegn: Pga. hukommelsestabet hører vi kun sporadisk om livet før krigen. Derfor ved vi ikke meget om den sociale arv og Adams´ livsværdier. Undervejs dukker der erindringer op om et hus med have, kærlige forældre og en lillebror. Den formodentlig trygge opvækst afspejles i hans omsorg for Sandra, Jussi og Bjanka.
Sekundær hovedperson:
Sandra
Fysiske kendetegn: Ung kvinde - måske lidt ældre end Adam, med langt, sort hår. Ligesom Adam er hun også klædt i snavsede og slidte klæder, men i modsætning til de øvrige personer er hun den eneste, der er beskrevet med en særlig lugt og små dyr i håret.
Psykiske kendetegn: Hun føler sig alene og har angst for både fortiden, nutiden og fremtiden. Hun føler sig behandlet som et dyr, dog med undtagelse af Adam, som behandler hende som et menneske. Under krigen er hun blevet voldtaget af fem soldater og har derved mistet moral og selvværd.
Sammen med sin mor levede hun under kummerlige kår i et hønsehus, og mens moderens moral ikke bukkede under for sulten, ernærede Sandra sig ved prostitution, som medførte en stor kløft mellem mor og datter.
Sociale kendetegn: Ligesom Adam befinder Sandra sig også i den nederste del af den sociale rangorden. I sin søgen efter social tryghed lukker hun af for sine følelser, og gennem prostitution sælger hun sig selv dyrt.
Kulturelle kendetegn: Før krigen har Sandra levet et godt og trygt liv under sociale gode forhold. Krigen frarøver hende alt – både materielt, socialt og menneskeligt.
Persongalleri:
En kort oversigt over de personer, som har indflydelse på Adams liv i bogen.
Pilene viser vores symbolske fortolkning af personerne i romanen.
Adam Ung dreng/mand à mennesket
Sandra Ung kvinde à driften
Primære bipersoner
Bjanka Pige på 8-10 år à følelserne, håbet
Jussi Dreng på 5-8 år à modet
overleveren fra dag
til dag
Zakarias Ung mand à ondskaben
skruppelløs overlever
Janicka Franck Zakarias´ mor à moralen, fornuften
Lorenz Ung mand à angsten
Sekundære bipersoner
Felix Bror til Lorenz à fortrængningen
Urmageren Kammerat til à skæbnen
Adam
Yanina Ung kvinde à skammen, det uskyldige offer
Begår selvmord
Eddie Fordomsfri soldat fra à tilgiveren
sejrherren
Adi Nabokone til à skytshelgen
Janicka
Bibi Ung kvinde à drivkraften til at komme videre
Symboler og fortolkning:
Som vi også udtrykker i persongalleriet indeholder teksten en del symboler – alt efter fortolkningen.
Herudover bruger forfatteren bl.a.:
Adam à Mennesket
Kogebogen à drømme, håbet for fremtiden
Elefanten à hukommelse
Floden à overgang til det ”nye liv”
Såret i Adams hoved à smerten heles/nyt liv
I teksten er der også mange kontraster bl.a.:
Lys > < mørke
Ild > < vand
Sølvtøj > < ruiner
Adam > < Sandra – mennesket som dannes > < mennesket i forfald
Adam > < Zakarias – sandheden > < løgnen
Som tidligere nævnt har vi valgt at tolke romanen som en eksistentialistisk dannelsesroman, hvor Adam i begyndelsen tager sine valg gennem Sandra og Zakarias, mens han i slutningen vælger sig selv.
Som fortællingen i begyndelsen lægger op til, kan den også tolkes med kristen ideologi, og der kan drages paralleller med Skabelsesberetningen. Allerede med navnet Adam indikeres dannelsen af et menneske – på godt og ondt.
Overordnet set kan man symbolsk se romanen som overgangen fra barn til voksen – puberteten.
Fra kaos til kosmos.
Litteraturliste:
Hansen, T. Illum Procesorienteret litteraturpædagogik Dansklærerforeningen 2004
Johansen, Nis m.f Litteraturens redskaber Gyldendal 2003
Petersen, Martin Adams fest Høst & Søn 2000
UVM Fælles mål Dansk UVM 2003
UVM Fælles mål Kristendom UVM 2003
www.textanalyse.dk
www.skolekom.dk/dansk
www.sitecenter.dk/martin_petersen/hjemmeside
Hiim & Hippes relationsmodel
<data>{"author":"Christian Dorph & Simon Pasternak","bibdata":"2007","wherekept":"Kasper Hasselkvist","primtopic":"Krig"}</data>
Kilde: [[Horsens bibliotek|http://horsensbibliotek.dk/bogtips/christian-dorph-og-simon-pasternak-afgrundens-rand.html]]
Makkerparret Dorph og Pasternak har med “Afgrundens Rand” udgivet den anden krimi med med samme politifolk - Ole Larsen og Erik Rohde, som de introducerede i romanen “Om et øjeblik i himlen”. I den nye har politimændene så fået femint, men ikke mindre hårdtslående selskab af kriminalassistent Anita Jensen.<br>
På trods af fin omtale kom jeg aldrig rigtig i gang med den første, men med endnu flottere anmeldelser af 2′eren fik jeg lyst til at kaste mig over den. Og det fortrød jeg ikke.<br>
“Afgrundens Rand” er en meget spændende og velfortalt historie, som samtidig giver læseren et flot tidsbillede af senhalvfjerdsernes Danmark og såmænd også af besættelsestiden. Der er meget på spil og de gode politifolk må holde hovedet koldt, for der er mange historier og implicerede at holde rede på. Det lykkes for politiet, og det lykkes ikke mindst for Dorph og Pasternak. Som en anmelder skrev er man er utrolig godt underholdt - og jeg vil gerne tilføje begavet - men faktisk også en lille smule rundtosset efter læsningen. Jeg er enig.<br>
En mørk krimi, måske mest til mænd ?
Synopse: [[Link|Anders Agerlunds synopse]]
/%
Elev: [[Anders Agerlund]]
!Beskrivelse
[[Floden|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FFloden.PDF&cidReq=DANSK_001]] Novelle (1919) af Antonis Samarakis
!end
%/
Navn: [[Anders Agerlund]]
Prøve niveau: FSA
Himmerlands Ungdomsskole
Fordybelsesområde: Krig, artikel
Tekst: [[Floden|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FFloden.PDF&cidReq=DANSK_001]]
Forfatter: Antonis Samarakis
Begrundelse for valg: Fordi jeg synes den rører et spændende emne
Synopse
havde forfatter nogen bestemt mening til at skrive den? Hvis ja hvilke?
Resume.
Hvad er en artikel?
Opbygning?
Personer og tema?
Oplæsning. Side 2 linje 34 til resten af historien.
Nr. 24: Unge og kriminalitet, artikel
/%
Elev: [[Anders Rahbek Hansen]]
!end
%/
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Anders%20Rahbek.pdf]]
/%
!Beskrivelse
[[De var helt vilde|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FDe_var_helt_vilde.PDF&cidReq=DANSK_001]] (Artikel - Ekstrabladet)
!end
%/
{{tuduSlider{<<slider chkBookSummary Bibliografi 'Andre »'>>}}}<<wikify "[[►|%0]]" {{tiddler.data("wherekept","Læser er ikke defineret endnu")}}>>
<html><p><span style="font-size: larger;"><span style="font-family: Comic Sans MS;">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. </span></span></p><p><span style="font-size: larger;"><span style="font-family: Comic Sans MS;">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. </span></span></p><p><span style="font-size: larger;"><span style="font-family: Comic Sans MS;"> Easy reader udgave af den oprindelige roman i serien Lette klassikere.</span></span></p></html>
Nr 17: Kærlighed, litteratur før 1870
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Anna%20Agger.pdf]]
/%
Elev: [[Anna Agger Rasmussen]]
!Beskrivelse
[[Snemanden]](Eventyr af HC Andersen)
!end
%/
.Nr. 3: Forfølgelse, Novelle
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Anne%20Bach%20S%C3%B8rensen.pdf]]
/%
Elev: [[Anne Bach Sørensen]]
!Beskrivelse
[[Et par underbukser|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FEt_par_underbukser.PDF&cidReq=DANSK_001]] Novelle af Dan Turell.
!end
%/
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Anne%20Sofie%20Palm%20Hansen.pdf]]
/%
Elev: [[Anne Sofie Palm Hansen]]
!Beskrivelse
[[Total eufori|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FTotal_Eufori.PDF&cidReq=DANSK_001]] fra albummet: "Pas på pengene" af Dan Turell & Halfdan E
!end
%/
/***
!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));
}
}
//}}}
People who have used ~TiddlyWiki before may wish to access TW features that I have hidden or changed:
#Use the StyleSheet to adjust colors, font-sizes, page layout tweaks and other design features.
#Use [[zzConfigOptions]] to change the settings for saving options, animations, toggle options, single page mode options (to view multiple tiddlers) and search options.
#Use ViewTemplate to restore tiddler subtitles and tagging boxes. Warning: you will need to carefully add lines of code from the original ViewTemplate at http://www.tiddlywiki.com.
<html><div align="center"><iframe src="http://dl.getdropbox.com/u/1064531/Begrebsleksikon%20Dansk%20analyse.pdf" frameborder="0" width="100%" height="600"></iframe></div></html>
[[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">>
/***
|''Name:''|BlogLayout|
|''Description:''|adds a blog like view and tiddler summary view to TiddlyWiki|
|''Author''|BenGillies|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/BenGillies/plugins/BlogLayout.js |
|''Version:''|1.0|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.5|
<<setCollapseHeightHere>>
! Usage
Set POST_TAG_NAME to the tag that you want to load by default. This will then automatically order all tags most recent first.
All posts longer than MAX_HEIGHT will be shortened and a "Read More..." link appended to the bottom.
You can additionally call
{{{<<collapseThisTiddler default_height>>}}}
At the end of any tiddler to provide a similarly shortened view with a "Read More..." link at the bottom. default_height is optional and provides a default to set the height to if setCollapseHeightHere has not been called within the tiddler (see below). Set default_height to -1 to set a default of not shortening tiddlers. This can be placed in the ViewTemplate tiddler (AUTO_SUMMARISE_FRONT_PAGE should be turned off if you are doing this) right after the .viewer div, as follows:
{{{<div macro="collapseThisTiddler default_height"></div>;}}}
You can also set a custom height from within the tiddler. If you do this, it will take precedent over all other default height settings and is the recommended method of setting height as it allows you to fine tune how short each tiddler can be. To use, call:
{{{<<setCollapseHeightHere turn_off>>}}}
This will set the height of the shortened tiddler to wherever you place the macro. turn_off should be -1 if you wish the tiddler to always appear in full. Otherwise, leave blank.
You can link to a blog-like page/layout (as per the page ouy get on first load) by putting:
{{{<<recentByTagLink link_name tag_name max_posts collapse_posts default_height>>}}}
in place of any link, where:
link_name = the text you want the link to read
tag_name = the name of the tag you want to filter by (aka POST_TAG_NAME)
max_posts = the maximum number of posts to display
collapse_posts = this can be 1 or 0. If 1 it will shorten posts, adding the Read More link. Default is AUTO_SUMMARISE_FRONT_PAGE.
default_height = the default height of shortened posts. Set to -1 to turn off by default.
Note - It is assumed that when a user clicks on a link specifically, they want to read the whole tiddler. If you want tiddlers to appear shortened when they are clicked on, you will need to edit the ViewTemplate tiddler.
!Code
***/
//{{{
if(!version.extensions.BlogLayout)
{ //# ensure that the plugin is only installed once
version.extensions.BlogLayout = { installed: true }
};
(function($) { //set up alias for jQuery
config.macros.BlogLayout =
{
//*******collapseTiddlers variables********//
AUTO_SUMMARISE_FRONT_PAGE: false, //collapse all default tiddlers on first load (other tiddlers are unaffected)
MAX_HEIGHT: 200, //max height of tiddler content in pixels (default value)
//*******recentPosts variables*************//
POST_DISPLAY_COUNT: 2, //maximum number of posts to display (nb this does not work at present)
POST_TAG_NAME: "blog" //all posts that you want displayed in date order need to be tagged with this.
}
config.macros.BlogLayout.collapseMe = function(tiddlerRoot,defaultHeight)
//collapse tiddlerRoot
{
custHeight = store.getTiddler($(tiddlerRoot).attr("tiddler")).fields["collapseHeight"] || defaultHeight || this.MAX_HEIGHT;
customHeight = parseInt(custHeight);
//if the post is too big
if (($(tiddlerRoot).children('.viewer').height() > customHeight)&&(customHeight != -1))
{
//limit height of tiddler
$(tiddlerRoot).children('.viewer').css('overflow','hidden').css('height',customHeight);
//create a link
myLink = document.createElement("a");
myLink.href = "javascript:;";
myLink.onclick = function() {return config.macros.BlogLayout.expandClick(tiddlerRoot);};
myLink.innerHTML = "Læs mere...";
myLink.className = "button";
$("<div />").addClass('readMore').append(myLink).css("margin-top","3px").appendTo($(tiddlerRoot));
}
}
config.macros.BlogLayout.collapseTiddlers = function(defaultHeight)
//collapse all currently open tiddlers
{
$(".tiddler").each(
function() {
if(this.style.display == "none")
{
$(this).attr("collapseMeLater",(defaultHeight)?(defaultHeight+""):"null");
}
else
{
return config.macros.BlogLayout.collapseMe($(this),defaultHeight)
}
}
)
}
config.macros.BlogLayout.expandClick = function(tiddlerToExpand)
{
$(tiddlerToExpand).children(".readMore").css('display','none');
$(tiddlerToExpand).children(".viewer").css('overflow','visible').css('height','');
}
config.macros.BlogLayout.showNextTiddlers = function(clickedLink)
{
var divs = clickedLink.nextSibling;
$(clickedLink).hide();
$(clickedLink).remove();
var stopping = false;
while((!stopping)&&(divs))
{
$(divs).show();
if (divs.className == "showMorePosts")
{
stopping = true;
break;
}
else if ($(divs).attr("collapseMeLater"))
{
if ($(divs).attr("collapseMeLater") == "null")
{
this.collapseMe($(divs));
}
else
{
this.collapseMe($(divs),$(divs).attr("collapseMeLater"));
}
$(divs).removeAttr("collapseMeLater");
}
divs = divs.nextSibling;
}
}
config.macros.BlogLayout.recentTiddlersByTag = function(tagName,maxPosts)
//view all tiddlers with tagName by date order
{
story.closeAllTiddlers(); //clear screen ready for display
$(".showMorePosts").remove();
tiddlers = store.filterTiddlers("[tag["+tagName+"]][sort[-created]]");
var count = 0;
var currMax = maxPosts;
var justChanged = false;
while (count < tiddlers.length)
{
if (count == currMax)
{
$("<div />").addClass("showMorePosts").text("More Posts...").css("display","none").click(function(){return config.macros.BlogLayout.showNextTiddlers(this);}).appendTo("#tiddlerDisplay");
currMax += maxPosts;
}
story.displayTiddler("bottom",tiddlers[count].title,DEFAULT_VIEW_TEMPLATE,false,false);
if (count >= maxPosts)
{
//hide the tiddler
$(story.getTiddler(tiddlers[count].title)).css("display","none");
}
count += 1;
}
//hide all but the first More Posts...
if ($(".showMorePosts").length > 0)
{
$(".showMorePosts")[0].style.display = "block";
}
}
config.macros.BlogLayout.autoRecentTiddlers = function()
{
if(!window.location.hash)
{
this.recentTiddlersByTag(this.POST_TAG_NAME,this.POST_DISPLAY_COUNT);
}
}
config.shadowTiddlers['DefaultTiddlers'] = "[tag["+config.macros.BlogLayout+"]][sort[-created]]";
window.original_restart = window.restart;
window.restart = function()
{
window.original_restart();
if (config.macros.BlogLayout.POST_DISPLAY_COUNT != -1)
{
config.macros.BlogLayout.autoRecentTiddlers(); //call this to ensure number of posts is limited
}
if ((config.macros.BlogLayout.AUTO_SUMMARISE_FRONT_PAGE)&&(!window.location.hash))
{
$(document).ready(function() {config.macros.BlogLayout.collapseTiddlers()});
}
}
//$(document).ready(config.macros.BlogLayout.collapseTiddlers());
config.macros.setCollapseHeightHere ={
handler: function(place,macroName,params,wikifier,paramString,tiddler)
{
dontCollapse = params[0];
if (dontCollapse)
{
tiddler.fields['collapseHeight'] = -1;
}
else
{
tiddler.fields['collapseHeight'] = (place.clientHeight > 0)?(place.clientHeight - 4):(place.offsetHeight - 4);
tiddler.fields['collapseHeight'] += "";
}
}
}
config.macros.collapseThisTiddler ={
handler: function(place,macroName,params,wikifier,paramString,tiddler)
{
if ((params[0])&&(!tiddler.fields['collapseHeight']))
{
tiddler.fields['collapseHeight'] = params[0];
}
config.macros.BlogLayout.collapseMe($(story.getTiddler(tiddler.title)));
}
}
config.macros.BlogLayout.collapseRecentByTag = function(tagName,maxPosts,collapsePosts,defaultHeight)
{
this.recentTiddlersByTag(tagName,maxPosts);
if (collapsePosts)
{
this.collapseTiddlers(defaultHeight);
}
}
//params[0] = name of link
//params[1] = tagName
//params[2] = maxPosts
//params[3] = collapse posts. Values are true/false. default is true.
//params[4] = default value for collapsing posts by
config.macros.recentByTagLink ={
handler: function(place,macroName,params,wikifier,paramString,tiddler)
{
//check parameters supplied
var tagName, maxPosts, collapsePosts, linkName,defaultHeight;
tagName = params[1] || config.macros.BlogLayout.POST_TAG_NAME;
maxPosts = params[2] || config.macros.BlogLayout.POST_DISPLAY_COUNT;
collapsePosts = params[3] || (config.macros.BlogLayout.AUTO_SUMMARISE_FRONT_PAGE?1:0);
defaultHeight = params[4] || config.macros.BlogLayout.MAX_HEIGHT;
linkName = params[0] || tagName;
collapse = (collapsePosts == 1)?true:false;
var tagLink = document.createElement("a");
tagLink.href = "javascript:;";
tagLink.onclick = function() {return config.macros.BlogLayout.collapseRecentByTag(tagName,maxPosts,collapse,defaultHeight);};
tagLink.innerHTML = linkName;
$(place).append(tagLink);
}
}
})(jQuery)
config.shadowTiddlers.StylesheetBlogLayout = ".showMorePosts {margin: 5px 5px 20px 5px; cursor: pointer; width: 100%; text-align: center; border: 1px solid #c0c0c0; }\n" +
".readMore {}\n" +
".readMore .button {}";
store.addNotification("StylesheetBlogLayout",refreshStyles);
//}}}
Nr. 22: Fra barn til voksen
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Boanna%20Fr%C3%B8lund.pdf]]
/%
Elev: [[Boanna Stig Frølund]]
!Beskrivelse
[[Blodets Bånd|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FBlodets_b%E5nd.PDF&cidReq=DANSK_001]] en novelle af Vibeke Marx .
!end%/
{{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>>}}}
<data>{"author":"Martha Christensen","bibdata":"1981","wherekept":"Anders Agerlund","primtopic":"Normalitet","":true}</data>
<html><span class="largeheader" style="color: black;">MARTHA CHRISTENSEN</span> (rigtigt navn)<br>Født 12.06.1926 i Holsted, Danmark. Død 03.01.1995.<br><br>Var bosat i Danmark.<br><br>Se mere om forfatteren på: <a href="http://romansiden.dk/content.php?page=author&value=10735">romansiden.dk</a>, <a href="http://www.litteraturpriser.dk/d.asp?type=aut&side=CMarthaChristensen">litteraturpriser.dk</a><br><br><div class="smallheader">Udgivelser</div><ol><li><a href="content.php?page=author&value=10735#book9101">Vær god ved Remond</a>, 1962</li><li><a href="content.php?page=author&value=10735#book9102">Oplevelsen</a>, 1963</li><li><a href="content.php?page=author&value=10735#book9103">Tjørnehækken</a>, 1964</li><li><a href="content.php?page=author&value=10735#book9104">Bænken og andre noveller</a>, 1970</li><li><a href="content.php?page=author&value=10735#book9105">I den skarpe middagssol</a>, 1972</li><li><a href="content.php?page=author&value=10735#book9106">Som de vil ha´ dig : roman</a>, 1974</li><li><a href="content.php?page=author&value=10735#book9107">Vores egen Irene : roman</a>, 1976</li><li><a href="content.php?page=author&value=10735#book9108">En fridag til fru Larsen</a>, 1977</li><li><a href="content.php?page=author&value=10735#book9109">Lille skat</a>, 1977</li><li><a href="content.php?page=author&value=10735#book9110">Og dette skal være vor Ivan til ære...</a>, 1978</li><li><a href="content.php?page=author&value=10735#book9111">Borgmesteren sover : roman</a>, 1979</li><li><a href="content.php?page=author&value=10735#book9112">Briller</a>, 1979</li><li><a href="content.php?page=author&value=10735#book9113">Dragen</a>, 1980</li><li><a href="content.php?page=author&value=10735#book9115">En dag ved stranden</a>, 1981</li><li><a href="content.php?page=author&value=10735#book9114">I gårs fortræd : roman</a>, 1981</li><li><a href="content.php?page=author&value=10735#book9116">Hvis vi elskede mere : noveller</a>, 1982</li><li><a href="content.php?page=author&value=10735#book9117">Kaninen</a>, 1982</li><li><a href="content.php?page=author&value=10735#book9118">Tilskueren</a>, 1982</li><li><a href="content.php?page=author&value=10735#book9119">Den midterste dag : roman</a>, 1983</li><li><a href="content.php?page=author&value=10735#book9121">En far i huset</a>, 1984</li><li><a href="content.php?page=author&value=10735#book9120">Tusindfryd : roman</a>, 1984</li><li><a href="content.php?page=author&value=10735#book9122">Rebekkas roser : roman</a>, 1986</li><li><a href="content.php?page=author&value=10735#book9123">Ungdom og de lyse nætters tid</a>, 1986</li><li><a href="content.php?page=author&value=10735#book9124">Dansen med Regitze</a>, 1987</li><li><a href="content.php?page=author&value=10735#book9125">Sønnen</a>, 1987</li><li><a href="content.php?page=author&value=10735#book9126">Manden som ville ingen ondt : roman</a>, 1989</li><li><a href="content.php?page=author&value=10735#book9127">Høvdingebørn : roman</a>, 1991</li><li><a href="content.php?page=author&value=10735#book9128">Martha Christensen : tekstbog</a>, 1991</li><li><a href="content.php?page=author&value=10735#book9129">Her i nærheden : fortællinger</a>, 1993</li><li><a href="content.php?page=author&value=10735#book9131">Historien om bamsebjørnen og den lille drage</a>, 1995</li><li><a href="content.php?page=author&value=10735#book9130">Når mor kommer hjem : roman</a>, 1995</li><li><a href="content.php?page=author&value=10735#book9132">En lille helt og andre historier</a>, 1996</li><li><a href="content.php?page=author&value=10735#book9133">Glansbilleder - og andre noveller</a>, 1996</li><li><a href="content.php?page=author&value=10735#book9134">Glansbilleder</a>, 1999</li><li><a href="content.php?page=author&value=10735#book9135">Dansen med Regitze ; Her i nærheden ; Når mor kommer hjem : tre romaner</a>, 2001</li><li><a href="content.php?page=author&value=10735#book9136">Stranden rundt</a>, 2002</li><li><a href="content.php?page=author&value=10735#book9137">Ungdom og de lyse nætters tid - og andre noveller</a>, 2004</li></ol></html>
Kilde: [[Martha Christensen|http://bibliografi.dk/content.php?page=author&value=10735]]
Forfatteren skriver indenfor følgende genrer:
Hverdagsliv
Kan du lide denne forfatter skulle du undersøge:
* Helle Helle
[[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>
<!--}}}-->
Nr. 13: Fra barn til voksen
----
/%
Elev: [[Camilla Graff]]
!end
%/
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Camilla%20Graf.pdf]]
/%
!Beskrivelse
[[Drivhuset|http://dl.getdropbox.com/u/1064531/Drivhuset.pdf]] (novelle)
!end
%/
/***
|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;
}
}
//}}}
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Christian%20Asp.pdf]]
/%
Elev: [[Christian Asp]]
!Beskrivelse
[[Et par underbukser|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FEt_par_underbukser.PDF&cidReq=DANSK_001]] Novelle af Dan Turell.
!end
%/
/***
|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;
}
});
//}}}
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #110077
PrimaryMid: #110077
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/***
|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>>
<<forEachTiddler
where
'tiddler.tags.containsAll(["NoteArkiv",context.inTiddler.title])'
sortBy
'tiddler.title.toUpperCase()'
write '"<<siteMap [["+tiddler.title+"]] . sliders$))"'
none '"//ingen \"dagbog\" er lavet endnu//"'
>>
[[Dansk]] m [[MM]] 08/09
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
Niels Christian Thyrrestrup Thomasen
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:''|DeprecatedFunctionsPlugin|
|''Description:''|Support for deprecated functions removed from core|
***/
//{{{
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");
}
//}}}
1. ‘Ebbe Skammelsøn’, folkevise.
Den sørgelige og drabelige beretning om Ebbe Skammelsøn er en middelaldernovelle på vers. Mens Ebbe gør tjeneste ved Kongens hof, lyver hans broder Peder ham død over for hans trolovede, Lucie. Det lykkes forræderen at overtale hende til at tage ham i sin broders sted, men en drøm varsler for Ebbe, at brylluppet skal finde sted. Han vender tilbage, nedslået og hævngerrig, og skønt alle brylluppets deltagere prøver at optræde, som om intet var hændt, er Ebbes følelser for stærke.
Han følger bruden til brudehuset og myrder hende der, hvorefter han opsøger broderen i gildesalen og stikker ham ned. Siden hærger han mere eller mindre fatalt hele sin familie. Som alle noveller bringer også denne en ny erkendelse til gennembrud: ingen konventionel trøst og intet familiært arrangement kan berolige en krænket kærlighed. Den stærke kærlighed og døden bor tæt ved siden af hinanden. Sangen er den første af mange senere folkelige viser om ulykkelig kærlighed og brat død.
http://www.kum.dk/sw34321.asp
Skammel han bor sig nør i Thy,
han er både rig og kåd,
så væne har han sønner fem,
de to fores ilde ad.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Ebbe han tjener i kongens gård
både for guld og ære,
hjemme sidder Peder, hans broder,
han lokker hans hjertenskære.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Hil sidder I, stalten Adelus,
og syr hr. Ebbe klæder!
Ebbe han tjener i kongens gård,
han spotter eder og hæder."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Så grant da kender jeg Ebbe,
og Ebbe kender grant sig:
han spotter ingen stalt jomfru,
halv mindre spotter han mig."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Hør I, stalten Adelus,
vil I være min fæstemø?
det vil jeg for sanden sige:
Ebbe, min broder, er død."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Drukke de det fæstens-øl
end den samme nat,
brylluppet end før månedsdag,
de rådte det i-så brat.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Det var Ebbe Skammelsøn,
han vågned om midjenat,
talte han for sin næste svend
af sin drøm så brat.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Mig tyktes, at min stenstue
stod al i lysen lue,
der brændte inde Peder, min broder,
og så min skønne jomfrue."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Det I tykte, jer stenstue
stod al i brændende glød,
det er: Peder, jer broder,
holder bryllup med jer fæstemø."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Det var Ebbe Skammelsøn,
han bandt sig sværd ved side,
så bad han sig orlov
hjem til sin fader at ride.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Det var Ebbe Skammelsøn,
han kom så vel i lag:
han kom til sin faders gård
en første bryllupsdag.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Ud kom Ebbes søstre to
med guldkar på hviden hånd:
"Velkommen, Ebbe, vor broder,
hjem til vort eget land."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Hør I det, mine søstre to,
hvad jeg spør' eder ad:
hveden er dette møgle folk,
her er samlet i dag?"
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Svared hans yngste søster
udaf så megen nød:
"Det er Peder, din broder,
holder bryllup med din fæstemø."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Sin ene søster gav han guldbrase på bryst,
den anden guldring på hånd:
"Dem havde jeg agtet min fæstemø,
førte dem af fremmed land."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Den ene søster bad ham hjemme være,
den anden bad ham heden ride:
"Tøver du her i denne nat,
det bliver os alle til kvide."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Ebbe han vendte sin ganger omkring,
han ville af gården ride,
hans moder fik i tøjlen og holdt,
hun bad ham hjemme bide.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Hans moder fik ham hynde og stol,
at sidde på de øverste bænke,
hans fader fik ham kande i hånd,
bad, han skulde gå at skænke.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Skænked han den brune mjød
og så den klare vin,
hver sinde han til bruden så,
da randt ham tår' på kind.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Silde om den aften
rimen han faldt på,
det da var den unge brud,
hun skulde til senge gå.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Fulgte de den unge brud
alt til det brudehus,
for går Ebbe Skammelsøn,
han bær' for hende blus.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Ledte han den unge brud
alt ad den højeloftsbro:
"Mindes I det, stalten Adelus
I gav mig eders tro?"
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Al den tro, jeg eder gav,
den har Peder, eders broder,
alle de dage, jeg leve må,
jeg vil eder være for moder."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Jeg loved jer ikke til min moder,
jeg loved jer til min viv!
derfor skal Peder Skammelsøn
lade sit unge liv.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Hør I, stalten Adelus,
I rømmer med mig af lande!
jeg vil slå Peder, min broder, ihjel,
og tåle for eder den vånde."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Slår I Peder, eders broder, ihjel,
siden skal I mig miste!
så må I sørge jer selv til døde
som vilden fugl på kviste."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Det var Ebbe Skammelsøn,
han sit sværd uddrog,
det var stalten Adelus,
han til jorden vog.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Så tog han det blodige sværd
alt under sit skarlagenskind,
så gik han i stenstuen
for Peder, sin broder, ind.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
"Hør du, Peder Skammelsøn,
du tøver alt for længe,
bruden længes fast efter dig
udi sin brudeseng."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Mælte det Peder, hans broder,
svared han alt så brat:
"Så gerne vil jeg dig unde
at sove hos bruden i nat."
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Det var Ebbe Skammelsøn,
han sit sværd uddrog,
det var Peder, hans broder,
han til jorden vog.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
Hans fader gjorde han ilde sår,
hans moder misted en hånd,
fordi træder Ebbe Skammelsøn
så mangen vild sti om land.
- Fordi træder Ebbe Skammelsøn så mangen sti vild.
/***
|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='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='editor' macro='edit text'></div><span macro='autosizeEditor'></span>
<!--}}}-->
/***
|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);
}
}
//}}}
<<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'
write
'(index < 200) ? "|!"+(index+1)+"|[["+tiddler.title+"]]|@@"+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()'
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)+""'
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>
<!--{{{-->
<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>
<div class='tagClear'></div>
<div <span class='menubox' style='float:center;margin:0em'
<div class macro='wikify [img(13em+,)[%1|%0][%1-]] 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" vaerelse'></span></div></div>
<div <span macro='wikify "//@@bgcolor(#99ff33):Trækning:@@//"'</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','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>
<data>{"author":"Paul Kropp","bibdata":"1992","wherekept":"Camilla Graff","primtopic":"Kærlighed"}</data>
Kilde: [[Litteratursiden.dk|http://www.litteratursiden.dk/boeger/ellenel%C3%A9naluna]]
Gymnasiepigen Ellen synes selv, hun er for pæn og kedelig. Gennem en kontaktannonce forsøger hun at finde en spændende fyr, men først ændrer hun sit image med nyt udseende og navn
Udgivet:
1994
Forlag:
[Kbh.] : Gyldendal
Sidetal:
192
<<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:|ExtentTagButtonPlugin|
|Description:|Adds a New tiddler button in the tag drop down|
|Version:|3.2 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
window.onClickTag_mptw_orig = window.onClickTag;
window.onClickTag = function(e) {
window.onClickTag_mptw_orig.apply(this,arguments);
var tag = this.getAttribute("tag");
var title = this.getAttribute("tiddler");
// Thanks Saq, you're a genius :)
var popup = Popup.stack[Popup.stack.length-1].popup;
createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
wikify("<<newTiddler label:'New tiddler' tag:'"+tag+"'>>",createTiddlyElement(popup,"li"));
return false;
}
//}}}
/***
|''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");
//}}}
<<siteMap [[Fag]] . sliders>>
<!--{{{-->
<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> |
<!--{{{-->
<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="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>
<<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:''|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;
}
//}}}
<data>{"author":"Erling Jepsen","wherekept":"Nicholaj Hejsel Vejlgaard","bibdata":"9788721026332 Udgivelsesår \t2005 ","primtopic":"Fra barn til voksen"}</data>
Kilde: [[Litteratursiden.dk|http://www.litteratursiden.dk/anbefalinger/frygtelig-lykkelig-af-erling-jepsen]]
Af Gitte Buur Rasmussen - tor, 27/11/2008 - 22:56
Hvornår siger man "møjn" og hvornår "farvel"? Skal man anmelde en mand for hustruvold? Det er nogle af de store og små spørgsmål, som landbetjenten Robert går og pusler med i den forrygende efterfølger til "Kunsten at græde i kor".
Skoene siger meget om samfundet og personerne i Erling Jepsens nyeste roman, "Frygtelig lykkelig". I Højer i Sønderjylland går man enten i træsko eller gummistøvler. Vælger man gummistøvler, skal de helst være grønne, ellers er man lidt ved siden af. Og går man i højhælede sko, skal man ikke regne med at blive en del af samfundet ... nogensinde.
Robert er politimand i København, men har svært ved at klare mosten. Hver gang der er bud efter ham i en tilspidset situation, får han en frygtelig trang til at skulle på toilettet. Robert bliver forflyttet til Højer, hvor han skal være landbetjent. Umiddelbart en let opgave, men det viser sig, at der findes flere uskrevne regler, end der findes love.
I Højer lægger Robert ud med at købe sig et par blå gummistøvler. Han siger "Møjn", når de andre siger farvel - og omvendt. Men langsomt lærer han sig de uskrevne regler. Til slut mestrer han at slippe en vind på den rigtige måde, inden han forlader kroen.
Han falder for byens skønhed, Ingerlise, som er gift med Jørgen - byens selvudråbte sherif. Ingerlise øjner et håb i Robert, da hun regner med, at han kan redde hende fra hendes voldelige mand. Men sådan kommer det slet, slet ikke til at gå ...
Erling Jepsen kan bare det der med at fortælle en grum og barsk historie med en sort og underspillet humor, som bare er SÅ fin. Det beviste han i "Kunsten at græde i kor", og det slår han fast i "Frygtelig lykkelig".
Det er socialrealisme - på den nye måde - når den er bedst. Og i socialrealismen har han blandet lidt magisk realisme i form af en grotesk slutscene, hvor man leder efter et lig i mosen. Der dukker mange lig op, men da det ikke er det rigtige, propper man dem bare ned igen - for ikke at rippe op i gamle sager. Stort!
Borgen, 2004. 230 sider
/***
|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();
}
//}}}
Gå til [[siden for at skrive ud|http://www2.kb.dk/elib/lit//dan/andersen/eventyr.dsl/hcaev001.htm]]
<html><div align="center"><iframe src="http://www2.kb.dk/elib/lit//dan/andersen/eventyr.dsl/hcaev001.htm" frameborder="0" width="100%" height="600"></iframe></div></html>
@@font-size:10pt;<script label="genopfrisk">
story.forEachTiddler(function(t,e)
{story.refreshTiddler(t,null,true)});
refreshDisplay();
return false;
</script>@@
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]].
<data>{"author":"Sara Blædel","bibdata":" ISBN: 9788759523643 Udgivelsesår 2005 ","wherekept":"Christian Asp","primtopic":"Unge og kriminalitet"}</data>
Af Malene Munk - tor, 27/11/2008 - 22:56
Anbefalet bog:
"Grønt støv" af Sara Blædel
Grønt støv
Kriminalroman. Kriminalassistent Louise Rick bliver sat på to sager, et mord på en ung pige og mordene på to kriminalreportere, som synes at have noget at gøre med narkomiljøet.
Originaludgave: 2004
Udgivet:
2004
Forlag:
[Kbh.] : Lindhardt og Ringhof
Sidetal:
345
Denne velfortalte krimi har to kvinder i hovedrollerne, en kriminalbetjent og en journalist. Uden hårdtslående action lykkes det forfatteren at skabe en spændende cocktail af mord, opklaringsarbejde og venindeforhold.
Da en sygeplejerske og en journalist myrdes næsten samtidigt, bliver der travlhed i drabsafdelingen ved Københavns politi. Muligvis har begge mord noget med narko at gøre, men er det mon den samme morder, der er på spil?
Kriminalassistent Louise Rick bliver sat på sagen om den myrdede sygeplejerske, hvor der ikke er mange spor at gå efter. Vi følger arbejdet med opklaringen, afhøringerne og Louises besøg hos den myrdedes familie.
Mordet på journalisten har straks en meget større bevågenhed hos medierne, og Louises gode veninde, Camilla Lind, kendte den afdøde. Camilla er kriminalreporter ved et dagblad og kæmper for de gode nyheder til avisens forside. Hun er en type, der tilsidesætter alt, når først hun har fået en idé. Hun overhører Louises advarsler om at være forsigtig og begiver sig ud i selv at efterforske drabet på journalistkollegaen. Endnu et mord finder sted, og Louise har mere end travlt med opklaringsarbejdet, da Camilla i sin iver efter at komme til bunds i sagen sætter sit liv på spil.
”Grønt støv” er en rigtig sympatisk femi-krimi, hvor de to veninders indbyrdes forhold fylder lige så meget i romanen som selve krimiplottet. Der er en meget snakkende krimi, hvor der hverken er tju-bang eller de store blodsudgydelser, men til gengæld kommer man hurtigt til at holde af Louise, der slås med de samme problemer omkring parforhold og karriere, som mange andre unge kvinder i 30’erne. Politiarbejdet beskrives grundigt, og selve spændingen i bogen bygges meget langsomt op, mod et godt udtænkt plot. En oplagt roman til læsere, der kan lide Liza Marklunds og Elsebeth Egholms krimier.
Lindhardt og Ringhof, 2004. 345 sider.
[[Link til Wordudgave|http://dl.getdropbox.com/u/1064531/Guide%20til%20Synopsepr%C3%B8ven%20i%20mundtlig%20dansk.doc]]
+++[Alternative præsentationer]<<tiddler [[PrøveformernePræsentationer]]>>===
<html><div align="center"><iframe src="http://dl.getdropbox.com/u/1064531/Guide%20til%20Synopsepr%C3%B8ven%20i%20mundtlig%20dansk%20HU%2009.pdf" frameborder="0" width="100%" height="600"></iframe></div></html>
/***
|Name|HTMLFormattingPlugin|
|Source|http://www.TiddlyTools.com/#HTMLFormattingPlugin|
|Documentation|http://www.TiddlyTools.com/#HTMLFormattingPluginInfo|
|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|'HTML' formatter|
|Description|embed wiki syntax formatting inside of HTML content|
The ~HTMLFormatting plugin allows you to ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.
!!!!!Documentation
>see [[HTMLFormattingPluginInfo]]
!!!!!Revisions
<<<
2008.10.02 [2.3.0] added use of {{{<nowiki>}}} marker to bypass all wikification inside a specific HTML block
2008.09.19 [2.2.0] in wikifyTextNodes(), don't wikify the contents of STYLE nodes (thanks to MorrisGray for bug report)
| 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: 3, revision: 0, date: new Date(2008,10,2)};
// 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.nextMatch = this.lookaheadRegExp.lastIndex; // continue parsing
}
}
}
// wikify #text nodes that remain after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode)
{
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);
break;
default:
for (var i=0;i<theNode.childNodes.length;i++)
wikifyTextNodes(theNode.childNodes.item(i)); // 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>
Kilde: http://www.hannevibekeholst.dk/default.asp?mainmenu=2
Louise-trilogien (Gyldendal, 1999)
De tre romaner om Louise udkom med "Til sommer" som den første, herefter fulgte "Nattens kys" og til sidst kom "Hjertets renhed". Bøgerne er udgivet samlet som "Louise-trilogien".
Hjertets renhed (Gyldendal,1990)
Louise er flyttet sammen med sin gamle kæreste Anders. Det er trygt, men den idylliske tosomhed virker kvælende på hende. Hun lider af udlængsel og længes efter eventyret - og efter den fascinerende Jesper.
<data>{"wherekept":"Anna Agger Rasmussen","author":"Hanne Vibeke Holst","bibdata":"ISBN 9788702063172 Udgivelsesår 2007 ","primtopic":"Frihed"}</data>
!<<siteMap {{tiddler.title}} . sliders>>
Do you like ''~No-Brainer Notes''? If so, here's how you can help us:
* [[Visit our site|http://www.giffmex.org]]
* [[Learn about the missions agency we belong to, CRWM|http://www.crcna.org/pages/crwm.cfm]]
* [[Donate to CRWM|http://www.crcna.org/pages/crwm_donate_online.cfm]]
* [[Our Amazon wishlist|https://www.amazon.com/gp/registry/wishlist/1OTJM9IE7SPVS/ref=wl_web/]]
* PayPal for our site:<html><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input name="cmd" type="hidden" value="_s-xclick" /> <input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" type="image" /><img src="https://www.paypal.com/en_US/i/scr/pixel.gif" border="0" alt="" width="1" height="1" />
<input name="encrypted" type="hidden" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCDOphPrfxixGLSFLAVYRgOAIIMNkhG/fVpBpfPkFZ+/otUKEu2UHrY0szrTCsf73EmPs1hEqXAevosf4f3wmMQGaQ/+dxpooMXJJjv4Y2b74SuehERvjBeBrIOJ6eVVJyTRqTYVACX48cdtp9K8u/qFPEf389dSFw79O0qSSw2YDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIvazyO9DMtDGAgaCV7RZqlbC45beBnYKwrZ/t12EFK0DQViCLvSD1OMX0VNiCuXK2lxtlpTzi0ZujHXrRjPZg6zZc5dMsL//Ervy+zUBl6jpsQg5UxqponKYcNnWXjErastgJdYP3Yy5l95L1MwsHnxzhvANg3cIuYhVOsvDNxc933cEdwMSBKI2Q9Kg6oixC49A6FTYW/Xgp2xfdINr7ema6Vgk9V3pge1xjoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDgwMzIzMTU0MDU4WjAjBgkqhkiG9w0BCQQxFgQUN7zDTYDrAL6cj3fOJ2lKbzKgmcIwDQYJKoZIhvcNAQEBBQAEgYAsUnYV6vvQecisJkhmmfNmG2xemtFm7FfXCJZe+5sNDBiIgy/By44dLPor/j3KAmFsH27u4ORRVGgaYkG0/0Ga7ch1AZaMNCnrXQ8Yw6//ltBN+DPl7RWQ3hbgcPwbVarqkNM67LQ/Scfb22CKMAnKt4vjIeaWAnPySHVsYcqcpg==-----END PKCS7-----" /></form></html>
/***
|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;
};
}
//}}}
|sortable|k
|>| !<<wikify %0 title@here>> | !@@bgcolor(#ffff00):Mere her:@@ [[Om bøger|Bøger&Artikler]] | !{{tuduSlider{<<slider chkBookSummary Bibliografi 'Bibliografi »'>>}}} |h
|Elev|Bogtitel|Udgivelsesår|Forfatter|h
|[[Anders Agerlund]]|[[Bænken og andre noveller]]|1981|Martha Christensen|
|[[Anders Rahbek Hansen]]|[[Mord i San Francisco]]|1990|Dan Turell|
|[[Anna Agger Rasmussen]]|[[Hjertets renhed fra Louise trilogien]]|1990|Hanne Vibeke Holst|
|[[Anne Bach Sørensen]]|[[Intet]]|2000|Janne Teller|
|[[Anne Sofie Palm Hansen]]|[[Stilhedens hav]]|2000|Søren Jessen|
|[[Boanna Stig Frølund]]|[[Adams fest]]|2000|Martin Petersen|
|[[Camilla Graff]]|[[Ellen/Eléna/Luna]]|1992|Paul Kropp|
|[[Christian Asp]]|[[Grønt støv]]|2004|Sara Blædel|
|[[Jeanette Bach Andreasen]]|[[Kamæleonen]]|1999|Jane Aamund|
|[[Kasper Hasselkvist]]|[[Afgrundens rand]]|2007|Christian Dorph & Simon Pasternak|
|[[Kathrine Østergaard Petersen]]|[[1-2-3-NU!]]|DL 2001|Jesper Wung-Sun|
|[[Line Domino]]|[[Kun ét liv]]|2007|Sara Blædel|
|[[Mathias Damgaard-Iversen]]|[[På broen]]|Borgen 1981|Benny Andersen|
|[[Mathias Bülow Kastbjerg]]|[[Sortekrogen]]|Modtryk 1989|Anders Johansen|
|[[Nicholaj Hejsel Vejlgaard]]|[[Frygtelig lykkelig]]|2005|Erling Jepsen|
|[[Niels Christian Thyrrestrup Thomasen]]|[[Nordkraft]]|2002|Jakob Ejersbo|
|[[Patrick Rolff]]|[[Limes billede]]|1998|Leif davidsen|
|[[Simon Staunsbæk]]|[[Personskade]]|Gyldendal 2005|Elsebeth egholm|
|[[Simone Madsen]]|[[Zehra og Martin]]|Gyldendal 2005|Hanne Åxman Christensen|
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.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||
|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
<<<
2008.03.03 [1.9.2] corrected declaration of wikifyPlainText() for 'TW 2.1.x compatibility fallback' (fixes Safari "parse error")
2008.02.23 [1.9.1] in onclick function, use string instead of array for 'bufferedHTML' attribute on link element (fixes IE errors)
2008.02.21 [1.9.0] 'onclick' scripts now allow returned text (or document.write() calls) to be wikified into a span that immediately follows the onclick link. Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed). Thanks to Xavier Verges for suggestion and preliminary code.
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.inlineJavascript= {major: 1, minor: 9, revision: 2, date: new Date(2008,3,3)};
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) { // load a script library
// make script tag, set src, add to body to execute, then remove for cleanup
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // there is script code
if (show) // show inline script code in tiddler output
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create a link to an 'onclick' script
// add a link, define click handler, save code in link (pass 'place'), set link attributes
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place){"+fixup+"\n};_out(this);"
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 inline script code
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var code="function _out(place){"+fixup+"\n};_out(w.output);"
try { var out=eval(code); } catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // 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();
}
//}}}
Simple Noter er en fuldstændig enkel måde at tage og organisere noter. Dave Gifford lavede den til sine seminarieelever, og har gjort den tilgængelig for alle. (MM har oversat og tilføjet nogle ekstra plugins.red) Originalen kan ses [[her.|http://www.giffmex.org/nobrainernotes.html]]
!Hvordan bruger man Simple Noter:
<<slideShow>>
/%
[[Kom i gang]]
[[Instruktioner]]
[[Grundlæggende tilpasning]]
[[Avanceret tilpasning]]
[[Opret en hjemmeside på TiddlySpot]]
%/
#''Notatteknik i SN'': i en nøddeskal, du laver noter som hører til emner og underemner, og finder dem hurtigt igen, enten med søgefunktionen, eller via Emne indekset, som opdateres automatisk.
##''Fra top til bund metoden:'' Klik på 'Nyt hovedemne' øverst //(kan ses i den udgave af SN du har gemt til din pc)// og følg de instruktioner som gives. 'Emne' indekset til venstre vil automatisk tilføje emner og noter til Emne indekset. Klik på 'genopfrisk' knappen for at se de nye tilføjelser til menuen. Klik på pilene (►) for at åbne forskellige niveauer i indekset.
##''Fra bunden og op metoden'': Klik på 'Ny note' foroven //(kan ses i den udgave af SN du har gemt til din pc)// og følg de instruktioner , der gives om at lave en note og arbejd dig op ad emne- og underemnekæden.
#''Navigation i SN'': Der er fire måder at navigere igennem Simple Noter:
##Søg efter en note gennem søgevinduet.
##Se dine noter igennem via Emne indekset til venstre.
##Gennemse fanerne for dine åbne tiddlere.
##Åben sidepanelet for at se lister over noter efter titel, dato ændret og efter tags.
#''Formatering i Simple Noter''
##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.
!Hvordan man downloader Simple Noter:
Du kan downloade lige så mange kopier af Simple Noter som du ønsker, gratis.
# [[Klik her|http://simplenoter.tiddlyspot.com/download]] og vælg //gem// eller hent den originale 'No-brainerNotes' [[højreklik her|http://www.giffmex.org/nobrainernotes.html]] og vælg 'Gem linkmål som', 'Gem link som', eller lignende. Giv din fil et nyt filnavn og læg den hvor du vil.
#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 Simple Noter-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]]
*[[Avanceret 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);};})();}
// %/
<data>{"author":"Janne Teller","wherekept":"Anne Bach Sørensen","bibdata":"2000","primtopic":"Fra barn til voksen"}</data>
"Intet" er på bare 126 sider. Det er en velovervejet historie om ingenting og betydningsfuldhed, og hvad man skal gøre ved det. Handlingen eskalerer til det ubærlige. Emnet er for stort til føleri." (Steffen Larsen i Børn og Bøger, 2/2002)
Det er en roman om betydning. Om livet og hvad der er værd i livet. Det er en roman der kan læses af børn fra 12 år og op og også gerne af deres forældre. Det er altså en børnebog om meningen med livet. Og meget mere.
Det er også allerede en berømt børnebog. Den er blevet tildelt kulturministeriets børnebogspris for 2001.
Bogen egner sig til fælleslæsning i 7. - 9. (10. klasse).
<data>{"author":"Svend Aage Madsen","bibdata":"ISBN-10:8777042344 ISBN-13:9788777042348","primtopic":"Forfølgelse","wherekept":"DanA3","":false}</data>
Se [[GymnasieElevRapportHentetFraStudiePortalen.Dk|http://dl.getdropbox.com/u/1064531/gymnasiebograpportfrastudieportalen.pdf]]
eller
Kilde for anmeldelsen her under: [[Næsten lærer|http://www.kdassem.dk/skoleblad/marts/8.htm]]
Boganmeldelse
Bogen er opdelt i to selvstændige historier, der kører parallelt. Personerne i begge historier har samme navne i begge dele af bogen. Det centrale i begge historier er en høj arbejdsløshed og samfundets forskellige måder at gribe problemet an på.
Historie 1: De arbejdsløse er jaget vildt. Det er muligt for arbejdere at købe licens til at skyde arbejdsløse, som i bogen bliver kaldet for ’harer’, da man ikke kan sige at det at blive jaget hver dag, er at være arbejdsløs. Jagten foregår under ordnede forhold, på samme måde som med vildt. Jagten må kun foregå på bestemte tidspunkter af døgnet.
Historie 2: Børn bliver fra fødslen udstyret med et tilfældigt nummer der afgør om de skal arbejde hele livet eller om de skal have fri til at udvikle sig selv. Tanken bag systemet er at arbejdsløshed, i sig selv ikke er et onde, men det er et nederlag for de arbejdsløse, som har taget en lang uddannelse som de i sidste ende ikke får brug for. De som får ’frinummer’ kan selv bestemme hvad de vil lave mht. uddannelse og projekter, mens de der har trukket ’arbejdsnummer’ bliver skolet til ét bestemt job for resten af livet. De arbejdende ser tit med misundelse på frinumrene, da de har tid til at realisere sig selv.
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Jeanette%20B%20Andreasen.pdf]]
/%
Elev: [[Jeanette Bach Andreasen]]
!Beskrivelse
[[Louises dobbeltliv|http://dl.getdropbox.com/u/1064531/Louises%20dobbeltliv.pdf]]
Interview/Novelle fra ”Ingen må vide det” ISBN: 978-87-92031-71-6
!end
%/
<data>{"author":"Jane Aamund","bibdata":"1999","wherekept":"Jeanette Bach Andreasen","primtopic":"Kærlighed"}</data>
Dansk, Prøveform B
Mundtlig, Bundne prøvefag Karakter Betegnelse Beskrivelse
- 12 -
Fremragende
Elevens præsentation viser en tydelig og overbevisende indsigt i prøveoplæggets
indhold – og i sammenhængen mellem oplæg og fordybelsesområde.
Fortolkningen er særdeles velbegrundet med præcise, analytiske iagttagelser
og viser indsigt i sammenhængen mellem sprog, indhold og genre.
De danskfaglige tilgange er meget velvalgte og velbegrundede, og elevens
vurdering af oplægget er yderst velbegrundet.
Perspektiveringen til danskfaglige områder fra opgivelserne og til andre
tekster og udtryksformer begrundes sikkert og alsidigt med forskellige
faglige argumenter.
Disponeringen af præsentationen er velvalgt, klar og meget hensigtsmæssig.
Formulering og artikulation er klar og tydelig, og sproget er sikkert,
forståeligt og klart.
Dialogen om det danskfaglige stof viser indsigt i faget, opmærksomhed
og velovervejede svar.
Oplæsningen er tydelig og velartikuleret med særligt blik for tekstens
genre og indhold.
Der kan forekomme få uvæsentlige mangler.
Sagsnr.: 019.963.011
- 7 -
God
Elevens præsentation viser god indsigt i hovedindholdet og dets væsentlige
elementer. Der præsenteres en god sammenhæng mellem prøveoplæg
og fordybelsesområde.
Analyse og fortolkning viser en god indsigt i sammenhængen mellem
sprog, indhold og genre og begrundes med forskellige iagttagelser i
oplægget.
Brugen af danskfaglige tilgange er hensigtsmæssig, og elevens vurdering
af oplægget er velbegrundet.
Perspektiveringen til danskfaglige områder fra opgivelserne og til andre
tekster og udtryksformer begrundes med faglige argumenter.
Præsentationen er klart disponeret og begrundet.
Formulering og artikulation er klar og tydelig, og sproget er forståeligt
og i overvejende grad klart.
Dialogen om det danskfaglige stof afspejler et rimeligt overblik over
faget, og viser færdighed i at lytte opmærksomt.
Oplæsningen er klar og forståelig og med tilfredsstillende blik for tekstens
genre og indhold.
Der mangler sikkerhed i en del færdigheder.
- 02 -
Tilstrækkelig
Elevens præsentation viser i begrænset grad indsigt i hovedindholdet
og dets væsentlige elementer. Sammenhængen til fordybelsesområdet
er ikke klar.
Analyse og fortolkning er usikker, og indsigten i sammenhængen mellem
sprog, indhold og genre er mangelfuld.
Brugen af danskfaglige tilgange er tilfældig og usikker, og elevens vurdering
af oplægget er kort og uklart begrundet.
Perspektiveringen til danskfaglige områder fra opgivelserne og til andre
tekster og udtryksformer er mangelfuld og usikker.
Præsentationen mangler disponering. Formulering og artikulation kan
være uklar og utydelig
Sproget er nogenlunde forståeligt og klart.
Oplæsningen er usikker og mangler blik for tekstens genre og indhold.
Dialogen om danskfagligt stof er præget af tilfældige svar på spørgsmål
Der forekommer væsentlige mangler i danskfaglige færdigheder.
Nr. 11: Eventyr, HC. Andersen
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Kasper%20Hasselkvist.pdf]]
/%
Elev: [[Kasper Hasselkvist]]
!Beskrivelse
[[Lille Claus & storeClaus|http://dl.getdropbox.com/u/1064531/Kasper%20Hasselkvist%20-Store%20Claus%20og%20lille%20Claus.pdf]] eller her [[Lille Claus og store Claus]]
HC Andersen
!end
%/
Nr. 19: Unge og kriminalitet, artikel
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Kathrine%20%C3%98stergaard%20Petersen.pdf]]
/%
Elev: [[Kathrine Østergaard Petersen]]
!Beskrivelse
[[Tøser tæskede Nana|http://files.getdropbox.com/u/1064531/T%C3%B8ser%20t%C3%A6skede%20Nana.pdf]] (Artikel - Nordjyske stifttidende)
!end
%/
<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://simplenoter.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[startop]]}}} syntaksen inkluderer automatisk alle tiddlere som er tagget med <<tag startop>>(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 startop>>tagget på disse tiddlere, i stedet for, hver gang, at skulle redigere [[OpstartsTiddlere|DefaultTiddlers]] manuelt. NB! Tiddlere tagget med startop bliver IKKE opdateret med kommandoen "hjem". der kræves en "rigtig" opdatering af siden (F5).
}}}}}}
# 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 ~SimpleNoter som hjemmeside, læs her:
[[Opret en hjemmeside på TiddlySpot]]
pr telefon: +45 25344884
pr mail: [[mama snabela himmerlands-ungdomsskole punktum dk|mailto:"mama@himmerlands-ungdomsskole.dk"]]
pr skrift: Elevvej 11 / 9600 / Aars
pr visit: Elevvej 11 / 9600 / Aars
<data>{"author":"Sara Blædel","bibdata":"2007","wherekept":"Line Domino","primtopic":"Forfølgelse"}</data>
Kilde: [[Litteratursiden.dk|http://www.litteratursiden.dk/anbefalinger/kun-%C3%A9t-liv-af-sara-bl%C3%A6del]]
En rigtig hygge-krimi og en fin behandling af det potentielt springfarlige emne æresdrab. Helt i tråd med Sara Blædels tidligere krimier om kriminalassistent Louise Rick. Som med Sara Blædels tidligere krimier om Louise Rick og hendes emsige journalistveninde Camilla Lind blev jeg straks draget mod den lækre forside – jeg kan godt lide det strømlinede layout, der er ens og dog forskelligt fra gang til gang.
Med eller uden lækker forside er jeg dog ikke i tvivl om, at "Kun ét liv" bliver en succes – den lever op til de tidligere bøger i serien. Det er skrevet gedigent, uden de store krummelurer og spændingen er intakt fra side et. Jeg kedede mig ikke et øjeblik undervejs, og min hund nåede at blive ganske frustreret, inden jeg kom ud på en søndagseftermiddagstur med den, fordi jeg lige skulle læse næste kapitel – kapitlerne i bogen er nemlig forførende korte, så man hele tiden tænker "jeg kan godt lige nå et kapitel mere …".
Scenariet er denne gang henlagt til Holbæk, hvor mordet på en ung kvinde af anden etnisk afstamning mystificerer politiet og sætter sindene i kog på dele af lokalbefolkningen. Rejseholdet involveres og på grund af sin erfaring med forbrydelser mod unge piger i ikke-danske miljøer udlånes Louise Rick til Rejseholdet og arriverer således i Holbæk.
Mistanken falder hurtigt på familien både i efterforskningen og hos de lokale, men de fysiske beviser er ikke til stede, så sagen kræver fingerspitzgefühl og kendskab til andre kulturer, hvilket Louise Rick besidder i fuldt mål.
Camilla er i byen for at dække historien til avisen og engagerer sig intenst og personligt i den dræbtes og hendes families tragiske historie. Camillas karakter er i høj grad med til at nuancere historien, der ellers let kunne blive ensidig i sin fremstilling af debatten omkring æresdrab og familieliv indenfor de muslimskfunderede kulturer. Men det synes jeg ikke den gør, hvilket jeg faktisk var meget spændt på om den ville, så stor cadeau til forfatteren for det!
En stilsikker vinder i femi-krimigenren, men jeg må også tilstå at ”Kun ét liv” efter endt læsning ikke er en bog, der vil stå printet på min nethinde – hurtigt ind og hurtigt ud. Sådan har jeg også haft det med Sara Blædels tidligere i genren, så den levede også helt op til mine forventninger her.
Lindhardt og Ringhof, 2007. 351 sider.
<<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//"'
>>
Gå til [[siden for at skrive ud|http://www2.kb.dk/elib/lit//dan/andersen/eventyr.dsl/hcaev002.htm]]
<html><div align="center"><iframe src="http://www2.kb.dk/elib/lit//dan/andersen/eventyr.dsl/hcaev002.htm" frameborder="0" width="100%" height="600"></iframe></div></html>
<data>{"author":"Leif Davidsen","bibdata":"1998","wherekept":"Patrick Rolff","primtopic":"Krimi"}</data>
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Line%20Domino.pdf]]
/%
Elev: [[Line Domino]]
!Beskrivelse
[[PinUp|http://dl.getdropbox.com/u/1064531/Pin%20Up.mpg]] (kortfilm)
!end
%/
<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.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||
|Description|set tiddler fields by selecting enumerated values from a listbox or droplist|
The {{{<<select>>}}} macro allows you to set tiddler field values by selecting pre-configured enumerated values from a listbox/droplist control.
!!!!!Documentation
>see [[ListboxPluginInfo]]
!!!!!Revisions
<<<
2008.07.22 [1.1.0] added "=cookiename" syntax for storing selected value in cookie instead of a tiddler field
|please see [[ListboxPluginInfo]] for additional revision details|
2007.05.12 [0.5.0] started
<<<
!!!!!Code
***/
//{{{
version.extensions.ListboxPlugin= {major: 1, minor: 1, revision: 0, date: new Date(2008,7,22)};
config.macros.select = {
tooltip: "select a value for %0@%1",
blankTooltip: "set %0@%1=[null] (delete field value)",
valueTooltip: "set %0@%1=%2",
otherLabel: "other",
otherTooltip: "set %0@%1=[???] (enter custom 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) {
// get containing tiddler (or use default "SiteFields" catch-all tiddler)
var here=story.findContainingTiddler(place);
var targetID=here?here.getAttribute("tiddler"):this.defaultTarget;
// get field name
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); // switch to different target tiddler
field=field.substr(0,pos);
}
// if no field name, do nothing
if(!field || !field.length) return;
// if field starts with "=", it is an option cookie instead of a tiddler field
if (field.substr(0,1)=="=") targetID="(system)";
var p=params.shift();
var rows="0"; if (p.substr(0,5)=="rows:") { rows=p.substr(5); p=params.shift(); } // optional list height in lines
var width="auto"; if (p.substr(0,6)=="width:") { width=p.substr(6); p=params.shift(); } // optional CSS width
var autosave=(p.toLowerCase()=="autosave"); if (autosave) p=params.shift(); // optional autosave
var allowBlank=(p.toLowerCase()=="allowblank"); if (allowBlank) p=params.shift(); // add optional empty item
var allowOther=(p.toLowerCase()=="allowother"); if (allowOther) p=params.shift(); // add optional "other: ____" item
if (tiddler && !story.isDirty(tiddler.title)) autosave=true; // if tiddler is in VIEW mode, force autosave
var list=[];
if (p.substr(0,1)=="+"||p.substr(0,1)=="*") { // get list from HR-separated tiddler (* means wikify source first)
var listsrc=p.substr(1);
var listtxt=store.getTiddlerText(listsrc);
var wikifyData=p.substr(0,1)=="*"; if (wikifyData) listtxt=this.getWikifiedData(listtxt);
var separator="\n";
if (listtxt && listtxt.indexOf("\n----\n")!=-1) separator="\n----\n";
if (listtxt && listtxt.length) var list=listtxt.split(separator);
var allowEdit=(params[0] && params[0].toLowerCase()=="allowedit"); // add optional "edit list..." item
if (allowEdit) p=params.shift();
}
else if (p.substr(0,1)=="=") { // get list from tagged tiddlers
var tids=store.getTaggedTiddlers(p.substr(1));
for (var t=0; t<tids.length; t++) list.push(tids[t].title);
}
else { // get list from macro params: "value value value ..." or "label=value label=value label=value ..."
while (p) {
var parts=p.split("=");
var label=parts[0]; var v=parts[1]?parts[1]:parts[0];
list.push(label+"="+v);
p=params.shift();
}
}
// register notification handler for ALL tiddler changes (to sync lists)
store.addNotification(null,this.refresh);
// render the control
this.render(createTiddlyElement(place,"span"), null, targetID, field, list, listsrc, wikifyData, rows, width, autosave, allowBlank, allowOther, allowEdit);
},
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) {
var lists=document.getElementsByTagName("select");
for (i=0; i<lists.length; i++) {
if (lists[i].getAttribute("listsrc")==title) {
var here=lists[i];
var place=here.parentNode;
var targetID=here.getAttribute("tiddler");
var field=here.getAttribute("edit");
var listsrc=here.getAttribute("listsrc");
var rows=here.getAttribute("rows");
var width=here.getAttribute("width");
var autosave=here.getAttribute("autosave")=="true";
var allowBlank=here.getAttribute("allowBlank")=="true";
var allowOther=here.getAttribute("allowOther")=="true";
var allowEdit=here.getAttribute("allowEdit")=="true";
var wikifyData=here.getAttribute("wikifyData")=="true";
// get the list
var listtxt=store.getTiddlerText(listsrc,""); if (wikifyData) listtxt=config.macros.select.getWikifiedData(listtxt);
var separator="\n"; if (listtxt && listtxt.indexOf("\n----\n")!=-1) separator="\n----\n";
var list=[]; if (listtxt && listtxt.length) var list=listtxt.split(separator);
// re-render control
config.macros.select.render(place, here, targetID, field, list, listsrc, wikifyData, rows, width, autosave, allowBlank, allowOther, allowEdit);
}
}
},
render:
function (place, here, targetID, field, list, listsrc, wikifyData, rows, width, autosave, allowBlank, allowOther, allowEdit) {
// use selected value from existing listbox (except for "edit list..." item)
if (here && here.selectedIndex!=-1 && here.options[here.selectedIndex].text!=config.macros.select.editLabel)
{ var val=here.value; if (val && !val.length) val=undefined; }
// if listbox doesn't yet exist, or 'edit list' item was selected, use existing value from field (if any)
if (!val) var val=(field.substr(0,1)=='=')?
config.options[field.substr(1)]:store.getValue(targetID,field);
var count=0; var options="";
// add default 'undefined' item
if (val==undefined || allowBlank) {
var title=this.blankTooltip.format([field,targetID]);
options+='<option value="" title="'+title+'"></option>';
count++;
}
// add enumerated items
var isOther=(val!=undefined);
for (opt=0; opt<list.length; opt++) {
var lines=list[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]);
options+='<option value="'+v+'" '+(val==v?'selected':'')+' title="'+title+'">'+label+'</option>';
if (val==v) isOther=false; // found matching value in list
count++;
}
// add other... item
if (isOther||allowOther) {
var label="other"+(isOther?(": "+val):"...");
var v=isOther?val:"";
var title=this.otherTooltip.format([field,targetID]);
options+='<option value="'+v+'" '+(isOther?'selected':'')+' title="'+title+'">'+label+'</option>';
count++;
}
// add edit list... item
if (listsrc && (!store.getTiddlerText(listsrc) || allowEdit)) {
var title=this.editTooltip.format([field,listsrc]);
options+='<option value="'+listsrc+'" title="'+title+'">'+this.editLabel+'</option>';
count++;
}
// construct full HTML
var html='<select ';
html+=(val!=undefined?'value="'+val+'" ':'')+'" edit="'+field+'" ';
html+='onclick="return config.macros.select.onClick(this,event)" ';
html+='onchange="return config.macros.select.onChange(this,event)" ';
html+='ondblclick="return false" ';
html+='autosave="'+autosave+'" allowBlank="'+allowBlank+'" ';
html+='allowOther="'+allowOther+'" allowEdit="'+allowEdit+'" ';
html+='rows="'+rows+'" size="'+(rows!=0?rows:count)+'" ';
html+='tiddler="'+targetID+'" '+'" listsrc="'+listsrc+'" wikifyData="'+wikifyData+'" ';
html+='title="'+this.tooltip.format([field,targetID])+'" style="width:'+width+'">'+options+'</select>';
// pass to browser for rendering
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;
}
// if tiddler doesn't exist, create it...
if (!store.tiddlerExists(tid)) store.saveTiddler(tid,tid,"",config.options.txtUserName,new Date(),[]);
// set the field value in the target tiddler
store.setValue(tid,field,here.value.length?here.value:null); // if value is blank, delete field
// touch target tiddler so that modified and modifier are updated
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) // tell user what happened
{ clearMessage(); displayMessage(config.macros.select.changeMsg.format([field,tid,here.value])); }
}
}
//}}}
<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
<<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+"]] | <<tag "+tiddler.fields["k-gruppe"]+" \>\> | <<tag "+tiddler.fields["gang"]+" \>\> | [["+tiddler.fields["kl"] +"]] | ||[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"
+"|!#| !<<wikify [img(7em+,)[%1|%0][%1]] billede@here fuldenavn@here \>\> |!<<tag Lærere K-grp \>\> |!<<tag GangOversigt Gang \>\>|!<<tag Kl \>\> |>|!|!<<tag Fag \>\>:| !<<tiddler LaererensFag \>\>|!@@color(#cc0000):Trækning@@ |h\n"'
end 'count+" elever\n"' none '"ingen elever \n"'>>
<<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>
<<snapshot print label:Udskrift prompt:Udskriv id:viewer>><<forEachTiddler where 'tiddler.tags.contains("Lærere") && tiddler.fields["fuldenavn"]&& tiddler.fields["billede"] '
sortBy 'tiddler.fields["title"]'
write
'(index < 30)? "| "+(index+1)+"|<<tag "+tiddler.title+" \>\> |[["+tiddler.fields["fuldenavn"]+"|"+tiddler.title+"]] | [img(3em+,)["+tiddler.fields["fuldenavn"]+"|"+store.getValue(tiddler,"billede")+"]["+tiddler.title+"]] |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>| !<<tag Lærere K-gruppeLærere \>\> |h\n"
+"|!#| <<tag Lærere Init \>\> | fulde navn ||h\n"'
end 'count+" stk Lærere\n"' none '"Ingen Lærere\n"'>>
{{textcenter{
@@padding-left:1.2em;+++[Felter]...<br><<tiddler 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'>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 class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'> </span><span macro='email to:{{tiddler.fields.email}} permalink:"true"'></span></div>
<div macro="hideWhenTaggedAny noTitle">
<div <span class='title'><span macro='view title'></span></div>
<td
</span><span class='subtitle'><span style='white-space:nowrap' macro='view modified date [[DDD, DDe MMM YYYY]]'></div></span><td<span class macro='snapshot print label:print prompt:Udskriv id:story'></span></td></span>
<div macro="hideWhenTaggedAny systemTool systemList Lærere">
<div class='tagged' macro='tags'></div></div>
<div class='tagClear'></div>
<div <span class='menubox' style='float:center;margin:0em'
<table <span class='viewer'>
<div class='tagClear'></div></span><span macro='tag Adressebog Kontakt '</span><span macro='tag Lærere Lærer:'></span><span macro='tag TelefonListe Tlf:'></span><span macro='wikify "[[%0|TelefonListe]]" telefon'</span>
<span macro='tag Vagt Vagt:'></span><span macro='wikify "[[%0|VagtPlan]]" vagt'></span>
<span macro='tag GangOversigt Gang:'></span><span macro='wikify "[[%0]]" gang'></span><div <span class macro='tiddler LærerTabel'></div><span class='newbutton' style='padding-right: 0.5em;' macro='newTiddler label: "Ny elev" tag:"Elev" title:"Indskriv navnet på en ny elev her" text:"Klik færdig, derefter rediger og tilføj oplysninger på kortets bagside"' ></span></div>
</span></span></div>
<div class macro='tiddler Meddelelser'></div>
<div <span macro='wikify "//@@bgcolor(#99ff33):Besked:@@//"'</span><span class macro='editTiddler'></span><span macro='wikify "@@color(#cc0000): %0@@" text'</span></span></div>
<div <span class='menubox' style='float:center;margin:0em' macro='notes heading:"NoteArkiv" tag:"NoteArkiv" suffix:"Note"'> </span></div>
</td></tr></div>
<tr <div class='viewer' macro='tiddler TiddlerSygHuPrint'></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<div class='tagClear'></div>
<!--}}}-->
hans
peter
peter Hansen
Hans petersen
<<tiddler KonverterListe4>>
<<getTiddlerPassword sommer2009 "Skriv det password du har modtaget pr mail">><html><p>Hej Tonny</p><p>Vi har været sammen om dansk før.</p><p>Denne gang er det dog *lidt* anderledes, eftersom mine elever skal op til synopseprøven.</p><p>Det er garanteret en fodfejl fra mig at du ikke har modtaget opgivelser, fordybelsesområder etc - inden de trak i går aftes. (Naturligvis under overværelse af Lone Baadsgaard, vores nuværende forstander).</p><p>Jeg har vedhæftet, de papirer mine elever har været med til at lave - og NB! - Der står</p><p><a href="../../index.html">en hjemmeside adresse</a> øverst th på hvert ark, der peger direkte til<a href="../../index.html">den side på nettet</a></p><p>, hvor jeg samler alt der er relevant for denne synopseprøve.</p><p>De ark jeg har vedhæftet her, er faktisk udskrifter af et par af siderne på nettet.</p> <p>Siden skal betragtes mere som et online "hyperlinkdokument" og du kan</p><p><a href="../../index.html">download</a>e det og bruge det offline. På denne får du også mulighed for at skrive direkte i det selv - hvis det har interesse.</p><p>[[her|Kom i gang]] og [[her|Instruktioner]]</p> <p>Det er selvfølgelig ikke nødvendigt at du bruger siden, hverken i downloadet version eller på nettet.</p><p>Jeg synesdu skal have adgang til det samme som eleverne har.</p><p>Eleverne har opgivet en individuel bog (ud over de to andre hovedværker) - og i en erkendelse af at det garanteret er lidt af en mundfuld for en censor, har jeg forsøgt at skabe et overblik over bøgerne og hvem som har læst dem. Jeg har ovenikøbet surfet lidt rundt og fundet lidt boganmeldelser på nettet og kopieret dem ind i dokumentet under hver bog.</p> <p>Det skal siges at det ikke er noget eleverne har produceret. Deres bograpporter er forlængst afleveret tilbage og kunne derfor ikke komme med her.</p><p>Jeg har (med *løs* hånd) anslået relevante fordybelsesområder (også et par som ikke er aktuelle, i mangel af bedre). Det kan ses <a href="../../index.html#%5B%5BEfter%20tema%5D%5D">her</a></p><p>Mandag eller tirsdag i næste uge vil jeg sende dig en liste over prøvetider.</p> <p>Hvis du har spørgsmål -</p><p><a href="../../index.html#%5B%5BKontakt%20M%C3%A5ns%5D%5D">Kontakt mig her.</a></p><p>[[Denne mail på nettet|Mail til Tonny]].</p> <p>NB-Ps: Jeg anbefaler *MEGET* at du bruger Firefox eller Google Chrome til at læse siden med, eftersom den bruger javascript. Hvis du bruger IE, vil du opleve at der kommer fejlmeddelelser, når du vil læse om bøgerne...</p> <p>Pps: Der er en enkelt "side" (udover denne mail på nettet) jeg har sat password på (indtil videre). Det er den side, hvor jeg anslår hvilke læste tekster mm. der knytter sig til de fordybelsesområder de har trukket. Hvis du vil [[se på den|Stof/opgivelser - fordybelsesområder]] skal du skrive kode: sommer2009. (samme kode til mailen)</p> <p>God weekend.</p> <p>Mvh Måns Mårtensson</p><p> </p><p> </p></html>
{{bluey{Emne indeks}}}@@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("Emner")'
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"'
>>
----
<html><center>
Tags havner herunder - medmindre de tilføjes i [[tagSky]]
|<<tiddler tagSky>>|
[[Tak til ... & licens]]
[[Hent en kopi til dig selv|http://simplenoter.tiddlyspot.com/download]]
[[Kontakt Måns]]
<<tiddler SlideShowEksempel>>
</center></html>
<!--{{{-->
<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;"><span style="font-size: 42px; color:blue; font-family:Comic Sans MS;">Dansk</span><br><b>Opgivelser & Noter</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);
}
};
//}}}
<html><center>
|sortable|k
| Genrer/typer | Titel | Forfatter |Anslået fordybelsesområde| sidetal |h
|Novelle|[[Stranden rundt|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FStranden_rundt_af_Martha_Christensen_2.pdf&cidReq=DANSK_001]]|Martha Christensen|Tabu/Frihed/Normalitet|9,2|
|Novelle|[[Patienten|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FPatienten_af_Peter_Seeberg.pdf&cidReq=DANSK_001]]|Peter Seeberg|Normalitet/|5,0|
|Novelle |Klokken|H.C. Andersen|Romantik|5|
|Novelle på Svensk|Att döda ett barn|Stig Dagermann|Tabu/Fra barn til voksen|4,1|
|Novelle|[[Blod|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FBlod.pdf&cidReq=DANSK_001]]|Steen Langstrup|Fra barn til voksen/Unge og kriminalitet|14,5|
|(HELE novellen + et centralt uddrag oversat til mere moderne dansk) |[[Mogens|http://www.kalliope.org/digt.pl?longdid=jacobsen2001082606&printer=1]]|J.P. Jacobsen|Det Moderne gennembrud/Kærlighed|16|
|Novelle |To kilometer|Helle Helle||5|
|Novelle|Røde Aage|Tage S Hansen|Fra barn til voksen/Normalitet|4|
|En "novelle/artikel" |"Findes lykken" nr 2 fra samlingen "[[Ingen må vide det|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FIngen_m%E5_vide_det.pdf&cidReq=DANSK_001]]"|Helene Dambo og Kim Jørstad|Salg i sex/Tabu|8,3|
|Blog læsning og skrivning |Bl.a. [[En Luders dagbog|http://luder.smartlog.dk/]]||Salg i sex/Tabu||
|Artikel|[[Da gråandemor blev til folkeand|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FDa%20gr%86andemor%20blev%20til%20folkeand.pdf&cidReq=DANSK_001]]|Bertel Bavngaard||2,2|
|Artikel|[[Bander eller grupper|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FBander%20eller%20grupper.pdf&cidReq=DANSK_001]]|<-Se dokument|Krig/Unge og kriminalitet|6,0|
|Artikel|[[Artikel om Små ulykker|http://www.dfi.dk/tidsskriftetfilm/20/forside.htm]]|Magasinet: Film 2002|Fra barn til voksen|4|
|Eventyr|[[Den grimme ælling|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FDen%20grimme%20%91lling.pdf&cidReq=DANSK_001]]|HC Andersen|Eventyr af HC Andersen|9,7|
|Eventyr|[[Klods-Hans|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FH_C__Andersen_Eventyr_64_Klods-Hans_1855_En_gammel_Historie_fortalt_igjen.pdf&cidReq=DANSK_001]]|HC. Andersen|Eventyr af HC Andersen|3,0|
|Folkevise|Elvira Madigan og Sixten Sparre|Skillingevise|Kærlighed/Normalitet|2,1|
|Digt Johannes Møllehave oplæsning med musik fra ”Yndlingsdigte”|Til en som har mistet en elefant|Benny Andersen|Ikke udleveret som tekst|Fra barn til voksen|
|Digt|Det er så dejligt ude på landet|Dan Turell|Normalitet/Frihed|4|
|Filmiske virkemidler og billedanalyse|>| Div reklamefilm og reklamebilleder |Reklamens magt|
|Film|Er jeg da helt gak, mor||>|Normalitet/Frihed|
|Dokumentar|Er du åndssvag||>|Normalitet/Frihed|
|Kortfilm|Mord i mødregruppen|Cecilie Olrik og Adam Price|>|Normalitet/Frihed|
||||i alt:|!102,1|
|>|>|>|>| !Hovedværker: |h
|Roman|[[Jagten på et menneske]]|Svend Aage Madsen|>|Normalitet/Frihed|
|Individuel bogopgivelse (begrundet i en bograpport)|[[Individuelle bogopgivelser]]||||
|Film|Små Ulykker film (follow up med Mike Leighs Life is sweet)|Anette K. Olesen & Kim Fupz Aakeson|>|Fra barn til voksen/Tabu/Frihed|
</center></html>
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Mathias%20Kastbjerg.pdf]]
/%
Elev: [[Mathias Bülow Kastbjerg]]
!Beskrivelse
[[Fyrtøjet|http://dl.getdropbox.com/u/1064531/Fyrt%C3%B8jet%20-%20Mathias%20Kastbjerg.pdf]] eller her [[Fyrtøjet]]
!end
%/
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Mathias%20Damgaard1.pdf]]
/%
Elev:[[Mathias Damgaard-Iversen]]
!Beskrivelse
[[De blå øjne|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FDe_bl%E5_%F8jne.PDF&cidReq=DANSK_001]] (Historie af Karen Bliksen)
!end
%/
/***
|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");
//}}}
<data>{"wherekept":"Anders Rahbek Hansen","author":"Dan Turell","bibdata":"1990","primtopic":"Krimi"}</data>
/***
''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
}
//}}}
<<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>
/***
|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>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.macros, {
newHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]]>>",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);
}
}
});
//}}}
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Nicholaj%20H%20Vejlgaard.pdf]]
/%
Elev: [[Nicholaj Hejsel Vejlgaard]]
!Beskrivelse
[[Salg i sex|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FSalg_i_sex.PDF&cidReq=DANSK_001]] (artikel fra JP)
!end
%/
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Niels%20Christian%20Thyrrestrup%20Thomasen.pdf]]
/%
Elev: [[Niels Christian Thyrrestrup Thomasen]]
!Beskrivelse
[[Ebbe Skammelsøn]]
(folkevise)
!end%/
<data>{"author":"Jakob Ejersbo","bibdata":"2002","wherekept":"Niels Christian Thyrrestrup Thomasen","primtopic":"Unge og kriminalitet"}</data>
Kilde: http://www.litteratursiden.dk/anbefalinger/nordkraft-af-jakob-ejersbo
Af Michael Høyer-N... - tor, 01/01/2004 - 22:51
Anbefalet bog:
"Nordkraft" af Jakob Ejersbo
Originaludgave: 2002
Fortælling fra narkomiljøet i Ålborg i første halvdel af halvfemserne, hvor en række skæbner følges på deres vej mod bunden.
Udgivet:
2003
Forlag:
[Kbh.] : Gyldendal
Sidetal:
421
"Nordkraft" er i 3 dele. I romanens første del, "Junkiehunde", møder vi pusherfrau Maria, kæreste til en af Vestbyens dealere. I anden del, "Broen", præsenteres vi for Allan, som er vendt tilbage til Aalborg efter en tur på søen og kæmper for endelig at slippe ud af miljøet. Den sidste del, "Begravelsen", er historien, der samler trådene, da den sammensatte gruppe af personer mødes til en begravelse.
Ejersbo sender et skud ind i læserens årer, og vi svæver med ham i rejsen gennem et miljø, som for de fleste danskere er fjernt og ukendt - eller er det?! Gruppen af danskere, der har røget en joint eller sniffet en bane hyggesne og i perioder færdes i periferien af miljøet, er større, end de fleste vil være ved. Og en af "Nordkraft"s styrker er, at den viser, at miljøet "rekrutterer" sine disciple både på stenbroen, i den jyske muld og i Hasseris millionvillaer. Det alternative musiksted 1000fryd, tæt på Jomfru Ane Gade, rummer ikke kun de fortabte sjæle på deres vej mod en overdosis, men også ressourcestærke unge, som bevidst har valgt denne livsstil i en midlertidig nysgerrig søgen - weekendjunkien, som tager en fridag fra jobbet eller studiet. Men den brutale og afstumpede kerne af miljøet møder vi også. Billedet af pusheren, der leverer varen til det store hungrende marked, er yderst realistisk. Et kynisk og benhårdt miljø, hvor tævene leveres nedad i hierakiet, og er der ikke andre at slå på, kan det gå ud over de obligatoriske hunde. En afstumpet verden, fyldt med frygt, og hvor vennetjenester er den sikre vej til afhængighed og forfald. Ejersbo kender tydeligvis miljøet, og det gør, at romanen står som et stærkt vidnesbyrd, ikke bare over 90'ernes Aalborg, men også over Danmark år 2002, hvor designerdrugs flyder til et yngre og yngre publikum, mens velmenende forældre, foragede politikere og naive journalister famler i blinde efter svar.
Ejersbo forfalder ikke til klichéer. Narkobetjentene er ikke bare brutale voldsmænd, junkierne ikke alle på røven, og forstadsfruernes vej mod bunden er ikke så forskellig fra deres børns. Personskildringerne er nuancerede og realistiske. Romanen er sort, men ikke så sort, som den er blevet udskreget til i dele af pressen. Det kunne være værre, og der er små spirer af håb for nogle af personerne.
"Nordkraft" er beslægtet med Irving Welshs dopede "Trainspotting", mens Benn Q Holms storbyroman "Hafnia Punk" bl.a. beskriver forbruget af coke blandt de mere tjekkede i miljøet. "Nordkraft" er en bog, som med sit rå, bramfri og ligefremme sprog og de hurtige "klip" helt sikkert vil afskrække nogle læsere, men ikke dig, for du vil ikke gå glip af mødet med Maria, Steso, Allan og resten af junkiehundene i denne fremragende fortælling, som er en af de bedste danske udgivelser længe!
'Nordkraft' fik De gyldne Laurbær 2003.
Gyldendal, 2002. 421 sider.
<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>
<!--}}}-->
<!--{{{-->
<a style="color: #5566ff">Det ser ud som om du er ved at lave eller ændre en ny note fra bunden og op!<br>
Skriv notens titel i tekstfeltet øverst, og notens tekst herunder. <br>
Tilføj det emne denne note hører under i det næstøverste tekstfelt. <br>
Anvend [[dobbelte firkantede paranteser]] til at omkranse flere-ords emner. <br>
Brug denne drop-down menu:<b><span macro='tagChooser'></span></b> til at vælge dinne nuværende emner og andre tags</a>
<!--}}}-->
<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":"Jeg har vist givet den væk?!","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>
Førstelinier havner her:
[[Klik og download en kopi af denne hjemmeside. (Kan redigeres)|http://opgivelser.tiddlyspot.com/download]]
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
<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 [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></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' 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>
<!--}}}-->
/***
|''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"
});
*/
//}}}
Synopse:[[Link|http://dl.getdropbox.com/u/1064531/Patrick%20Rolf.pdf]]
/%
Elev: [[Patrick Rolff]]
!Beskrivelse
[[Reklame virker ikke|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FReklame_virker_ikke.PDF&cidReq=DANSK_001]]
En Carlsberg reklame hentet fra "Tidens kvinder"
!end
%/
<data>{"author":"Elsebeth Egholm","wherekept":"Simon Staunsbæk","bibdata":"Gyldendal 2005","primtopic":"Krimi"}</data>
[[Download (højreklik gem link som)|http://dl.getdropbox.com/u/1064531/Pin%20Up.mpg]]
<html><div align="center"><iframe src="http://dl.getdropbox.com/u/1064531/Pin%20Up.mpg" frameborder="0" width="100%" height="600"></iframe></div></html>
[[Slides 1|http://files.getdropbox.com/u/1064531/den%20nye%20afgangspr%C3%B8ve%20i%20dansk.pdf]]
[[Slides 2|http://files.getdropbox.com/u/1064531/den%20nye%20afgangspr%C3%B8ve%20i%20dansk%202.pdf]]
[[Nye afgangsprøver i dansk - hvorfor og hvordan?|http://www.videnomlaesning.dk/UserFiles/File/Pdf-filer/Nye_afgangspr%C3%B8ver_i_dansk.pdf]]
[[Retningslinjer for afholdelse af ”prøveform B” som mundtlig danskprøve i 10. klasse|http://www.mse.dk/Skolehjem/Breve0809/Krav_til_proveform_i_mundtlig_dansk_10_klasse.pdf]]
[[Karaktervurderingen]]
[[Som pdf|http://dl.getdropbox.com/u/1064531/pr%C3%B8vetider%20dansk.pdf]]
!18/6 – 09 [[Dansk]] m MM
|1|8:05 – 8:30|[[Patrick Rolff]]|[[FS10|10]]|
|2|8:30 – 8:55|[[Line Domino]]|[[FS10|10]]|
|3|8:55 – 9:20|[[Simone Madsen]]|[[FSA|9]]|
|4|9:20 – 9:45|[[Boanna Stig Frølund]]|[[FS10|10]]|
|*|9:45 – 10:00|>|>| Pause |
|5|10:00 – 10:25|[[Jeanette Bach Andreasen]]|[[FSA|9]]|
|6|10:25 – 10:50|[[Camilla Graff]]|[[FS10|10]]|
|7|10:50 – 11:15|[[Kasper Hasselkvist]]|[[FS10|10]]|
|8|11:15 – 11:40|[[Anna Agger Rasmussen]]|[[FSA|9]]|
|9|11:40 – 12:05|[[Kathrine Østergaard Petersen]]|[[FS10|10]]|
|*|12:05 – 12:45|>|>| Pause |
|10|12:45 – 13:10|[[Christian Asp]]|[[FS10|10]]|
+++[Vurdering]<<tiddler [[Karaktervurderingen]]>>===
!19/6 – 09 [[Dansk]] m MM
|1|8:05 – 8:30|[[Nicholaj Hejsel Vejlgaard]]|[[FS10|10]]|
|2|8:30 – 8:55|[[Simon Staunsbæk]]|[[FS10|10]]|
|3|8:55 – 9:20|[[Anne Bach Sørensen]]|[[FS10|10]]|
|4|9:20 – 9:45|[[Mathias Bülow Kastbjerg]]|[[FS10|10]]|
|*|9:45 – 10:00|>|>| Pause |
|5|10:00 – 10:25|[[Anne Sofie Palm Hansen]]|[[FS10|10]]|
|6|10:25 – 10:50|[[Anders Agerlund]]|[[FSA|9]]|
|7|10:50 – 11:15|[[Niels Christian Thyrrestrup Thomasen]]|[[FS10|10]]|
|8|11:15 – 11:40|[[Mathias Damgaard-Iversen]]|[[FS10|10]]|
|9|11:40 – 12:05|[[Anders Rahbek Hansen]]|[[FS10|10]]|
|*|12:05 – 12:45|>|>| Pause |
+++[Vurdering]<<tiddler [[Karaktervurderingen]]>>===
<data>{"bibdata":"Borgen 1981","author":"Benny Andersen","wherekept":"Mathias Damgaard-Iversen","primtopic":"Fra barn til voksen"}</data>
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.1|
|Author|Eric Shulman - ELS Design Studios|
|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
<<<
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: 1, date: new Date(2008,9,7)};
// SET STYLESHEET (for toolbar button style)
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");
// 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=/;';
}
}
// UTILITY FUNCTIONS
config.quickEdit = {
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 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;
}
}
//}}}
//{{{
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");
// save cookie when toolbar shown, remove cookie when toolbar hidden
if (config.options.chkShowQuickEdit) saveOptionCookie("chkShowQuickEdit");
else removeCookie("chkShowQuickEdit");
// set link and title based on option state
src.innerHTML=config.commands.toggleQuickEdit.getText();
// refresh all actively displayed tiddler editor(s)
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 - 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, 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>>/%
%/<<tiddler QuickEdit_convert>>/%
%/}}}
/%
|Name|QuickEdit_align|
|Source|http://www.TiddlyTools.com/#QuickEdit_align|
|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.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"
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>align</a></html>
/%
|Name|QuickEdit_color|
|Source|http://www.TiddlyTools.com/#QuickEdit_color|
|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|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"
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 - 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="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;
}
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>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 - 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|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"
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;
};
Popup.show(p,false);
s.onkeyup=function(ev){ var ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>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 - 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|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"
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>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 - 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|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" 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" title="//italics//" accesskey="I"
onclick="config.quickEdit.wrapSelection(this,'//','//'); return false;"
> I </a></html>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" title="__underline__" accesskey="U"
onclick="config.quickEdit.wrapSelection(this,'__','__'); return false;"
> U </a></html>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" title="--strikethrough--" accesskey="S"
onclick="config.quickEdit.wrapSelection(this,'--','--'); return false;"
> S </a></html>/%
%/ /% SPACER
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>format</a></html>
/%
|Name|QuickEdit_image|
|Source|http://www.TiddlyTools.com/#QuickEdit_image|
|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|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"
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 - 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|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"
title="insert content from another tiddler or an external file"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
var s2=createTiddlyElement(p,'select');
s2.style.width='100%';
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.getTaggedTiddlers(tag,'title'):store.getTiddlers('title');
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();
if (!tag.length) this.selectedIndex=0;
};
createTiddlyElement(p,'br');
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select a tiddler or file...','');
s.options[s.length]=new Option('[browse for file...]','_file');
var tids=store.getTiddlers('title');
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;
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;
};
Popup.show(p,false);
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>insert</a></html>
/%
|Name|QuickEdit_link|
|Source|http://www.TiddlyTools.com/#QuickEdit_link|
|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.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"
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.style.width='100%';
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.getTaggedTiddlers(tag,'title'):store.getTiddlers('title');
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();
if (!tag.length) this.selectedIndex=0;
};
createTiddlyElement(p,'br');
var s=createTiddlyElement(p,'select'); s.button=this;
s.options[0]=new Option('select a tiddler or file...','');
s.options[s.length]=new Option('[browse for file...]','_file');
var tids=store.getTiddlers('title');
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;
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>link</a></html>
/%
|Name|QuickEdit_macro|
|Source|http://www.TiddlyTools.com/#QuickEdit_macro|
|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.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"
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>macro</a></html>
/%
|Name|QuickEdit_replace|
|Source|http://www.TiddlyTools.com/#QuickEdit_replace|
|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|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"
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 - 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|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"
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 ev=ev||window.event; if (ev.keyCode==13) this.onclick(); };
Popup.show(p,false);
s.focus();
event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>sort</a></html>
/%
|Name|QuickEdit_split|
|Source|http://www.TiddlyTools.com/#QuickEdit_split|
|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: 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"
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>
/***
|Name:|QuickOpenTagPlugin|
|Description:|Changes tag links to make it easier to open tags as tiddlers|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#QuickOpenTagPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
config.quickOpenTag = {
dropdownChar: (document.all ? "\u25bc" : "\u25be"), // the little one doesn't work in IE?
createTagButton: function(place,tag,excludeTiddler) {
// little hack so we can do this: <<tag PrettyTagName|RealTagName>>
var splitTag = tag.split("|");
var pretty = tag;
if (splitTag.length == 2) {
tag = splitTag[1];
pretty = splitTag[0];
}
var sp = createTiddlyElement(place,"span",null,"quickopentag");
createTiddlyText(createTiddlyLink(sp,tag,false),pretty);
var theTag = createTiddlyButton(sp,config.quickOpenTag.dropdownChar,
config.views.wikified.tag.tooltip.format([tag]),onClickTag);
theTag.setAttribute("tag",tag);
if (excludeTiddler)
theTag.setAttribute("tiddler",excludeTiddler);
return(theTag);
},
miniTagHandler: function(place,macroName,params,wikifier,paramString,tiddler) {
var tagged = store.getTaggedTiddlers(tiddler.title);
if (tagged.length > 0) {
var theTag = createTiddlyButton(place,config.quickOpenTag.dropdownChar,
config.views.wikified.tag.tooltip.format([tiddler.title]),onClickTag);
theTag.setAttribute("tag",tiddler.title);
theTag.className = "miniTag";
}
},
allTagsHandler: function(place,macroName,params) {
var tags = store.getTags(params[0]);
var filter = params[1]; // new feature
var ul = createTiddlyElement(place,"ul");
if(tags.length == 0)
createTiddlyElement(ul,"li",null,"listTitle",this.noTags);
for(var t=0; t<tags.length; t++) {
var title = tags[t][0];
if (!filter || (title.match(new RegExp('^'+filter)))) {
var info = getTiddlyLinkInfo(title);
var theListItem =createTiddlyElement(ul,"li");
var theLink = createTiddlyLink(theListItem,tags[t][0],true);
var theCount = " (" + tags[t][1] + ")";
theLink.appendChild(document.createTextNode(theCount));
var theDropDownBtn = createTiddlyButton(theListItem," " +
config.quickOpenTag.dropdownChar,this.tooltip.format([tags[t][0]]),onClickTag);
theDropDownBtn.setAttribute("tag",tags[t][0]);
}
}
},
// todo fix these up a bit
styles: [
"/*{{{*/",
"/* created by QuickOpenTagPlugin */",
".tagglyTagged .quickopentag, .tagged .quickopentag ",
" { margin-right:1.2em; border:1px solid #eee; padding:2px; padding-right:0px; padding-left:1px; }",
".quickopentag .tiddlyLink { padding:2px; padding-left:3px; }",
".quickopentag a.button { padding:1px; padding-left:2px; padding-right:2px;}",
"/* extra specificity to make it work right */",
"#displayArea .viewer .quickopentag a.button, ",
"#displayArea .viewer .quickopentag a.tiddyLink, ",
"#mainMenu .quickopentag a.tiddyLink, ",
"#mainMenu .quickopentag a.tiddyLink ",
" { border:0px solid black; }",
"#displayArea .viewer .quickopentag a.button, ",
"#mainMenu .quickopentag a.button ",
" { margin-left:0px; padding-left:2px; }",
"#displayArea .viewer .quickopentag a.tiddlyLink, ",
"#mainMenu .quickopentag a.tiddlyLink ",
" { margin-right:0px; padding-right:0px; padding-left:0px; margin-left:0px; }",
"a.miniTag {font-size:150%;} ",
"#mainMenu .quickopentag a.button ",
" /* looks better in right justified main menus */",
" { margin-left:0px; padding-left:2px; margin-right:0px; padding-right:0px; }",
"#topMenu .quickopentag { padding:0px; margin:0px; border:0px; }",
"#topMenu .quickopentag .tiddlyLink { padding-right:1px; margin-right:0px; }",
"#topMenu .quickopentag .button { padding-left:1px; margin-left:0px; border:0px; }",
"/*}}}*/",
""].join("\n"),
init: function() {
// we fully replace these builtins. can't hijack them easily
window.createTagButton = this.createTagButton;
config.macros.allTags.handler = this.allTagsHandler;
config.macros.miniTag = { handler: this.miniTagHandler };
config.shadowTiddlers["QuickOpenTagStyles"] = this.styles;
store.addNotification("QuickOpenTagStyles",refreshStyles);
}
}
config.quickOpenTag.init();
//}}}
/***
|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 af 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...^^@@
//{{{
window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
var body="\n";
// numbered list of links to matching tiddlers
body+="\n<<<";
for(var t=0;t<matches.length;t++) {
var date=config.options.chkSearchByDate?(matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" "):"";
body+="\n# "+date+"[["+matches[t].title+"]]";
}
body+="\n<<<\n";
// 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");
store.addTiddler(tiddler); story.closeTiddler(title);
// use alternate "search again" label in <<search>> macro
var oldprompt=config.macros.search.label;
config.macros.search.label="search again";
// render/refresh tiddler
story.displayTiddler(null,title,1);
store.notify(title,true);
// restore standard search label
config.macros.search.label=oldprompt;
}
//}}}
/***
|Name|SearchOptionsPlugin|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Documentation|http://www.TiddlyTools.com/#SearchOptionsPluginInfo|
|Version|3.0.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.search, TiddlyWiki.prototype.search, config.macros.search.onKeyPress|
|Options|##Configuration|
|Description|extend core search function with additional user-configurable options|
Adds extra options to core search function including selecting which data items to search, enabling/disabling incremental key-by-key searches, and generating a ''list of matching tiddlers'' 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 chkSearchHighlight>> Highlight matching text in displayed tiddlers
<<option chkSearchList>> Show list of matches
<<option chkSearchListTiddler>> Write list to [[SearchResults]] tiddler
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by modification date (most recent first)
<<option chkIncrementalSearch>> Incremental key-by-key search: {{twochar{<<option txtIncrementalSearchMin>>}}} or more characters, {{threechar{<<option txtIncrementalSearchDelay>>}}} msec delay
<<option chkSearchOpenTiddlers>> Search only in tiddlers that are currently displayed
<<option chkSearchExcludeTags>> Exclude tiddlers tagged with: <<option txtSearchExcludeTags>>
<<<
!!!!!Revisions
<<<
2009.01.16 [3.0.5] added chkSearchOpenTiddlers option to limit searches to displayed tiddlers only
|please see [[SearchOptionsPluginInfo]] for additional revision details|
2005.10.18 [1.0.0] Initial Release
<<<
!!!!!Code
***/
//{{{
version.extensions.SearchOptionsPlugin= {major: 3, minor: 0, revision: 5, date: new Date(2009,1,16)};
var co=config.options; // abbrev
if (co.chkSearchTitles===undefined) co.chkSearchTitles=true;
if (co.chkSearchText===undefined) co.chkSearchText=true;
if (co.chkSearchTags===undefined) co.chkSearchTags=true;
if (co.chkSearchFields===undefined) co.chkSearchFields=true;
if (co.chkSearchTitlesFirst===undefined) co.chkSearchTitlesFirst=true;
if (co.chkSearchList===undefined) co.chkSearchList=true;
if (co.chkSearchHighlight===undefined) co.chkSearchHighlight=true;
if (co.chkSearchListTiddler===undefined) co.chkSearchListTiddler=false;
if (co.chkSearchByDate===undefined) co.chkSearchByDate=false;
if (co.chkIncrementalSearch===undefined) co.chkIncrementalSearch=true;
if (co.chkSearchShadows===undefined) co.chkSearchShadows=true;
if (co.txtIncrementalSearchDelay===undefined) co.txtIncrementalSearchDelay=500;
if (co.txtIncrementalSearchMin===undefined) co.txtIncrementalSearchMin=3;
if (co.chkSearchOpenTiddlers===undefined) co.chkSearchOpenTiddlers=false;
if (co.chkSearchExcludeTags===undefined) co.chkSearchExcludeTags=true;
if (co.txtSearchExcludeTags===undefined) co.txtSearchExcludeTags="excludeSearch";
if (config.macros.search.reportTitle==undefined)
config.macros.search.reportTitle="SearchResults"; // note: not a cookie!
config.macros.search.label+="\xa0"; // a little bit of space just because it looks better
//}}}
// // searchLink: {{{[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;
}
}
});
//}}}
// // incremental search uses option settings instead of hard-coded delay and minimum input values
//{{{
var fn=config.macros.search.onKeyPress;
fn=fn.toString().replace(/500/g, "config.options.txtIncrementalSearchDelay||500");
fn=fn.toString().replace(/> 2/g, ">=(config.options.txtIncrementalSearchMin||3)");
eval("config.macros.search.onKeyPress="+fn);
//}}}
// // REPLACE story.search() for option to "show search results in a list"
//{{{
Story.prototype.search = function(text,useCaseSensitive,useRegExp)
{
var co=config.options; // abbrev
var re=new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");
if (config.options.chkSearchHighlight) highlightHack=re;
var matches = store.search(re,co.chkSearchByDate?"modified":"title","");
if (co.chkSearchByDate) matches=matches.reverse(); // most recent first
var q = useRegExp ? "/" : "'";
clearMessage();
if (!matches.length) {
if (co.chkSearchListTiddler) discardSearchResults();
displayMessage(config.macros.search.failureMsg.format([q+text+q]));
} else {
if (co.chkSearchList||co.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;
}
//}}}
// // REPLACE store.search() for enhanced searching/sorting options
//{{{
TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)
{
var co=config.options; // abbrev
var tids = this.reverseLookup("tags",excludeTag,false,sortField);
var opened=[]; story.forEachTiddler(function(tid,elem){opened.push(tid);});
// eliminate tiddlers tagged with excluded tags
if (co.chkSearchExcludeTags&&co.txtSearchExcludeTags.length) {
var ex=co.txtSearchExcludeTags.readBracketedList();
var temp=[]; for(var t=tids.length-1; t>=0; t--)
if (!tids[t].tags.containsAny(ex)) temp.push(tids[t]);
tids=temp;
}
// scan for matching titles first...
var results = [];
if (co.chkSearchTitles) {
for(var t=0; t<tids.length; t++) {
if (co.chkSearchOpenTiddlers && !opened.contains(tids[t].title)) continue;
if(tids[t].title.search(searchRegExp)!=-1) results.push(tids[t]);
}
if (co.chkSearchShadows)
for (var t in config.shadowTiddlers) {
if (co.chkSearchOpenTiddlers && !opened.contains(t)) continue;
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<tids.length; t++) {
if (co.chkSearchOpenTiddlers && !opened.contains(tids[t].title)) continue;
if (co.chkSearchText && tids[t].text.search(searchRegExp)!=-1)
results.pushUnique(tids[t]);
if (co.chkSearchTags && tids[t].tags.join(" ").search(searchRegExp)!=-1)
results.pushUnique(tids[t]);
if (co.chkSearchFields && store.forEachField!=undefined)
store.forEachField(tids[t],
function(tid,field,val) {
if (val.search(searchRegExp)!=-1) results.pushUnique(tids[t]);
},
true); // extended fields only
}
// then check for matching text in shadows
if (co.chkSearchShadows)
for (var t in config.shadowTiddlers) {
if (co.chkSearchOpenTiddlers && !opened.contains(t)) continue;
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 (!co.chkSearchTitlesFirst || co.chkSearchByDate) results.sort(bySortField);
return results;
}
//}}}
// // 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);
};
//}}}
// // SearchResults panel handling
//{{{
setStylesheet(".searchResults { padding:1em 1em 0 1em; }","searchResults"); // matches std tiddler padding
config.macros.search.createPanel=function(text,matches,body) {
function getByClass(e,c) { var d=e.getElementsByTagName("div");
for (var i=0;i<d.length;i++) if (hasClass(d[i],c)) return d[i]; }
var panel=createTiddlyElement(null,"div","searchPanel","searchPanel");
this.renderPanel(panel,text,matches,body);
var oldpanel=document.getElementById("searchPanel");
if (!oldpanel) { // insert new panel just above tiddlers
var da=document.getElementById("displayArea");
da.insertBefore(panel,da.firstChild);
} else { // if panel exists
var oldwrap=getByClass(oldpanel,"searchResults");
var newwrap=getByClass(panel,"searchResults");
// if no prior content, just insert new content
if (!oldwrap) oldpanel.insertBefore(newwrap,null);
else { // swap search results content but leave containing panel intact
oldwrap.style.display='block'; // unfold wrapper if needed
var i=oldwrap.getElementsByTagName("input")[0]; // get input field
if (i) { var pos=this.getCursorPos(i); i.onblur=null; } // get cursor pos, ignore blur
oldpanel.replaceChild(newwrap,oldwrap);
panel=oldpanel; // use existing panel
}
}
this.showPanel(true,pos);
return panel;
}
config.macros.search.renderPanel=function(panel,text,matches,body) {
var wrap=createTiddlyElement(panel,"div",null,"searchResults");
wrap.onmouseover = function(e){ addClass(this,"selected"); }
wrap.onmouseout = function(e){ removeClass(this,"selected"); }
// create toolbar: "open all", "fold/unfold", "close"
var tb=createTiddlyElement(wrap,"div",null,"toolbar");
var b=createTiddlyButton(tb, "open all", "open all matching tiddlers", function() {
story.displayTiddlers(null,this.getAttribute("list").readBracketedList()); return false; },"button");
var list=""; for(var t=0;t<matches.length;t++) list+='[['+matches[t].title+']] ';
b.setAttribute("list",list);
var b=createTiddlyButton(tb, "fold", "toggle display of search results", function() {
config.macros.search.foldPanel(this); return false; },"button");
var b=createTiddlyButton(tb, "close", "dismiss search results", function() {
config.macros.search.showPanel(false); return false; },"button");
createTiddlyText(createTiddlyElement(wrap,"div",null,"title"),"Search for: "+text); // title
wikify(body,createTiddlyElement(wrap,"div",null,"viewer")); // report
return panel;
}
config.macros.search.showPanel=function(show,pos) {
var panel=document.getElementById("searchPanel");
var i=panel.getElementsByTagName("input")[0];
i.onfocus=show?function(){config.macros.search.stayFocused(true);}:null;
i.onblur=show?function(){config.macros.search.stayFocused(false);}:null;
if (show && panel.style.display=="block") { // if shown, grab focus, restore cursor
if (i&&this.stayFocused()) { i.focus(); this.setCursorPos(i,pos); }
return;
}
if(!config.options.chkAnimate) {
panel.style.display=show?"block":"none";
if (!show) { removeChildren(panel); config.macros.search.stayFocused(false); }
} else {
var s=new Slider(panel,show,false,show?"none":"children");
s.callback=function(e,p){e.style.overflow="visible";}
anim.startAnimating(s);
}
return panel;
}
config.macros.search.foldPanel=function(button) {
var d=document.getElementById("searchPanel").getElementsByTagName("div");
for (var i=0;i<d.length;i++) if (hasClass(d[i],"viewer")) var v=d[i]; if (!v) return;
var show=v.style.display=="none";
if(!config.options.chkAnimate)
v.style.display=show?"block":"none";
else {
var s=new Slider(v,show,false,"none");
s.callback=function(e,p){e.style.overflow="visible";}
anim.startAnimating(s);
}
button.innerHTML=show?"fold":"unfold";
return false;
}
config.macros.search.stayFocused=function(keep) { // TRUE/FALSE=set value, no args=get value
if (keep===undefined) return this.keepReportInFocus;
this.keepReportInFocus=keep;
return keep
}
config.macros.search.getCursorPos=function(i) {
var s=0; var e=0; if (!i) return { start:s, end:e };
try {
if (i.setSelectionRange) // FF
{ s=i.selectionStart; e=i.selectionEnd; }
if (document.selection && document.selection.createRange) { // IE
var r=document.selection.createRange().duplicate();
var len=r.text.length; s=0-r.moveStart('character',-100000); e=s+len;
}
}catch(e){};
return { start:s, end:e };
}
config.macros.search.setCursorPos=function(i,pos) {
if (!i||!pos) return; var s=pos.start; var e=pos.end;
if (i.setSelectionRange) //FF
i.setSelectionRange(s,e);
if (i.createTextRange) // IE
{ var r=i.createTextRange(); r.collapse(true); r.moveStart("character",s); r.select(); }
}
//}}}
// // SearchResults report generation
// note: these functions are defined globally, so they can be more easily redefined to customize report formats//
//{{{
if (!window.reportSearchResults) window.reportSearchResults=function(text,matches)
{
var cms=config.macros.search; // abbrev
var body=window.formatSearchResults(text,matches);
if (!config.options.chkSearchListTiddler) // show #searchResults panel
window.scrollTo(0,ensureVisible(cms.createPanel(text,matches,body)));
else { // write [[SearchResults]] tiddler
var title=cms.reportTitle;
var who=config.options.txtUserName;
var when=new Date();
var tags="excludeLists excludeSearch temporary";
var tid=store.getTiddler(title); if (!tid) tid=new Tiddler();
tid.set(title,body,who,when,tags);
store.addTiddler(tid);
story.closeTiddler(title);
story.displayTiddler(null,title);
}
}
if (!window.formatSearchResults) window.formatSearchResults=function(text,matches,opt)
{
var body='';
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
if (!opt) var opt="all";
var parts=opt.split("+");
for (var i=0; i<parts.length; i++) { var p=parts[i].toLowerCase();
if (p=="again"||p=="all") body+=window.formatSearchResults_again(text,matches);
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);
}
return body;
}
if (!window.formatSearchResults_again) window.formatSearchResults_again=function(text,matches)
{
var title=config.macros.search.reportTitle
var body='';
// search again
body+='{{span{<<search "'+text.replace(/"/g,'"')+'">> /%\n';
body+='%/<html><input type="button" value="search again"';
body+=' onclick="var t=this.parentNode.parentNode.getElementsByTagName(\'input\')[0];';
body+=' config.macros.search.doSearch(t); return false;">';
body+=' <a href="javascript:;" onclick="';
body+=' var e=this.parentNode.nextSibling;';
body+=' var show=e.style.display!=\'block\';';
body+=' if(!config.options.chkAnimate) e.style.display=show?\'block\':\'none\';';
body+=' else anim.startAnimating(new Slider(e,show,false,\'none\'));';
body+=' return false;">options...</a>';
body+='</html>@@display:none;border-left:1px dotted;margin-left:1em;padding:0;padding-left:.5em;font-size:90%;/%\n';
body+=' %/<<option chkSearchTitles>>titles /%\n';
body+=' %/<<option chkSearchText>>text /%\n';
body+=' %/<<option chkSearchTags>>tags /%\n';
body+=' %/<<option chkSearchFields>>fields /%\n';
body+=' %/<<option chkSearchShadows>>shadows\n';
body+=' <<option chkCaseSensitiveSearch>>case-sensitive /%\n';
body+=' %/<<option chkRegExpSearch>>text patterns /%\n';
body+=' %/<<option chkSearchByDate>>sorted by date\n';
body+=' <<option chkSearchHighlight>> highlight matching text in displayed tiddlers\n';
body+=' <<option chkIncrementalSearch>>incremental key-by-key search: /%\n';
body+=' %/{{twochar{<<option txtIncrementalSearchMin>>}}} or more characters, /%\n';
body+=' %/{{threechar{<<option txtIncrementalSearchDelay>>}}} msec delay\n';
body+=' <<option chkSearchOpenTiddlers>> search only in tiddlers that are currently displayed\n';
body+=' <<option chkSearchExcludeTags>>exclude tiddlers tagged with:\n';
body+=' {{editor{<<option txtSearchExcludeTags>>}}}/%\n';
body+='%/@@}}}\n\n';
return body;
}
if (!window.formatSearchResults_summary) window.formatSearchResults_summary=function(text,matches)
{
// summary: nn tiddlers found matching '...', options used
var body='';
var co=config.options; // abbrev
var title=config.macros.search.reportTitle
var q = co.chkRegExpSearch ? "/" : "'";
body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\n";
var opts=[];
if (co.chkSearchTitles) opts.push("titles");
if (co.chkSearchText) opts.push("text");
if (co.chkSearchTags) opts.push("tags");
if (co.chkSearchFields) opts.push("fields");
if (co.chkSearchShadows) opts.push("shadows");
if (co.chkSearchOpenTiddlers) body+="^^//search limited to displayed tiddlers only//^^\n";
body+="~~ searched in "+opts.join(" + ")+"~~\n";
body+=(co.chkCaseSensitiveSearch||co.chkRegExpSearch?"^^ using ":"")
+(co.chkCaseSensitiveSearch?"case-sensitive ":"")
+(co.chkRegExpSearch?"pattern ":"")
+(co.chkCaseSensitiveSearch||co.chkRegExpSearch?"matching^^\n":"");
return body;
}
if (!window.formatSearchResults_list) window.formatSearchResults_list=function(text,matches)
{
// bullet list of links to matching tiddlers
var body='';
var pattern=co.chkRegExpSearch?text:text.escapeRegExp();
var sensitive=co.chkCaseSensitiveSearch?"mg":"img";
var link='{{tiddlyLinkExisting{<html><nowiki><a href="javascript:;" onclick="'
+'if(config.options.chkSearchHighlight)'
+' highlightHack=new RegExp(\x27'+pattern+'\x27,\x27'+sensitive+'\x27);'
+'story.displayTiddler(null,\x27%0\x27);'
+'highlightHack = null; return false;'
+'" title="%2">%1</a></html>}}}';
for(var t=0;t<matches.length;t++) {
body+="* ";
if (config.options.chkSearchByDate)
body+=matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" ";
var title=matches[t].title;
var fixup=title.replace(/'/g,"\\x27").replace(/"/g,"\\x22");
var tid=store.getTiddler(title);
var tip=tid?tid.getSubtitle():''; tip=tip.replace(/"/g,""");
body+=link.format([fixup,title,tip])+'\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" button
var title=config.macros.search.reportTitle;
var body="";
body+="@@diplay:block;<html><input type=\"button\" href=\"javascript:;\" "
+"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 SearchResults" button
body+="<html><input type=\"button\" href=\"javascript:;\" "
+"onclick=\"discardSearchResults()\" value=\"discard "+title+"\"></html>";
body+="@@\n";
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);
}
//}}}
//{{{
window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
var body="\n";
// numbered list of links to matching tiddlers
body+="\n<<<";
for(var t=0;t<matches.length;t++) {
var date=config.options.chkSearchByDate?(matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" "):"";
body+="\n# "+date+"[["+matches[t].title+"]]";
}
body+="\n<<<\n";
// 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");
store.addTiddler(tiddler); story.closeTiddler(title);
// use alternate "search again" label in <<search>> macro
var oldprompt=config.macros.search.label;
config.macros.search.label="search again";
// render/refresh tiddler
story.displayTiddler(null,title,1);
store.notify(title,true);
// restore standard search label
config.macros.search.label=oldprompt;
}
//}}}
<<<
# [[Danish]]
# [[Instruktioner]]
<<<
/%
|Name|SetTiddlerHeight|
|Source|http://www.TiddlyTools.com/#SetTiddlerHeight|
|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|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|use CSS to set a fixed or percentage height for each tiddler|
usage: <<tiddler SetTiddlerHeight with: height>>
where 'height' is an *optional* param to override the current value (if any)
note: for non-IE browsers, use "max-height" CSS3 attribute instead of "height" attribute.
%/<script>
// 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=/;';
}
}
if (config.options.txtTiddlerHeight==undefined) config.options.txtTiddlerHeight="auto";
if ('$'+'1'!='$1') config.options.txtTiddlerHeight='$1';
window.setTiddlerHeight=function() {
// set tiddler height
var opt="txtTiddlerHeight";
var h=config.options[opt]; if (!h.length) h='auto';
if (!h.replace(/[0-9]*/,"").length) h+="px"; // add "px" to numeric value
config.options[opt]=h;
var top=findPosY(document.getElementById("tiddlerDisplay"));
if (h.indexOf("%")!=-1)
h=((findWindowHeight()-top)*parseInt(h.replace(/%/,""))/100)+"px";
var heightParam=(config.browser.isIE?"height":"max-height")+":"+h;
var css='.viewer { '+heightParam+'; overflow:'+(h!='auto'?'auto':'visible')+'; }';
setStylesheet(css,"tiddlerHeightStyles");
if (config.options[opt]=="auto") removeCookie(opt);
else config.macros.option.propagateOption(opt,"value",config.options[opt],"input");
}
setTimeout('window.setTiddlerHeight()',1); // initialize height
if (window.addEventListener) window.addEventListener("resize",window.setTiddlerHeight,false);
</script>tiddler height: {{smallform{<<option txtTiddlerHeight>><script>
var t=place.lastChild
t.style.width="4em";
t.style.textAlign="center";
t.title="enter height using CSS dimensions (px, em, in, cm, %) or 'auto' to fit contents";
t.onfocus=function(){this.select();};
t.onblur=function(){this.onchange();}; /* for IE */
// hijack onchange for this field so CSS can be updated on the fly
t.coreOnChange=t.onchange;
t.onchange=function() {
// call original core onchange handler
if (this.coreOnChange) this.coreOnChange();
window.setTiddlerHeight();
};
</script>}}}
<<search>><<option chkUseYourSearch>><<closeAll>><<permaview>><<newTiddler>><<slider chkSliderFlereNye FlereNye "flere nye »" "Opret flere typer tiddlere efter skabeloner">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "muligheder »" "Lav om på TiddlyWikis avancerede muligheder">>
@@padding:0.6em;<<slider chkSliderSidebarTabs SliderSidebarTabs 'indekser »'>>@@
@@padding-left: 20px;[img(43px+,)[Billedet kan skiftes ud i Sidepanelets fanetiddler (sideBarTabs)Læg mærke til syntaksen - læs mere i ImageSizePlugin|http://maans.newp.dk/Billeder/images/notebook.gif][BogArkiv]]@@{{tuduSlider{<<slider chkBookSummary Bibliografi 'Bibliografi »'>>}}}
<<tabs txtMainTab "Tidslinie" "Tidslinie" TabTimeline "Alle" "Alle tiddlere" TabAll "Tags" "Alle tags" TabTags "Flere" "Flere lister" TabMore>>
Nr. 8: Frihed, Normalitet
Synopse:
[[Link|http://dl.getdropbox.com/u/1064531/Simon%20Staunsb%C3%A6k.pdf]]
/%
Elev: [[Simon Staunsbæk]]
!Beskrivelse
[[De mærkelige billeder|http://dl.getdropbox.com/u/1064531/De%20m%C3%A6rkelige%20billeder%20Simon%20Staunsb%C3%A6k.pdf]] (Novelle af Louis )
!end
%/
Nr. 20: Fra barn til voksen, novelle
Synopse: [[Link|http://dl.getdropbox.com/u/1064531/Simone%20Madsen.pdf]]
/%
Elev: [[Simone Madsen]]
!Beskrivelse
[[Drivhuset|http://dl.getdropbox.com/u/1064531/Drivhuset.pdf]] (novelle)
!end
%/
/***
| 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);
}
}
//}}}
@@font-family: Verdana, sans-serif; 08/09 m Måns@@
@@font-size: 1.5em;''Opgivelser & Noter''@@
<<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
}
.tiddler{border: none}
#tiddlersBar{display: none}
#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
}
.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|SnapshotPlugin|
|Source|http://www.TiddlyTools.com/#SnapshotPlugin|
|Documentation|http://www.TiddlyTools.com/#SnapshotPluginInfo|
|Version|1.1.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 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
<<<
2008.05.16 [1.1.1] added try..catch around addEvent/removeEvent calls to avoid error in Opera
2008.04.28 [1.1.0] removed 'viewerHTML' from 'ask' droplist and replaced with toggle for "output HTML only". Removed 'noCSS' parameter and replaced with config.options.chkSnapshotHTMLOnly global option. Added "select a tiddler..." to 'ask' droplist
2008.04.24 [1.0.1] in saveSnap(), convert output from Unicode to UTF before passing to saveFile(). Fixes "unknown name" error in IE's file.Write() function. Added viewerHTML to 'ask' droplist.
2008.04.21 [1.0.0] initial release - derived from [[NewDocumentPlugin]] with many improvements, including: "ask for ID" using droplist of available DOM elements, use "<base href=...>" for correctly resolving image references, wrap 'viewer only' output in class="tiddler viewer" for proper application of inherited CSS styles, snapshotSave and snapshotPrint tiddler toolbar command definitions, and more...
<<<
!!!!!Code
***/
//{{{
version.extensions.SnapshotPlugin= {major: 1, minor: 1, revision: 1, date: new Date(2008,5,16)};
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(p,false);
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="";
out+="<html><head>\n";
if (printing)
out+='<base href="file:///'+cms.getpath().replace(/\\/g,'/')+'"></base>\n';
if (!HTMLOnly) {
var styles=document.getElementsByTagName("style");
for(var i=0; i < styles.length; i++) {
out+="<style>\n";
out+="/* stylesheet="+styles[i].getAttribute("id")+" */\n";
out+=styles[i].innerHTML+"\n\n";
out+="</style>\n";
}
}
out+="</head><body>\n\n<div"+(id==cms.viewerID?" class='tiddler viewer'>":">");
out+=snapElem.innerHTML;
out+="</div>\n\n</body>\n";
out+="</html>";
return out;
},
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){};
//}}}
Gå til [[siden for at skrive ud|http://www2.kb.dk/elib/lit//dan/andersen/eventyr.dsl/hcaev105.htm]]
<html><div align="center"><iframe src="http://www2.kb.dk/elib/lit//dan/andersen/eventyr.dsl/hcaev105.htm" frameborder="0" width="100%" height="600"></iframe></div></html>
<data>{"wherekept":"Mathias Bülow Kastbjerg","author":"Anders Johansen","bibdata":"Modtryk 1989"}</data>
/***
''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;
}
//}}}
/***
|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){};
//}}}
<data>{"author":"Søren Jessen","bibdata":"2000","wherekept":"Anne Sofie Palm Hansen","primtopic":"Frihed"}</data>
Kilde: http://fortaellingen.dk/anmeldelse/s%C3%B8ren-jessen-stilhedens-hav
Anmeldt af Zenia Johnsen • 28. marts, 2005 •
“Kært” barn har mange navne - Hr. Hansen er et af dem…
Det onde viser sig på flere niveauer. Det oplever Sofie på 14 år i denne socialrealistiske thriller af Søren Jessen.
Stilhedens Hav findes på Månens overflade. Apollo 11 landede der i 1969, og menneskeheden gjorde et stort fremskridt. Stilhedens Hav findes også inden i Sofies lillebror Jens, som er alternativt tænkende. Han rokker frem og tilbage, når han ikke forstår at forholde sig til sin omverden. Det hænder ret tit, efter at de to søskende er flyttet til et parcelhuskvarter sammen med deres forældre. Før boede de ved havet.
Sofie er entusiastisk hobby-astronom, som elsker stjernerne og planeterne - og sin lillebror. Hun fortæller ham om de astronomiske myter, der selv begejstrer hende. Myterne er dramatiske og spændende og adskiller sig således umiddelbart fra hverdagen i parcelhuskvarteret. Forældrene er rigtige voksne - rollefordelingen er som følger: Moderen er skrøbelig og lidt ynkelig. Faderen er dominerende, egoistisk og aggressiv. Han flirter med naboens kone. Eller strengt taget indleder han en hed affære med hende. Moderen er ulykkelig og jaloux. Sofie er forundret og væmmes. Jens rokker.
En anden nabo, Hr. Hansen, har en stor ubehagelig køter. Man siger, at ejer og hund ofte ligner hinanden, hvilket også er tilfældet med Hr. Hansen. I virkeligheden syntes han at være den Onde selv…
Alt dette og meget mere fortæller Sofie til en dværg med dårlig tandhygiejne. Han bliver nødt til at høre alle facts, så han måske kan hjælpe Sofie, som på forholdsvis kort tid har rodet sig ind i et klæbrigt spind af ondskab. Spindet er kompliceret, og alt løser sig - men (selvfølgelig) ikke helt som ønsket.I Stilhedens hav blander facts sig med myter. Virkeligheden sløres og vrides, og læseren forvirres, undres over denne spændende fortælling, som både rummer et psykologisk og fantastisk aspekt.
Man kan hægte forskellige genrebetegnelser på romanen. Det kommer an på, hvor bogstaveligt man som læser oplever Sofies virkelighed. Jeg læser romanen som en fantastisk fortælling med et skvæt horror. Den forvredne virkelighed møder man også i Jessens geniale “Den skæve dreng”, som leger med virkelighedens bogstavelighed kontra fantasi. Dette er med til at gøre Jessen original og meget læseværdig. For kort sagt er Søren Jessen en fabelagtig fortæller. Jeg nyder virkelig at læse hans historier, og jeg har ofte en mistanke om, at han ved noget, han ikke rigtig vil ud med. Jeg lyder sikkert paranoid - men det ansvar ligger jeg på Jessens skulder. De kan sikkert bære det.
Søren Jessen: Stilhedens hav. Gyldendal, 2000
Forside: Søren Jessen
<<getTiddlerPassword sommer2009 "Skriv det password du har modtaget pr mail">>
|sortable|k
|>|>|>|>|>| !Til trækning: |h
|nr|Læste tekster|Fordybelsesområder||Læste tekster|Fordybelsesområder|h
|1|Stranden rundt, Patienten|Handicap, Artikel|11|KlodsHans, Den grimme ælling|Eventyr, HC. Andersen|
|2|KlodsHans, Den grimme ælling|Eventyr|12|Til en der har mistet en elefant|Frihed, Digt|
|3|Jagten på et menneske|Forfølgelse, Novelle|13/22|Røde Aage, Blod|Fra barn til voksen|
|4/21|Findes lykken? En luders dagbog|Tabu, Salg i sex|14/23|Findes lykken? En luders dagbog|Tabu, Novelle|
|5|Bander eller grupper|Krig|15|Elvira Madigan Og Sixten Sparre|Folkevise|
|6|KlodsHans, Den grimme ælling|Litt. Før 1870, Eventyr|16|Bander eller grupper|Krig, artikel|
|7|Reklamer|Reklame|17|Mogens, KlodsHans, Den grimme ælling|Kærlighed, litteratur før 1870|
|8|Mord i mødregruppen, Reklamefilm|Frihed,Normalitet|18|Reklamebilleder og film|Reklamebillede|
|9|Reklamefilm, Mord i mødregruppen|Kortfilm|19/24|Bander eller grupper|Unge og kriminalitet, artikel|
|10|To kilometer, Mogens|Kærlighed|20|Blod, Att döda ett barn,|Fra barn til voksen, novelle|
|sortable|k
|>|>|>|>|>| !Til trækning: |h
|nr|Elev|[[Fordybelsesområder]]||Elev|[[Fordybelsesområder]]|h
|1||Handicap, Artikel|11|[[Kasper Hasselkvist]]|Eventyr, HC. Andersen|
|2|[[Mathias Damgaard-Iversen]]|Eventyr|12|[[Anne Sofie Palm Hansen]]|Frihed, Digt|
|3|[[Anne Bach Sørensen]]|Forfølgelse, Novelle|13/22|[[Boanna Stig Frølund]] [[Camilla Graff]]|Fra barn til voksen|
|4/21|[[Jeanette Bach Andreasen]]|Tabu, Salg i sex|14/23|[[Christian Asp]]|Tabu, Novelle|
|5||Krig|15|[[Niels Christian Thyrrestrup Thomasen]]|Folkevise|
|6|[[Mathias Bülow Kastbjerg]]|Litt. Før 1870, Eventyr|16|[[Anders Agerlund]]|Krig, artikel|
|7|[[Nicholaj Hejsel Vejlgaard]]|Reklame|17|[[Anna Agger Rasmussen]]|Kærlighed, litteratur før 1870|
|8|[[Simon Staunsbæk]]|Frihed,Normalitet|18|[[Patrick Rolff]]|Reklamebillede|
|9|[[Line Domino]]|Kortfilm|19/24|[[Kathrine Østergaard Petersen]] [[Anders Rahbek Hansen]]|Unge og kriminalitet, artikel|
|10||Kærlighed|20|[[Simone Madsen]]|Fra barn til voksen, novelle|
/*{{{*/
/*FONT STUFF*/
#NewBibEntryTemplate .rolodex table {
border: 0px solid;
}
#NewBibEntryTemplate .rolodex tr, .rolodex td {
border: 0px solid;
}
#NewBibEntryTemplate .rolodex table {
border: 0px solid;
}
#NewBibEntryTemplate .rolodex tr, .rolodex td {
border: 0px solid;
}
body {font-family: Calibri; Verdana; font-size: 12pt;}
h1,h2,h3,h4,h5 { color: #1144ff; background: white; font-family: Verdana; border-bottom: none;}
.editor a {color:#dddddd;}
#editor a {color:#dddddd;}
.nowrap { white-space:nowrap;}
.bluey {font-weight: bold; color: #5566ff; font-size: 1.3em;}
.toolbar a {color:#5566ff;}
.selected .toolbar a {color:#5566ff;}
.selected .toolbar a:hover {color:#5566ff;}
/* SHORTENS THE HEIGHT OF THE HEADER */
.headerShadow {padding: 1em 0em .4em 1em;}
.headerForeground {padding: 1em 0em .4em 1em;}
.siteTitle {font-size:1.5em;}
.siteSubtitle {font-size:1em;}
/*SidePanelerne*/
#sidebar { position:fixed; }
#mainMenu { position:fixed; }
#sidebarTabs .tabContents
{ height:16em; overflow:auto; width:92.5%; }
#sidebarTabs .tabContents .tabContents
{ height:186em !important; }
/*MAINMENU*/
#mainMenu {width: 15.5em; text-align: left; font-size: .85em;}
#displayArea {margin: 0em 15em 0em 15.5em;}
.sliderPanel { margin-left: 1em; }
/*TABLE HEADER*/
.viewer th {color: #000; background-color: #eeeeee;}
/*TIDDLER TOPMARGIN AND BUTTON BORDER*/
a.button{border: 0;}
.viewer { margin-top: .5em; }
.viewer {line-height: 1.7em;}
/*TIDDLER TITLE COLOR MATCH BOTTOM OF HEADER*/
.title {color:[[ColorPalette::PrimaryMid]];}
.historytool .macro {color:#dddddd;}
/*UNORDERED and ORDERED LISTS TWEAK*/
.viewer li {padding-top: 0.5em; padding-bottom: 0.5em;}
/*LINELESS BLOCKQUOTES*/
.viewer blockquote {border-left: 0px; margin-top:0em; margin-bottom:0em; }
/*INVISIBLE TABLE*/
.viewer .invisiblecomm table {border-color: white;}
.viewer .invisiblecomm table td { font-size: 1em; font-family: Verdana; border-color: white; padding: 10px 20px 10px 0px; text-align: left; vertical-align: top; padding: 20px;}
.viewer .invisiblecomm 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;}
.viewer .invisiblecomm table tr.leftColumn { background-color: #bbbbbb; }
/*TOPMENU*/
#topMenu {padding-left: 1em; background-color: #aabbff; color: #110077; font-family: Trebuchet MS, Verdana; font-size: 13pt; line-height: 1em;}
#topMenu table td {margin: 10px;}
#topMenu .purple a {color: #0055dd;}
/*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; }
/*TagglyTag styles*/
.tagglyTagged li.listTitle { display:none;}
.tagglyTagged li { display: inline; font-size:90%; }
.tagglyTagged ul { margin:0px; padding:0px; }
.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 .tghide { display:inline; } */
.tagglyTagging { vertical-align: top; margin:0px; padding:0px; }
.tagglyTagging table { margin:0px; padding:0px; }
.tagglyTagging .button { display:none; margin-left:3px; margin-right:3px; }
.tagglyTagging .button, .tagglyTagging .hidebutton { color:#aaa; font-size:90%; border:0px; padding-left:0.3em;padding-right:0.3em;}
.tagglyTagging .button:hover, .hidebutton:hover { background:#eee; color:#888; }
.selected .tagglyTagging .button { display:inline; }
.tagglyTagging .hidebutton { color:white; } /* has to be there so it takes up space. tweak if you're not using a white tiddler bg */
.selected .tagglyTagging .hidebutton { color:#aaa }
.tagglyLabel { color:#aaa; 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; }
/* TAB COLOR FIX */
.tabUnselected {color:[[ColorPalette::PrimaryDark]];}
[[StyleSheetShortcuts]]
/* GIFFMEX TWEAKS TO STYLESHEETPRINT (so that nothing but tiddler title and text are printed) */
@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;}}
.viewer tr.evenRow { background-color: #eaeaea;}
.viewer tr.oddRow { background-color:#fff; }
.stretch input { width:99%; }
/*}}}*/
!!!StyleSheetTiddlersBar
/*{{{*/
#tiddlersBar .button {border:1px; color:#000;}
#tiddlersBar .tab {white-space:nowrap;}
#tiddlersBar {padding : 0.45em 0.5em 0.0em 1.0em;margin-left:0em;margin-right:0em}
#tiddlersBar {margin-bottom:0px;}
.tabSelected .button:hover {font-size:0.95em; color: #5566ff; background: #fff;padding : 0px 0px 0px 2px;}
.tabUnselected .button:hover {font-size:0.95em;color: #5566ff; background: #fff; padding : 0px 0px 0px 2px;}
.tabUnselected .button {font-size:0.95em; color: #5566ff; padding : 0px 0px 0px 2px;}
.tabSelected .button {font-size:0.95em; font-weight:bold; color: #5566ff;padding : 0px 0px 0px 2px;}
.tabSelected {background-color:white;font-weight:bold;color:[[ColorPalette::PrimaryMid]];border: 0px #c06 solid;border-bottom:0px; font-size:0.95em;}
.tabUnselected {
background-color:white;
border:0px #eee solid; border-bottom:0px;font-size:0.95em; }
.tabUnselected .tabButton {font-size:0.75em;color:#333;background:transparent; padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton {font-size:0.75em;color:#000;font-weight:bold;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 {color: #f00;background: #fff;}
.tiddler, .tabContents {border-top:0px #fa0 solid;margin-left:0.5em;margin-right:0.5em;}
#tiddlersBar {background:#abf;line-height: 1em;}
#tiddlersBar {background: #aabbff;}
/*}}}*/
<<slider chkSliderSynopser Synopser "Synopser »" "+ Materialer">>
<script>
var out=[];
var row='|%0|%1|%2|%3|';
out.push('| # | Elev | Synopse | Beskrivelse |h'); // headings
var tids=store.getTaggedTiddlers('Synopse');
for (var i=0; i<tids.length; i++) {
var el=store.getTiddlerSlice(tids[i].title,'Elev');
var sy=store.getTiddlerSlice(tids[i].title,'Synopse');
var b='<<tiddler [['+tids[i].title+'##Beskrivelse]]>>';
out.push(row.format([i+1,el,sy,b]));
}
out.push('|sortable|k');out.push('i alt ='+tids.length); // table class
return out.join('\n');
</script>
{{{<script>
var out=[];
var row='|%0|%1|%2|%3|';
var spin = 0 ;
out.push('| # | Elev | Synopse | Beskrivelse |h'); // headings
var tids=store.getTaggedTiddlers('NoteArkiv');
for (var i=0; i<tids.length; i++){
if (!store.getTiddlerText(tids[i].title+'##Beskrivelse'))continue;
spin++ ;
var el=store.getTiddlerSlice(tids[i].title,'Elev');
var sy=store.getTiddlerSlice(tids[i].title,'Synopse');
var b='<<tiddler [['+tids[i].title+'##Beskrivelse]]>>';
out.push(row.format([spin,el,sy,b]));
}
out.push('|sortable|k');out.push('i alt ='+ spin ); // table class
return out.join('\n');
</script>}}}
<script>
var out=[];
var row='|%0|%1|%2|%3|';
var spin = 0 ;
out.push('| # | Elev | Synopse | Beskrivelse |h'); // headings
var tids=store.getTaggedTiddlers('NoteArkiv');
for (var i=0; i<tids.length; i++){
if (!store.getTiddlerText(tids[i].title+'##Beskrivelse'))continue;
spin++ ;
var el=store.getTiddlerSlice(tids[i].title,'Elev');
var sy=store.getTiddlerSlice(tids[i].title,'Synopse');
var b='<<tiddler [['+tids[i].title+'##Beskrivelse]]>>';
out.push(row.format([spin,el,sy,b]));
}
out.push('|sortable|k');out.push('i alt ='+ spin ); // table class
return out.join('\n');
</script>
Kan åbnes direkte i siden - skrives ud eller gemmes til disk.
<<slider chkSliderSynopseScript SynopseScript "Tabel »" "Alfabetisk tabel">>
# [[Camilla Graff]] [[Synopse|http://dl.getdropbox.com/u/1064531/Camilla%20Graf.pdf]] [[Drivhuset|http://dl.getdropbox.com/u/1064531/Drivhuset.pdf]] (novelle)
# [[Christian Asp]] [[Synopse|http://dl.getdropbox.com/u/1064531/Christian%20Asp.pdf]] [[Et par underbukser|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FEt_par_underbukser.PDF&cidReq=DANSK_001]] Novelle af Dan Turell.
# [[Mathias Damgaard-Iversen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Mathias%20Damgaard1.pdf]] [[De blå øjne|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FDe_bl%E5_%F8jne.PDF&cidReq=DANSK_001]] (Historie af Karen Bliksen)
# [[Boanna Stig Frølund]] [[Synopse|http://dl.getdropbox.com/u/1064531/Boanna%20Fr%C3%B8lund.pdf]] [[Blodets Bånd|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FBlodets_b%E5nd.PDF&cidReq=DANSK_001]] En novelle af Vibeke Marx .
# [[Patrick Rolff]] [[Synopse|http://dl.getdropbox.com/u/1064531/Patrick%20Rolf.pdf]] [[Reklame virker ikke|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FReklame_virker_ikke.PDF&cidReq=DANSK_001]] En Carlsberg reklame hentet fra "Tidens kvinder"
# [[Nicholaj Hejsel Vejlgaard]] [[Synopse|http://dl.getdropbox.com/u/1064531/Nicholaj%20H%20Vejlgaard.pdf]] [[Salg i sex|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FSalg_i_sex.PDF&cidReq=DANSK_001]] (artikel fra JP)
# [[Jeanette Bach Andreasen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Jeanette%20B%20Andreasen.pdf]] [[Louises dobbeltliv|http://dl.getdropbox.com/u/1064531/Louises%20dobbeltliv.pdf]] Interview/Novelle fra ”Ingen må vide det” ISBN: 978-87-92031-71-6
# [[Anders Rahbek Hansen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Anders%20Rahbek.pdf]] [[De var helt vilde|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FDe_var_helt_vilde.PDF&cidReq=DANSK_001]] (Artikel - Ekstrabladet)
# [[Line Domino]] [[Synopse|http://dl.getdropbox.com/u/1064531/Line%20Domino.pdf]] PinUp (kortfilm)
# [[Niels Christian Thyrrestrup Thomasen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Niels%20Christian%20Thyrrestrup%20Thomasen.pdf]] [[Ebbe Skammelsøn]](folkevise)
# [[Kasper Hasselkvist]] [[Synopse|http://dl.getdropbox.com/u/1064531/Kasper%20Hasselkvist.pdf]] [[Lille Claus & storeClaus|http://dl.getdropbox.com/u/1064531/Kasper%20Hasselkvist%20-Store%20Claus%20og%20lille%20Claus.pdf]] eller her [[Lille Claus og store Claus]]
# [[Simone Madsen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Simone%20Madsen.pdf]] [[Drivhuset|http://dl.getdropbox.com/u/1064531/Drivhuset.pdf]] (novelle)
# [[Anna Agger Rasmussen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Anna%20Agger.pdf]] [[Snemanden]](Eventyr af HC Andersen)
# [[Anne Sofie Palm Hansen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Anne%20Sofie%20Palm%20Hansen.pdf]] [[Total eufori|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FTotal_Eufori.PDF&cidReq=DANSK_001]] fra albummet: "Pas på pengene" af Dan Turell & Halfdan E
# [[Simon Staunsbæk]] [[Synopse|http://dl.getdropbox.com/u/1064531/Simon%20Staunsb%C3%A6k.pdf]] [[De mærkelige billeder|http://dl.getdropbox.com/u/1064531/De%20m%C3%A6rkelige%20billeder%20Simon%20Staunsb%C3%A6k.pdf]] (Novelle af Louis )
# [[Mathias Bülow Kastbjerg]] [[Synopse|http://dl.getdropbox.com/u/1064531/Mathias%20Kastbjerg.pdf]] [[Fyrtøjet|http://dl.getdropbox.com/u/1064531/Fyrt%C3%B8jet%20-%20Mathias%20Kastbjerg.pdf]] eller her [[Fyrtøjet]]
# [[Anne Bach Sørensen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Anne%20Bach%20S%C3%B8rensen.pdf]] [[Et par underbukser|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FEt_par_underbukser.PDF&cidReq=DANSK_001]] Novelle af Dan Turell.
# [[Kathrine Østergaard Petersen]] [[Synopse|http://dl.getdropbox.com/u/1064531/Kathrine%20%C3%98stergaard%20Petersen.pdf]] [[Tøser tæskede Nana|http://files.getdropbox.com/u/1064531/T%C3%B8ser%20t%C3%A6skede%20Nana.pdf]] (Artikel - Nordjyske stifttidende)
# [[Anders Agerlund]] [[Synopse|Anders Agerlunds synopse]] [[Floden|http://maans.newp.dk/claroline/claroline/document/goto/index.php?url=%2FSynopsetekster%2FFloden.PDF&cidReq=DANSK_001]] Novelle (1919) af Antonis Samarakis
Mvh Måns
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 10 tiddlere som matcher /{{{control}}}/''@@|bgcolor(#8af): @@color(#A00000): SøgeHjælp@@ |
|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titler <<option chkSearchText>> Tekst <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |
|bgcolor(#8af): |bgcolor(#8af): @@color(#000080):sortér efter: ''Titler''@@ |bgcolor(#8af): @@color(#000080): ''Størrelse'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h
| 1|[[CoreTweaks]]| 22143|@@systemConfig@@|
| 2|[[FramedLinksPlugin]]| 5597|@@systemConfig@@|
| 3|[[ListboxPlugin]]| 11176|@@systemConfig@@|
| 4|[[MiniBrowserPlugin]]| 16423|@@systemConfig@@|
| 5|[[Opret en hjemmeside på TiddlySpot]]| 2454|@@excludeLists,Instruktioner@@|
| 6|[[SlideShowPlugin]]| 15190|@@systemConfig@@|
| 7|[[SlideShowStyleSheet]]| 1480|@@@@|
| 8|[[TagglyTaggingPlugin]]| 21189|@@systemConfig,excludeLists@@|
| 9|[[TextAreaPlugin]]| 11684|@@systemConfig@@|
| 10|[[TwHelpSearchPlugin]]| 6446|@@systemConfig@@|
|sortable|k
|>|bgcolor(#8af):@@color(#000080):''Der er fundet 3 tiddlere som matcher /{{{søg}}}/''@@|bgcolor(#8af): @@color(#A00000): SearchHelp@@ |
|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |
|bgcolor(#8af): |bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h
| 1|[[Danish]]| 27183|@@systemConfig@@|
| 2|[[Instruktioner]]| 3195|@@startop,excludeLists,Instruktioner@@|
| 3|[[TwHelpSearchPlugin]]| 6445|@@noTitle,systemConfig@@|
|sortable|k
|>|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
<<timeline modified 100>>
/***
|''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("enter tag(s) to match:","faq");
if (!response) return "no tags specified"; // 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 "There are no tiddlers tagged with <<tag "+tags.join(">> and <<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:|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;
}
});
//}}}
//Dave Gifford skrev (red)://
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 fandt på ~TiddlerBar ideen, og andre brugbare tweaks.
-----
^^<html><a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br />No-Brainer Notes is licensed by Dave Gifford under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a></html>^^
~~[[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 [[No-Brainer Notes|http://www.giffmex.org/nobrainernotes.html]] og valgt at kalde den [[Simple Noter|http://simplenoter.tiddlyspot.com]]. [[Klik her for at hente en udgave til dig selv|http://simplenoter.tiddlyspot.com/download]]
<<tiddler ScrollBox with: [[Instruktioner]] 200px>>
the flood; moss, that had almost vanished in the dryness, expanded and
became soft, crinkly, green and juicy; and gray lichens which nearly
had turned to snuff, spread their delicate ends, puffed up like
brocade and with a sheen like that of silk. The convolvuluses let
their white crowns be filled to the brim, drank healths to each other,
and emptied the water over the heads of the nettles. The fat black
wood-snails crawled forward on their stomachs with a will, and looked
approvingly towards the sky. And the man? The man was standing
bareheaded in the midst of the downpour, letting the drops revel in
his hair and brows, eyes, nose, mouth; he snapped his fingers at the
rain, lifted a foot now and again as if he were about to dance, shook
his head sometimes, when there was too much water in the hair, and
sang at the top of his voice without knowing what he was singing, so
pre-occupied was he with the rain:
Had I, oh had I a grandson, trala,
And a chest with heaps and heaps of gold,
Then very likely had I had a daughter, trala,
And house and home and meadows untold.
Had I, oh had I a daughter dear, trala,
And house and home and meadows untold,
Then very like had I had a sweetheart, trala.
And a chest with heaps and heaps of gold.
There he stood and sang in the rain, but yonder between the dark
hazelbushes the head of a little girl was peeping out. A long end of
her shawl of red silk had become entangled in a branch which projected
a little beyond the others, and from time to time a small hand went
forward and tugged at the end, but this had no other result, further
than to produce a little shower of rain from the branch and its
neighbors. The rest of the shawl lay close round the little girl's
head and hid half of the brow; it shaded the eyes, then turned
abruptly and became lost among the leaves, but reappeared in a big
rosette of folds underneath the girl's chin. The face of the little
girl looked very astonished, she was just about to laugh; the smile
already hovered in the eyes. Suddenly he, who stood there singing in
the midst of the downpour, took a few steps to the side, saw the red
shawl, the face, the big brown eyes, the astonished little open mouth;
instantly his position became awkward, in surprise he looked down
himself; but in the same moment a small cry was heard, the projecting
branch swayed violently, the red end of the shawl disappeared in a
flash, the girl's face disappeared, and there was a rustling and
rustling further and further away behind the hazelbushes. Then he ran.
He did not know why, he did not think at all. The gay mood, which the
rainstorm had called forth, welled up in him again, and he ran after
the face of the little girl. It did not enter his head that it was a
person he pursued. To him it was only the face of a little girl. He
ran, it rustled to the right, it rustled to the left, it rustled in
front, it rustled behind, he rustled, she rustled, and all these
sounds and the running itself excited him, and he cried: "Where are
you? Say cuckoo!" Nobody answered. When he heard his own voice, he
felt just a little uneasy, but he continued running; then a thought
came to him, only a single one, and he murmured as he kept on running:
"What am I going to say to her? What am I going to say to her?" He was
approaching a big bush, there she had hid herself, he could just see a
corner of her skirt. "What am I going to say to her? What am I going
to say to her?" he kept on murmuring while he ran. He was quite near
the bush, then turned abruptly, ran on still murmuring the same, came
out upon the open road, ran a distance, stopped abruptly and burst out
laughing, walked smiling quietly a few paces, then burst out laughing
loudly again, and did not cease laughing all the way along the hedge.
It was on a beautiful autumn day; the fall of the foliage was going on
apace and the path which led to the lake was quite covered with the
citron-yellow leaves from the elms and maples; here and there were
spots of a darker foliage. It was very pleasant, very clean to walk on
this tigerskin-carpet, and to watch the leaves fall down like snow; the
birch looked even lighter and more graceful with its branches almost
bare and the roan-tree was wonderful with its heavy scarlet cluster of
berries. And the sky was so blue, so blue, and the wood seemed so much
bigger, one could look so far between the trunks. And then of course
one could not help thinking that soon all this would be of the past.
Wood, field, sky, open air, and everything soon would have to gi
/***
|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 = "";
}
};
//}}}
/***
|''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: "Please enter a password to view '%0'",
defaultText: "enter password here",
retryMsg: "'%0' is not the correct password for '%1'. Please try again:",
cancelMsg: "Sorry, you cannot access '%0' without a valid password.",
thanksMsg: "Thank you, your password has been accepted.",
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}}} //
/***
|''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 : "se ",
tooltipClose : "klik her for at lukke dette faneblad",
tooltipSave : "klik her for at gemme dette faneblad",
promptRename : "Skriv tiddlerens nye navn",
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>");
//}}}
<<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//"'
>>
/%
|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 - 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 right sidebar (MainMenu)|
Usage: <<tiddler ToggleRightSidebar with: "label">>
Config settings:
config.options.chkShowRightSidebar (false)
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||(config.browser.isSafari?'◀':'◄');
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||(config.browser.isSafari?'◀':'◄');
var labelHide=co.txtToggleRightSideBarLabelHide||'►';
place.lastChild.innerHTML=co.chkShowRightSidebar?labelHide:labelShow;
place.lastChild.title=(co.chkShowRightSidebar?'hide':'show')+' right sidebar';
}
</script>
/***
|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|newHere fullscreen closeTiddler closeOthers +editTiddler deleteTiddler > < * fields editHtml permalink > < * references syncing snapshotSave snapshotPrint jump|
|~EditToolbar|+saveTiddler saveCloseTiddler -cancelTiddler cancelCloseTiddler deleteTiddler autosizeEditor|
|invisiblecomm|k
|{{purple nowrap{<<tiddler ToggleLeftSidebar with: "(Hovedmenu)">> }}}||@@padding-left: 20px;{{purple{[[Hjælp|Instruktioner]]}}}@@||@@padding-left: 20px;<<newTiddler title: 'Skriv titlen på dit nye hovedemne her' tag: 'Emner' label: 'Nyt hovedemne' label: 'Nyt hovedemne'>>@@||padding-left: 20px;<<newTiddler title: 'Ny note' tag: 'Note' label:'Ny note'>>||@@padding-left: 20px;{{purple nowrap{<<search>><<option chkUseYourSearch>>}}}@@||@@padding-left: 20px;{{purple nowrap{<<tiddler GenOpfrisk>>}}}@@||@@padding-left: 20px;{{purple nowrap{<<tiddler HjemKnap>>}}}@@||@@padding-left: 20px;{{tiny{[[Faner til/fra »|ToggleTiddlersBar]]}}}@@||@@padding-left: 20px;{{purple{<<tiddler ToggleRightSidebar with: "(Sidepanel)">>}}}@@|
<!--{{{-->
<a style="color: #5566ff">Det ser ud som om du er ved at lave eller ændre pået hieraki af emner oppefra og ned!<br>Tilføj navnet på emnet både i øverste tekstfelt, og i sitemap slideren herunder.<br>Klik 'færdig', klik derefter på 'ny her' knappen for at lave underemner og noter indenfor dette emne.<br>Hvis du vil tilføje tekst herunder, så gør det under linien med sitemap slideren.</a>
<!--}}}-->
/***
|Name|TwHelpSearchPlugin|
|Source|http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin|
|Documentation|http://twhelp.tiddlyspot.com/#TWHelpSearchDoc|
|Version|1.0.6|
|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>> |
| titler | tekst | 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
<<<
''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 søgeresultater";
//}}}
//{{{
// Give the report a custom name
config.macros.search.reportTitle="SøgeResultater";
// 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): SøgeHjælp@@ "+"|"+"\n";
body+="|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titler <<option chkSearchText>> Tekst <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |"+"\n";
body+="\n|bgcolor(#8af): |bgcolor(#8af): @@color(#000080):sortér efter: ''Titler''@@ |bgcolor(#8af): @@color(#000080): ''Størrelse'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h";
for(var t=0;t<matches.length;t++)
body+="\n"+"| "+(t+1)+"|[["+matches[t].title+"]]| "+matches[t].text.length+"|"+"@@"+matches[t].tags+"@@"+"|";
body+="\n|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="søg igen"; // use alternate "search again" label
story.displayTiddler(null,title,1); // force refresh
config.macros.search.label=oldprompt; // restore standard search label
}
//}}}
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 02/06/2009 15:47:46 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/#%5B%5BChristian%20Asp%5D%5D]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 02/06/2009 15:49:52 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/#%5B%5BChristian%20Asp%5D%5D]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 03/06/2009 11:50:09 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 11/06/2009 15:04:13 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/#%5B%5BAnders%20Agerlund%5D%5D]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup | ok |
| 11/06/2009 15:06:48 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/#%5B%5BAnders%20Agerlunds%20synopse%5D%5D]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 16/06/2009 17:53:22 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/#%5B%5BAnders%20Agerlund%5D%5D]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 16/06/2009 17:59:02 | DitNavn | [[index.html|http://opgivelser.tiddlyspot.com/index.html]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 18/06/2009 01:08:25 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup | ok |
| 18/06/2009 01:19:02 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/#%5B%5BKathrine%20%C3%98stergaard%20Petersen%5D%5D]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
| 18/06/2009 23:56:23 | DitNavn | [[/|http://opgivelser.tiddlyspot.com/]] | [[store.cgi|http://opgivelser.tiddlyspot.com/store.cgi]] | . | [[index.html | http://opgivelser.tiddlyspot.com/index.html]] | backup |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.4|
|''Date:''|2008-08-11|
|''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: 4,
date: new Date("2008-08-11"),
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: "Gem og Upload denne TiddlyWiki med UploadMuligheder",
promptParamMacro: "Gem og upload denne TiddlyWiki i %0",
saveLabel: "gem til nettet",
saveToDisk: "gem til disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "Ingen gemme URL i parametre eller muligheder",
usernameOrPasswordMissing: "Brugernavn eller password mangler"
};
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 med muligheder",
step1Title: "Disse muligheder gemmes som cookies i din browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Fortryd",
cancelButtonPrompt: "Fortryd prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Beskrivelse", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Mulighed", type: 'String'},
{name: 'Name', field: 'name', title: "Navn", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
};
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "Den originale '%0' lader ikke til at være en rigtig TiddlyWiki",
backupSaved: "Backup gemt",
backupFailed: "Det muslykkedes at uploade en backup fil",
rssSaved: "RSS feed er uploadet",
rssFailed: "Det mislykkedes at uploade en RSS feed fil",
emptySaved: "Tom skabelon er uploadet",
emptyFailed: "Det mislykkedes at uploade en tom skabelon fil",
mainSaved: "Hoved TiddlyWiki filen er uploadet",
mainFailed: "Det mislykkedes at uploade Hoved TiddlyWiki filen. Dine ændringer er ikke blevet gemt",
//specific upload
loadOriginalHttpPostError: "Kan ikke finde den originale fil",
aboutToSaveOnHttpPost: 'Er i gang med at uploade på %0 ...',
storePhpNotFound: "Store scriptet '%0' blev ikke fundet."
};
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: "Skift UploadMuligheder og Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
//}}}
<!--{{{-->
<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>
<!--}}}-->
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.
/***
|''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.
***/
<data>{"wherekept":"Simone Madsen","bibdata":"Gyldendal 2005","author":"Hanne Åxman Christensen","primtopic":"Kærlighed"}</data>
Kilde: http://www.saxo.com/dk/item/hanne-aaxman-christensen-zehra-og-martin-haeftet.aspx
Beskrivelse
Zehra har det rigtigt svært. Hendes forældre er tyrkiske indvandrere og det er hendes far, der bestemmer alt. Og han bryder sig ikke nær så meget om Martin, som Zehra gør.. Zehra er nemlig lige blevet forlovet med en ung mand fra Tyrkiet, som hun slet ikke kender. Så skal klassen til filmlejrskole. Martin er fyr og flamme; men Zehra ved ikke, om hun overhovedet må komme med.
/***
|''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, "€");
};
})();
//}}}
<<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 [[Anna Agger Rasmussen]] [[Anne Bach Sørensen]] [[Anne Sofie Palm Hansen]] [[Boanna Stig Frølund]] [[Camilla Graff]] [[Christian Asp]] Dansk Fag [[Jeanette Bach Andreasen]] [[Kasper Hasselkvist]] [[Kathrine Østergaard Petersen]] [[Line Domino]] [[Mathias Bülow Kastbjerg]] [[Mathias Damgaard-Iversen]] [[Niels Christian Thyrrestrup Thomasen]] [[Nicholaj Hejsel Vejlgaard]] [[Patrick Rolff]] [[Simon Staunsbæk]] [[Simone Madsen]][[Anders Rahbek Hansen]] [[Anders Agerlund]] BI BK DK DO ET G HC HM Home JA JD JK K LM LS Lærere Lærere2Csv M MM [[Måns Mårtensson]] P PA PS SM St Syd T TM TN V mål news noTitle slide Ø QuickEditPackage package story framedLinks systemXConfig>>
MainMenu
[[Eksempel emne]]
<<slideShow>>
//{{{
config.options.chkHttpReadOnly = false;
config.options.chkAutoSave = false;
config.options.chkSaveBackups = true;
config.options.chkAnimate = true;
config.options.chkShowRightSidebar = false;
config.options.chkShowLeftSidebar = true;
if (window.location.protocol!="file:") showBackstage=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=true;
config.options.chkSearchShadows=false;
config.options.chkShowQuickEdit=true;
//}}}