Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
<html><a name="foo"></html>
A informação abaixo surgiu como um comentário no blog [[Bad Astronomy|http://blogs.discovermagazine.com/badastronomy/]], em um esforço para abordar os mitos e desinformações mais comuns tagarelados por aqueles que são contra o uso de vacinas (//anti-vaxers// em inglês), apesar de que essa informação também pode ser útil para responder algumas questões gerais relacionadas a vacinas que não são necessariamente "//anti-vax//". Devido ao incentivo de outros e com a ajuda de Eric TF Bat, essa informação agora possuí uma casa permanente. Com a intenção de servir como uma fonte de argumentação contra as principais alegações levantadas por //anti-vaxers//, o texto não é oferecido como aconselhamento médico. Eu o encorajo veemente a seguir os links contidos no texto e os sob a seção [[Recursos Adicionais|A verdade sobre os males da vacinação##Recursos Adicionais]]. Finalmente, sinta-se na liberdade de me mandar [[feedback|Contato]]. Aproveite!
{{{nota do tradutor:}}} Este artigo é uma tradução livre do original, que pode ser encontrado [[aqui|http://antiantivax.flurf.net/]].
{{sectionTOC{}}}
!SRC
(informações disponíveis no sites da [[FDA|http://www.fda.gov/CBER/vaccine/thimerosal.htm#t1]], [[CDC|http://www.cdc.gov/vaccines/spec-grps/hcp/downloads/vacsafe-mmr-color-office.pdf]], e nas reportagens investigativas de [[Brian Deer|http://briandeer.com/mmr/lancet-summary.htm]])
Alguns dentro do movimento //anti-vax// alegam que a vacina SRC (também conhecida como Tríplice viral, ou MMR nos EUA) possuía ou possui mercúrio. Entretanto, a vacina SRC não possuí nem nunca possuiu mercúrio dentro dela.
A base da alegação de que "a vacina SRC causa autismo" originou-se a partir de um estudo falho feito por Andrew Wakefield que, graças ao mesmo é repleto de várias violações de ética, incluindo falha em divulgar compensação financeira que recebeu de um advogado representando famílias que alegavam que a vacina SRC havia causado autismo em suas crianças, falha em divulgar interesses financeiros em patentes para alternativas a vacina, falha ao não incluir dados que contradiziam suas conclusões, e uso de amostras contaminadas para suportar sua tese.
Estudos independentes que tentaram replicar os resultados de Wakefield retornaram resultados negativos. Até o presente momento, nenhum estudo - seguindo os critérios de controle científico - conseguiu demonstrar uma correlação entre vacinas e autismo.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Hepatite B {{{(novo)}}}
Muitos //anti-vaxers// expressam preocupação em relação a vacina da [[hepatite B|http://www.cdc.gov/hepatitis/B/bFAQ.htm#bFAQ10]], normalmente alegando que a hepatite B é uma doença sexualmente transmissível. Mesmo que isso seja verdadeiro, ela também pode ser transmitida através de outras maneiras, como através do "Contato direto com o sangue e feridas abertas de uma pessoa infectada". Isso significa que se um bebê entra em contato com os fluidos corporais de um indivíduo infectado (ex.,família, visitantes de hospitais, funcionários não diagnosticados do hospital, crianças em creches ou funcionários das creches), ele então pode contrair a doença. Isso pode ser bem sério, porque quanto [[mais jovem|http://www.cdc.gov/hepatitis/B/bFAQ.htm#bFAQ09]] uma pessoa é quanto infectada, mais chances ela tem de desenvolver uma infecção crônica, o que pode levar a um [[câncer de fígado|http://www.cdc.gov/hepatitis/B/bFAQ.htm#bFAQ20]] e outras complicações sérias.
Outra preocupação levantada por anti-vaxers é a quantidade de alumínio na vacina. Veja <html><a href="#foo2">abaixo</a></html>, em Outros Adjuvantes de Vacinas para mais informações relacionadas a essa preocupação.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Timerosal
(informações disponíveis no site da [[FDA|http://www.fda.gov/BiologicsBloodVaccines/SafetyAvailability/VaccineSafety/UCM096228]] e do [[CDC|http://www.cdc.gov/vaccinesafety/Concerns/thimerosal/index.html]] )
[[Timerosal|http://www.fda.gov/BiologicsBloodVaccines/SafetyAvailability/VaccineSafety/UCM096228]] é um preservativo que é usado no processo de fabricação de algumas vacinas e de outros medicamentos para prevenir o crescimento de bactérias e fungos, que poderiam causar doenças ou lesões.
Ele é metabolizado em etilmercúrio, não metilmercúrio, um erro comumente feito por anti-vaxers que alegam que a quantidade de mercúrio que costumava ser usado nas vacinas excedia as diretrizes de exposição da EPA. Estas diretrizes eram para o metilmercúrio, um composto que possuí uma meia-vida no corpo de várias semanas a meses e é frequentemente encontrado em peixes e outras exposições ambientais. [[Etilmercúrio|http://www.ehponline.org/docs/2005/7712/abstract.pdf]], entretanto, possuí uma meia-vida de alguns dias a uma semana, o que significa que ele não fica no corpo tempo suficiente para se acumular em níveis tóxicos de vacinação em vacinação.
Ele foi removido do produto final de praticamente todas as vacinas ao redor de 2001/2002. A retirada foi uma jogada política, devido em grande parte a pressão pública, ao invés de uma sólida pesquisa científica. Foi uma recomendação e não uma exigência regulamentária. Um punhado de estudos que sugeriram problemas com o timerosal, mas que eram inconclusivos, geraram uma abordagem "melhor prevenir do que remediar" da FDA enquanto a questão era investigada pela FDA, CDC entre outros. Nenhum estudo subsequente encontrou [[qualquer risco de saúde além de hipersensibilidade local|http://www.fda.gov/BiologicsBloodVaccines/SafetyAvailability/VaccineSafety/UCM096228#act]].
Algumas vacinas ainda o usam no processo de fabricação, mas o removem do produto final, deixando, no máximo, [[vestígios|http://www.fda.gov/BiologicsBloodVaccines/SafetyAvailability/VaccineSafety/UCM096228#t1]]. A vacina contra a influenza ainda usa timerosal, embora uma versão livre de timerosal está disponível.
Apesar da remoção do timerosal das vacinas, resultando em níveis de exposição inferiores a qualquer momento no passado, índices de autismo não declinaram, sugerindo que não existe uma conexão entre timerosal e autismo
Até o presente momento, nenhum estudo propriamente controlado demonstrou uma conexão causal entre timerosal e autismo.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Esqualeno
Alguns //anti-vaxers// alegam que o [[esqualeno|http://pt.wikipedia.org/wiki/Esqualeno]], um adjuvante de vacina, é tóxico e causou a Síndrome da Guerra do Golfo (SGG) em soldados que receberam a vacina contra o antraz, supostamente contaminado por esqualeno. Entretanto [[uma revisão compreensiva da SGG|http://sph.bu.edu/insider/images/stories/resources/annual_reports/GWI%20and%20Health%20of%20GW%20Veterans_RAC-GWVI%20Report_2008.pdf]] realizada pela //Research Advisory Committee on Gulf War Veterans’ Illnesses// (Comitê Consultivo de Pesquisa de Doenças de Veteranos da Guerra do Golfo) não só observou que as vacinas não causaram a SGG, mas que os lotes implicados não continham esqualeno como adjuvante (ao invés, a vacina contra o antraz usou [[hidróxido de alumínio|http://www.fda.gov/ohrms/dockets/dockets/80n0208/80n-0208-c000037-15-01-vol151.pdf]]). Como outras alegações, os //anti-vaxers// não possuem estudos de qualidade para apoiar suas afirmações de que o esqualeno causa reações adversas severas.
De acordo com a revisão mencionada acima, o esqualeno é uma substância oleosa que ocorre naturalmente em plantas e animais. Ele é encontrado em uma variedade de comidas, loções, e cosméticos. Também é usado como suplemento alimentar e foi postulado que ele fornece benefícios terapêuticos. Em humanos, o esqualeno é sintetizado pelo fígado como um precursor do colesterol, e circula no sangue."
O esqualeno parece ser um adjuvante [[efetivo e seguro|http://www.journals.uchicago.edu/doi/full/10.1086/508174]], baseado em uma busca no ~PubMed que revela [[vários|http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2634740/?tool=pubmed]] [[estudos|http://www.journals.uchicago.edu/doi/abs/10.1086/527489?url_ver=Z39.88-2003&rfr_id=ori:rid:crossref.org&rfr_dat=cr_pub%3dncbi.nlm.nih.gov]] que [[examinam|http://www.who.int/vaccine_research/immunogenicity/82_astractvisicari.pdf]] seu [[uso|http://www.journals.uchicago.edu/doi/full/10.1086/368382]] em vacinas.
Também deve ser apontado que o esqualeno é oferecido em forma de [[pílulas|http://www.vitasprings.com/squalene-shark-liver-oil.html]] por uma variedade de lojas de comida natural e orgânica, também como desenvolvedores de suplementos alimentares. O esqualeno também é promovido como um [[hidratante|http://www.naturalhealthreference.com/beauty-health/squalane-natural-skin-moisturizer/]].
<html><a href="#foo">(Voltar ao topo)</a></html>
!Outros Adjuvantes de Vacinas
Alguns //anti-vaxers// alegam que existe anticongelante nas vacinas. Isso é falso. //Anti-vaxers// confundem o etilenoglicol com o propilenoglicol, sendo que o segundo é o composto usado nas vacinas e é considerado não-tóxico. Mais informações podem ser encontradas no site [[Inside Vaccines|http://insidevaccines.com/wordpress/2008/03/13/common-anti-vaccination-myths-and-misconceptions/]].
As vacinas contém formaldeído. Entretanto, a estrutura química do formaldeído é a mesma que é produzida pelo nosso próprio corpo. Ele é usado durante o processo de fabricação, mas é diluído para ser removido do produto final, deixando somente vestígios. A quantidade total de formaldeído no produto final [[é bem menos do que aquilo que é encontrado naturalmente no corpo humano|http://www.chop.edu/service/vaccine-education-center/hot-topics/formaldehyde.html]].
Vacinas contém alumínio em forma de sal. //Anti-vaxers// alegam que ele é tóxico, e alguns irão citar que 4ppm irá causar coagulamento do sangue. Entretanto, indivíduos não são expostos a tais quantidades de alumínio em uma única visita de vacinação. Abaixo consta uma lista de vacinas que contém alumínio, com as partes por milhão (ppm) correspondente para um infanto (~251 mL de sangue no corpo) e 36 kg. Criança (~4000 ml de sangue); note que os dois números para o ~DTaP representam faixas extremas de teor de alumínio.
{{centeredTable{
|>|>|>|>|!ppm (p/v) = (peso em grama da amostra/volume da amostra em ml) * 106|
|!Vacina|!ppm em bebês|!ppm em crianças|!idade recebida (em meses)|
|~DTaP (170mcg)|.677|.043|2, 4, 6, sem / final ~4-6 anos|
|~DTaP (625mcg)|2.490|.156| |
|Hep A|.996|.063|12 sem/ final ~6 meses. depois|
|Hep B| .996| .063| nascimento, 1 ou 2, final em 6+|
|~HiB| .896| .056| 2, 4|
|HPV| .896| .056| 11 ou 12 anos., então 2, 6 meses.|
|Pediatrix| 3.386| .213| 2, 4, 6 (em vez de ~DTaP, IPV e Hep B)|
|Pentacel| 1.315| .083| 2, 4, 6, 15-18 (em vez de ~DTaP, IPV e ~HiB)|
|Pneumococcus| .498| .031| 2, 4, 6, 12-15|
}}}
<html><a name="foo2"></html>
Alguns //anti-vaxers// alegam que a vacina da [[hepatite B|http://www.sciencebasedmedicine.org/?p=2849]], por exemplo, excede as regulamentações federais de exposição a alumínio. Entretanto, eles citam os produtos de nutrição parental de grande volume (LVP, em inglês) a 25mcg/L ([[21 CFR 201.323|http://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfCFR/CFRSearch.cfm?fr=201.323]]), os quais são fornecidos cronicamente durante um período de dias ou semanas, os invés das regulações que controlam os adjuvantes. [[21 CFR 610.15|http://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?fr=610.15]] lista a dosagem máxima de alumínio por dosagem nas vacinas, dependendo do método de calculação. As dosagens variam de .85mg (miligramas) a 1,25mg. A vacina da hepatite B contém 250mcg (microgramas) por dose, ou .25mg. LVPs tipicamente vêem em pacotes de 100mL ou mais e são administrados intravenosamente (diretamente na corrente sanguínea). A terapia total de nutrição parental (TPN, em inglês), que usa de LVPs, é tipicamente indicada para suplementação nutricional por [[>10 dias|http://www.rxkinetics.com/tpntutorial/3_1.html]] administrando-se [[2 L/dia|http://www.merck.com/mmpe/sec01/ch003/ch003c.html]]. Logo, assumindo um caso que necessita-se de TPN por 10 dias, o indivíduo seria exposto a 500mcg, duas vezes a quantidade em uma vacina.
Adicionalmente, aproximadamente 71% do alumínio é excretado do corpo após mais ou menos 5 dias.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Influenza e ~H1N1
Com a ~H1N1 aparecendo por toda a mídia esse ano, existe muita desinformação sobre o vírus e sua vacina. Segue abaixo algumas das alegações mais comuns em circulação:
Muitas pessoas alegam que a vacina da gripe suína ~H1N1 foi produzida muito rapidamente e não passou propriamente pelos testes necessários. Na verdade, a vacina passou pelos [[mesmos processos|http://www.sciencebasedmedicine.org/?p=1455#more-1455]] que a vacina contra a gripe sazonal. Diferente da gripe sazonal, que requer vários meses de estudo a cada ano para determinar quais cepas devem ser incluídas, a cepa ~H1N1 era conhecida, dispensando meses de pesquisa. A ocorrência inicial da ~H1N1 também aconteceu na época em que a produção da vacina não iria interferir com a produção da vacina sazonal, que havia acabado de finalizar produção, e quando recursos (por exemplo, ovos de galinha para crescer o vírus) ainda estavam disponíveis.
Alguns alegam que a vacina ~H1N1 contém adjuvantes, como sais de alumínio, ~AS03 ou ~MF59 (também conhecido como [[esqualeno|A verdade sobre os males da vacinação##Esqualeno]]). Entretanto, depois dos testes iniciais de eficácia, o CDC determinou que um adjuvante não seria necessário. Portanto, todas as formas da vacina ~H1N1 nos Estados Unidos são [[livres de adjuvantes|http://www.cdc.gov/h1n1flu/vaccination/vaccine_safety_qa.htm]].
Inevitavelmente, alguns irão mencionar a [[vacina|http://www.cdc.gov/ncidod/eid/vol12no01/05-1007.htm]] contra a [[gripe suína de 1976|http://pt.wikipedia.org/wiki/Surto_de_gripe_suína_de_1976]] em uma tentativa de mostrar os supostos perigos de uma nova vacina. Eles irão citar que a vacina matou mais pessoas que a gripe. Eles também irão afirmar que a vacina induziu Síndrome de ~Guillain-Barré (SGB) em seus recipientes. Embora essas afirmações sejam tecnicamente verdadeiras, sem o contexto necessário elas são enganadoras. A cepa de 1976 infectou ao redor de 13 indivíduos e matou 1. A vacina foi administrada a 48,2 milhões de pessoas, com 25 mortes ligadas a vacina, um índice de 1 a cada 2,5 milhões. Além disso, aproximadamente 532 recipientes da vacina desenvolveram SGB, um índice de [[1 a cada 100.000|http://www.cdc.gov/h1n1flu/vaccination/vaccine_safety_qa.htm]], somente um pouco acima dos índices de SGB na população não vacinada. A vacina foi distribuída antes que a cepa de 1976 fosse completamente compreendida. Apesar de compartilhar várias similaridades com a cepa que causou a pandemia de 1918, e portanto aumentou o medo de um número elevado de mortes, a cepa de 1976 não se espalhou além do Forte Dix. Em contraste, a cepa atual ~H1N1 2009 já se espalhou ao redor do mundo. Também, em 1976, o governo, a mídia e o público afobaram-se, reagindo antes que todas as informações relevantes fossem compreendidas. Clique nos links deste parágrafo para mais informação.
A severidade da gripe ~H1N1, e da gripe sazonal, é normalmente ignorada. Pessoas irão alegar que se infectado, você só vai ficar doente por uma semana, e então ficará bem. Na maioria dos casos, isso é verdade. Entretanto, a gripe sazonal mata, em média, ao redor de [[30.000 pessoas|http://www.sciencebasedmedicine.org/?p=2084]] nos EUA, e 500.000 ao redor do mundo, a cada ano. A cepa ~H1N1 2009 da gripe parece ter uma severidade similar a gripe sazonal, embora o ônus mude para [[indivíduos jovens|http://www.cdc.gov/H1N1flu/qa.htm]]. E mesmo indivíduos que sobrevivem podem precisar ser hospitalizados. Um [[estudo online|http://jama.ama-assn.org/cgi/content/full/2009.1496]] do inicio de outubro no //Journal of the American Medical Association// encontrou que doenças críticas surgiam rapidamente após a hospitalização, principalmente em adultos, necessitando o uso obrigatório de ventilação mecânica e outras terapias. Com a combinação da gripe sazonal e da ~H1N1 ocorrendo ao mesmo tempo, existem receios de que possa haver [[falta de ventiladores|http://news.google.com/news/search?aq=f&um=1&cf=all&ned=us&hl=en&q=ventilators+shortage]] e equipes médicas de apoio.
Outro mito comum é que você pode contrair a gripe a partir da vacina. Com a vacina da gripe, [[isso não pode acontecer|http://www.cdc.gov/h1n1flu/vaccination/vaccine_safety_qa.htm]], uma vez que a vacina usa um vírus (morto) desativado. A formulação inaladora usa um vírus vivo, porem enfraquecido, o que pode causar sintomas moderados semelhante aos da gripe, e existe uma pequena chance de espalhar o vírus da vacina através de contato próximo. Geralmente, só reações locais menores ocorrem. As reações mais sérias (exemplo, dor de cabeça, náusea, etc.) geralmente passam em 1 ou 2 dias, ao invés dos sintomas mais severos, de uma semana ou mais, que a infecção da influenza causaria.
Geralmente falando, tanto a vacina ~H1N1 quanto a sazonal são seguras e efetivas. Entretanto, deve ser apontado que algumas pessoas não devem receber a vacina (por exemplo, [[pessoas alérgicas a ovos|http://www.cdc.gov/flu/protect/keyfacts.htm]]). Se você possuí dúvidas ou receios, consulte o seu médico.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Poliomielite
//Anti-vaxers// alegam que os índices de pólio aumentaram após a introdução da vacina contra o pólio, que a Vacina Oral Contra o Pólio (VOCP) espalhou a doença, e que o pólio estava em declínio antes da introdução da vacina. Todas essas afirmações são falsas.
Antes da aprovação da vacina, a poliomielite paralítica atingia de treze a vinte mil indivíduos a cada ano nos EUA. O número de casos alcançou o máximo em 1952 com 21 mil indivíduos, somente três anos antes da aprovação da vacina. [[Em 1960, havia somente 2.525 casos, e somente 61 casos em 1965|http://www.cdc.gov/vaccines/vpd-vac/polio/dis-faqs.htm]].
A vacina oral contra o pólio era quase 100% efetiva na prevenção contra a poliomielite, embora possuísse um pequeno risco de causar poliomielite paralítica no paciente. Poliomielite paralítica causada pela VOCP resultou em aproximadamente 6-8 casos por ano. Entretanto, quando os níveis de vacinação estavam baixos, a VOCP tinha o benefício adicional de imunidade de contato. Em outras palavras, o vírus da vacina estava presente nas fezes, resultando em cerca de 25% das pessoas que entrarassem em contato com a pessoa imunizada [[também se tornariam imunes|http://www.chop.edu/service/vaccine-education-center/a-look-at-each-vaccine/polio-vaccine.html]].
Com a erradicação do tipo selvagem da poliomielite nos EUA, a VOCP não é mais usada, e a Vacina menos efetiva, a Poliomielite Inativada (VPI) é usada no lugar. Essa versão não causa poliomielite paralítica. [[VOCP não é usada nos EUA desde 2000|http://www.cdc.gov/vaccines/vpd-vac/polio/dis-faqs.htm]].
<html><a href="#foo">(Voltar ao topo)</a></html>
!Gardasil
O argumento mais proeminente contra a Vacina contra o HPV é de que ela foi ligada a 44 mortes (desde setembro de 2009). Esses relatórios foram feitos para o //Vaccine Adverse Event Reporting System// ([[VAERS|http://vaers.hhs.gov/vaers.htm]]). Desses relatórios, [[27 mortes reportadas|http://www.cdc.gov/vaccinesafety/Vaccines/HPV/gardasil.html]] foram confirmadas, mas nenhuma ligação causal a vacina foi encontrada após a investigação. Baseado nas [[evidências disponíveis|http://www.fda.gov/BiologicsBloodVaccines/SafetyAvailability/VaccineSafety/ucm179549.htm]], portanto, não parece que a vacina causa mortes.
Um estudo de vigilância pós-mercardo [[feito pela CDC|http://www.ncbi.nlm.nih.gov/pubmed/19690307?ordinalpos=1&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_DefaultReportPanel.Pubmed_RVDocSum]] encontrou que o índice de mortes relatados (incluindo anafilaxia) era de 0,1 a cada 100.000 doses distribuídas. A conclusão do estudo relatou que os eventos adversos não se diferenciavam de outras vacinas em geral.
Argumentos adicionais contra o Gardasil mencionam desmaiou após a imunização. Esse é um conhecido e possível efeito adverso de algumas vacinas e é incluindo na bula. A [[bula|http://www.merck.com/product/usa/pi_circulars/g/gardasil/gardasil_ppi.pdf]] também inclui recomendações de observar o paciente por pelo menos 15 minutos depois da injeção para garantir que o paciente não sofra ferimentos de uma possível queda.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Tribunal da Vacina e Programa Nacional de Compensação de Lesão Vacinal (PNCLV)
(Informações em //[[Omnibus Autism Proceeding|http://www.uscfc.uscourts.gov/omnibus-autism-proceeding]]//)
//Anti-vaxers// alegam que [[Hannah Poling|http://www.uscfc.uscourts.gov/sites/default/files/CAMPBELL-SMITH.POLING041008.pdf]] e [[Bailey Banks|http://www.uscfc.uscourts.gov/sites/default/files/Abell.BANKS.02-0738V.pdf]] são exemplos sem sucedidos de casos ouvidos no Tribunal da Vacina, onde se mostrou que vacinas causaram autismo. Isso é falso.
Descobriu-se que Hannah Poling possuía um transtorno mitocondrial, e que uma vacina havia prejudicado sua condição. A corte não jugou que vacinas causam autismo. É importante notar que uma desordem mitocondrial não é autismo, mesmo que alguns //anti-vaxers// aleguem que seja.
Já no caso de Bailey Banks, o mesmo sofreu de Encefalomielite Disseminada Aguda (EDA). Essa doença ocorre em aproximadamente 1 ou 2 em cada milhão de pacientes de vacinas, comparado com 1 a cada 1000 indivíduos infectados com sarampo e [[1 a cada 500 infectados com rubéola|http://pmj.bmj.com/content/79/927/11.full]]. O tribunal julgou que a EDA era um tipo de transtorno de desenvolvimento invasivo, mas deixou claro que não era autismo. Como no caso Poling, anti-vaxers tentam distorcer a verdade para construir seu caso. No caso da EDA, a vacinação ajudou a reduzir o risco de contrair doenças ao reduzir as chances de infecções naturais.
Apesar dos baixos padrões de provas no Tribunal da Vacina (, 50% + um fio de cabelo), ninguém conseguiu até o presente momento estabelecer uma relação causal entre vacinas e autismo.
Nos três dos melhores casos apoiados pelo movimento //anti-vaxer//, o tribunal julgou em todos os três casos que vacinas não causaram o autismo dos indivíduos envolvidos.
Antes do PNCLV, a mídia alimentou o medo sobre vacinas, levando a um aumento de processos legais e muitos fabricantes pararam suas produções de vacina completamente. O PNCLV foi proposto por uma coalizão de organizações de saúde, o governo, representantes da industria, também como médicos e cidadãos como um meio de garantir um abastecimento adequado de vacinas, e ao mesmo tempo permitindo a tomada de [[recursos legais para aqueles que poderiam vir a ser lesados pelas vacinas|http://www.hhs.gov/nvpo/factsheets/fs_tableIV_doc1.htm]].
Os indivíduos podem ainda exigir uma indenização por meio do sistema de responsabilidade civil, se escolherem essa opção, no entanto, em seguida, devem provar não só que a vacina causou o prejuízo, mas também que o fabricante foi culpado.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Sistema de Comunicação de Eventos Adversos de Vacinas (SCEAV)
Frequentemente, //anti-vaxers// apontam para o [[Sistema de Comunicação de Eventos Adversos de Vacinas|http://vaers.hhs.gov/index]] (//Vaccine Adverse Event Reporting System//, em inglês), um banco de dados que coleta relatos de eventos adversos associados com vacinas, como evidências dos males que as vacinas causam. É um banco de dados público, com capacidade de busca, patrocinado pela FDA e pela CDC, onde qualquer um pode submeter um relato. Profissionais de saúde e fabricantes de vacinas são obrigados pelo [[National Childhood Vaccine Injury Act|http://www.cdc.gov/vaccinesafety/basic/history.htm#ncvia]] a reportar eventos adversos que ocorrerem após a administração da vacina. Em relação a isso, o SCEAV serve como uma ferramenta útil para identificar possíveis tendências de dados de segurança que podem levar a investigações subsequentes e mais ações imediatas.
Apesar do SCEAV ser uma ferramenta útil, ele possuí [[limitações|http://vaers.hhs.gov/about/index#limitations]] importantes. Uma delas, talvez a mais importante quando se está lidando com alegações //anti-vax// é a de que o sistema não estabelece [[causalidade|http://vaers.hhs.gov/about/index#causality]]. Em outras palavras, os relatos encontrados no SCEAV não podem ser aceitos indiscriminadamente no sentido de que as vacinas causaram o efeito em particular. Muito dos relatos podem ser meramente coincidências. Alguns podem ser espúrios. Outros podem realmente ter uma conexão real, ao invés de aparente, entre a vacina e o efeito relatado.
Um exemplo normalmente citado para demonstrar o quão não confiável o SCEAV pode ser e o de James R. Laidler, MD. Dr Laidler submeteu um relato para o SCEAV de que a vacina contra a influenza o havia transformado no [[Hulk|http://www.neurodiversity.com/weblog/article/14/chelation-autism]]. O relato foi aceito e postado no banco de dados. Segundo o Dr. Laidler, ele foi contatado pelos representantes do banco de dados porque o seu evento adverso era muito estranho. Eles pedirem pela sua permissão para retirar o relato do banco de dados, depois de discutir com os representantes, ele concordou. Se ele não tivesse dado sua permissão, o relato ainda estaria no banco de dados do SCEAV.
No final das contas, enquanto o SCEAV pode ser uma boa ferramenta para encontrar possíveis tendências de eventos adversos relacionados a vacinas, também está sujeito a ser enviesado com dados ruins. Adicione isso ao lobbying, o esforços de grupos locais para fazer com que pessoas reportem certos eventos, e dos dados ficarem terrivelmente poluídos com informações potencialmente enganadoras. Por que isso é importante? Bem, significa ao se pesquisar no banco de dados do SCEAV, os resultados precisam ser avaliados com um certo nível de ceticismo, e que subsequentes análises mais criteriosas são necessárias. Adicionalmente, também significa que relatos em massa de conexões espúrias de eventos adversos, podem desviar recursos escassos de investigações sérias sobre riscos de saúde para perseguir fantasmas.
<html><a href="#foo">(Voltar ao topo)</a></html>
!Vacinas em Geral
//Anti-vaxers// querem que as vacinas sejam 100% seguras. Isso nunca vai acontecer, uma vez que todos os medicamentos carregam uma parcela de risco. Entretanto, o risco relativo de dano a partir de vacinas é significativamente menor do que o risco de dano ao se contrair a doença naturalmente. [[Para mais informações, veja o site da CDC|http://www.cdc.gov/vaccines/vac-gen/6mishome.htm]].
A redução nos índices de vacinação levam a um aumento dos índices de infecção. Isso foi ilustrado no Reino Unido tempo depois do errôneo estudo de Wakefield, na Alemanha em 2006 (incluindo a [[morte de duas crianças não vacinadas|http://www.who.int/bulletin/volumes/87/2/07-050187/en/index.html]]), na [[Califórnia|http://www.cdc.gov/mmwr/preview/mmwrhtml/mm57e222a1.htm]], em MN (onde uma [[criança não vacinada morreu de Haemophilus influenza tipo b|http://www.emaxhealth.com/1020/50/28863/minnesota-child-dies-lack-hib-meningitis-vaccination.html]]).
//Anti-vaxers// alegam que as "Grandes Corporações Farmacêuticas" e médicos ganham bastante dinheiro com vacinas. Se os índices de vacinação caíssem, entretanto, haveria um aumento do índice de doenças preventivas, muitas das quais possuem altos índices de complicações que resultam em caros tratamentos e hospitalizações. Veja o link sobre a Alemanha acima para verificar informações sobre os custos associados com a epidemia de sarampo no país. O dinheiro que pode ser feito das doenças supera de longe o dinheiro que pode ser feito em cima das vacinas. Adicione isso ao fato de que um [[artigo|http://money.cnn.com/2009/09/08/news/economy/health_care_vaccinations/index.htm]] de 11 de setembro de 2009 mostrando que alguns doutores não tinham recursos para administrar vacinas devida à falta de reembolso das companhias de seguro.
//Anti-vaxers// alegam que uma melhora na higiene levou a diminuição de doenças, ao invés das vacinas. Entretanto, muitas doenças prevenidas por vacinas são transmitidas pelo ar, e não são grandemente reduzidas pela melhora da higiene ou do saneamento básico.
//Anti-vaxers// alegam que muitos antígenos (as partes que fazem as vacinas funcionarem) são dados de uma vez só, ignorando o fato de que bebês e crianças são expostas a milhares de antígenos todos os dias ao tocar nas coisas ou colocando suas mãos ou os objetos na boca, através de aborção e inalação.
Alguns alegam que a combinação de vacinas deve ser evitada, e que pais devem dividir as vacinações em vacinas individuais e espalhá-las ao longo do ano. Entretanto, isso aumenta o número total de vacinas recebidas, também como aumenta a exposição aquelas "toxinas" que //anti-vaxers// odeiam tanto.
Alguns dentro do movimento //anti-vax// afirmam que um calendário de vacinas alternativo mais espaçado ao longo do ano é melhor, entretanto eles não possuem evidências científicas para suportar tal protocolo. Eles também alegam que o calendário recomendado pela CDC e pela //American Academy of Pediatrics// não é baseado em estudos científicos. Isso [[não é verdade|http://www.cispimmunize.org/pro/pdf/Vaccineschedule.pdf]]. A cada ano, o calendário é revisto em luz dos mais recentes estudos científicos em vacinas e revisado se necessário, com as recomendações mais recentes sendo publicadas em janeiro.
Até hoje não houve um estudo propriamente controlado que estabelecesse uma ligação causal entre vacinas e autismo.
Até o presente momento, vários estudos propriamente controlados, financiados e realizados por várias pessoas e organizações ao redor do mundo, demonstraram que não há nenhuma ligação entre vacinas e autismo.
<html><a href="#foo">(Voltar ao topo)</a></html>
!População X e Vacinas/Autismo
//Anti-vaxers// alegam que os Amish não realizam vacinações e não tem autismo. Essa afirmação origina-se em uma mentira de Dan Olmsted do site //Age of Austism//. Os Amish, na verdade, [[realizam vacinações|http://combatingautismfromwithin.blogspot.com/2008/01/guess-what-amish-vaccinate.html]],e parece que seus índices de autismo são menores do que o da população em geral.
Alguns alegam que os chineses não possuem uma palavra para autismo (eles tem, 自闭症 [zì bì zhèng]). E simplesmente não ter uma palavra para a doença não quer dizer que ela não existe, somente que não é reconhecida como um transtorno especifico. O autismo só afligia as pessoas depois que alguém criou o diagnóstico? Não, sem falar que ele pode ter sido chamado de outra coisa.
A mesma alegação sobre os chineses foi feita sobre os Somalianos devido a um artigo sobre [[Somalianos em Minnesota de 16 de março de 2009|http://www.nytimes.com/2009/03/17/health/17auti.html?_r=1&ref=science&pagewanted=all]]. Novamente, a falta de reconhecimento não significa que a doença nunca ocorreu entre essa população. Além disso, o caso em Minnesota não possui uma conexão consistente com vacinas. Alguns dos que possuíam autismo foram vacinados, e outros não foram. Apesar da falta de evidências, //Generation Rescue// (que administra o site //Age of Autism//) disse aos pais somalianos que as vacinas haviam sido a causa.
<html><a href="#foo">(Voltar ao topo)</a></html>
!9 Perguntas que deixam os defensores da vacinação "perplexos" {{{(Em breve)}}}
!Recursos Adicionais
Site com informação sobre segurança de vacinas, eficácia e informações em geral:
*[[U.S. Centers for Disease Control and Prevention (CDC)|http://www.cdc.gov/vaccines/]]
*[[Get the Picture: Child Immunizations|http://www.youtube.com/watch?v=3uVvq7dbf4s]] - Vídeo do Youtube da CDC.
*[[U.S. Food and Drug Administration (FDA)|http://www.fda.gov/cber/vaccines.htm]]
*[[American Academy of Pediatrics (AAP)|http://www.aap.org/healthtopics/Immunizations.cfm]]
*[[The Childhood Immunization Schedule: Why Is It Like That?|http://www.cispimmunize.org/pro/pdf/Vaccineschedule.pdf]]
*[[Health Canada|http://www.hc-sc.gc.ca/hl-vs/iyh-vsv/med/misconception-eng.php]]
*[[Vaccine Adverse Event Reporting System (VAERS)|http://vaers.hhs.gov/index]]
*[[U.K. Medicines and Health products Regulatory Agency|http://www.mhra.gov.uk/Safetyinformation/Generalsafetyinformationandadvice/Product-specificinformationandadvice/Vaccinesafety/index.htm]]
*[[Immunization Advisory Centre (IMAC)|http://www.immune.org.nz/?t=899]] na Universidade de Aukland, Nova Zelândia.
*[[Australian Immunization Handbook|http://www.health.act.gov.au/c/health?a=dlpubpoldoc&document=1030]] - arquivo pdf grande.
*[[World Health Organization (WHO)|http://www.who.int/topics/vaccines/en/]]
*[[World Health Organization - "Global Immunization Data October 2008"|http://www.who.int/immunization/newsroom/global_immunization_data_october2008.pdf]]
*[[Pan-American Health Organization (PAHO)|http://www.paho.org/English/ad/fch/im/Vaccines.htm]]
*[[Every Child By Two|http://www.ecbt.org/]]
*[[Vaccinate Your Baby|http://www.vaccinateyourbaby.org/]]
*[[Vaccine Information for the Public and Health Professionals|http://www.vaccineinformation.org/]] - tem links para fotos e vídeos do impacto de doença prevenidas por vacinas ({{{aviso:algumas dessas imagens podem ser gráficas e perturbadoras}}}).
Sites com informações sobre testes clínicos e outras pesquisas:
*[[ClinicalTrials.gov|http://clinicaltrials.gov/]]
*[[PubMed|http://www.ncbi.nlm.nih.gov/pubmed/]]
Outros sites:
*[[Autism Science Foundation|http://www.autismsciencefoundation.org/]]
*[[Respectful Insolence|http://scienceblogs.com/insolence/]]
*[[Science-Based Medicine|http://www.sciencebasedmedicine.org/]]
*[[BlogHer - "My Child Has Autism and I Vaccinate"|http://www.blogher.com/my-child-has-autism-and-i-vaccinate]]
*[[Skeptic.com - "Vaccines and Autism: A Deadly Manufactroversy"|http://www.skeptic.com/eskeptic/09-06-03#feature]] - História do movimento anti-vax por Dr. Harriet Hall.
*[[WiseGeek - "What is Herd Immunity?"|http://www.wisegeek.com/what-is-herd-immunity.htm]]
*Do Vaccines Cause Autism? Correlation vs. Causation ([[parte 1|http://www.youtube.com/watch?v=VW1IEqKuf6s&feature=player_embedded]] and [[parte 2|http://www.youtube.com/watch?v=8Tl3tUQng9Q&feature=related]]) - vídeos por um virologista
*[[The Skeptic's Dictionary|http://www.skepdic.com/antivaccination.html]]
<html><a href="#foo">(Voltar ao topo)</a></html>
----
Este texto é uma tradução livre do texto [[The Truth About The Evils Of Vaccination|http://antiantivax.flurf.net/]] no site antiantivax.flurf.net. O texto original foi postado por [[Todd W|mailto:todd@flurf.net]] inicialmente em um artigo do blog [[Bad Astronomy|http://blogs.discovermagazine.com/badastronomy/]] intitulado [[Jim Carrey loves the movement|http://blogs.discovermagazine.com/badastronomy/2009/04/23/jim-carrey-loves-the-pro-disease-movement/]] em uma quinta feira, 23 de abril de 2009. Ele foi repostado como uma cortesia ao autor original por [[Eric TF Bat|http://flurf.net/]].
<<sectionTOC>>
<html><img src="http://vila.bol.com.br/contador.gif"></html>
/***
|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;
}
});
//}}}
Sugestões, críticas, correções ou informações adicionais:
[[rickhora(arroba)gmail.com|mailto:rickhora@gmail.com]]
[[A verdade sobre os males da vacinação]]
/***
|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:|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);
}}
});
//}}}
/***
|Name:|InstantTimestampPlugin|
|Description:|A handy way to insert timestamps in your tiddler content|
|Version:|1.0.10 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#InstantTimestampPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Usage
If you enter {ts} in your tiddler content (without the spaces) it will be replaced with a timestamp when you save the tiddler. Full list of formats:
* {ts} or {t} -> timestamp
* {ds} or {d} -> datestamp
* !ts or !t at start of line -> !!timestamp
* !ds or !d at start of line -> !!datestamp
(I added the extra ! since that's how I like it. Remove it from translations below if required)
!!Notes
* Change the timeFormat and dateFormat below to suit your preference.
* See also http://mptw2.tiddlyspot.com/#AutoCorrectPlugin
* You could invent other translations and add them to the translations array below.
***/
//{{{
config.InstantTimestamp = {
// adjust to suit
timeFormat: 'DD/0MM/YY 0hh:0mm',
dateFormat: 'DD/0MM/YY',
translations: [
[/^!ts?$/img, "'!!{{ts{'+now.formatString(config.InstantTimestamp.timeFormat)+'}}}'"],
[/^!ds?$/img, "'!!{{ds{'+now.formatString(config.InstantTimestamp.dateFormat)+'}}}'"],
// thanks Adapted Cat
[/\{ts?\}(?!\}\})/ig,"'{{ts{'+now.formatString(config.InstantTimestamp.timeFormat)+'}}}'"],
[/\{ds?\}(?!\}\})/ig,"'{{ds{'+now.formatString(config.InstantTimestamp.dateFormat)+'}}}'"]
],
excludeTags: [
"noAutoCorrect",
"noTimestamp",
"html",
"CSS",
"css",
"systemConfig",
"systemConfigDisabled",
"zsystemConfig",
"Plugins",
"Plugin",
"plugins",
"plugin",
"javascript",
"code",
"systemTheme",
"systemPalette"
],
excludeTiddlers: [
"StyleSheet",
"StyleSheetLayout",
"StyleSheetColors",
"StyleSheetPrint"
// more?
]
};
TiddlyWiki.prototype.saveTiddler_mptw_instanttimestamp = TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler = function(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created) {
tags = tags ? tags : []; // just in case tags is null
tags = (typeof(tags) == "string") ? tags.readBracketedList() : tags;
var conf = config.InstantTimestamp;
if ( !tags.containsAny(conf.excludeTags) && !conf.excludeTiddlers.contains(newTitle) ) {
var now = new Date();
var trans = conf.translations;
for (var i=0;i<trans.length;i++) {
newBody = newBody.replace(trans[i][0], eval(trans[i][1]));
}
}
// TODO: use apply() instead of naming all args?
return this.saveTiddler_mptw_instanttimestamp(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created);
}
// you can override these in StyleSheet
setStylesheet(".ts,.ds { font-style:italic; }","instantTimestampStyles");
//}}}
/***
|Name:|LessBackupsPlugin|
|Description:|Intelligently limit the number of backup files you create|
|Version:|3.0.1 ($Rev: 2320 $)|
|Date:|$Date: 2007-06-18 22:37:46 +1000 (Mon, 18 Jun 2007) $|
|Source:|http://mptw.tiddlyspot.com/#LessBackupsPlugin|
|Author:|Simon Baird|
|Email:|simon.baird@gmail.com|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Description
You end up with just backup one per year, per month, per weekday, per hour, minute, and second. So total number won't exceed about 200 or so. Can be reduced by commenting out the seconds/minutes/hours line from modes array
!!Notes
Works in IE and Firefox only. Algorithm by Daniel Baird. IE specific code by by Saq Imtiaz.
***/
//{{{
var MINS = 60 * 1000;
var HOURS = 60 * MINS;
var DAYS = 24 * HOURS;
if (!config.lessBackups) {
config.lessBackups = {
// comment out the ones you don't want or set config.lessBackups.modes in your 'tweaks' plugin
modes: [
["YYYY", 365*DAYS], // one per year for ever
["MMM", 31*DAYS], // one per month
["ddd", 7*DAYS], // one per weekday
//["d0DD", 1*DAYS], // one per day of month
["h0hh", 24*HOURS], // one per hour
["m0mm", 1*HOURS], // one per minute
["s0ss", 1*MINS], // one per second
["latest",0] // always keep last version. (leave this).
]
};
}
window.getSpecialBackupPath = function(backupPath) {
var now = new Date();
var modes = config.lessBackups.modes;
for (var i=0;i<modes.length;i++) {
// the filename we will try
var specialBackupPath = backupPath.replace(/(\.)([0-9]+\.[0-9]+)(\.html)$/,
'$1'+now.formatString(modes[i][0]).toLowerCase()+'$3')
// open the file
try {
if (config.browser.isIE) {
var fsobject = new ActiveXObject("Scripting.FileSystemObject")
var fileExists = fsobject.FileExists(specialBackupPath);
if (fileExists) {
var fileObject = fsobject.GetFile(specialBackupPath);
var modDate = new Date(fileObject.DateLastModified).valueOf();
}
}
else {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(specialBackupPath);
var fileExists = file.exists();
if (fileExists) {
var modDate = file.lastModifiedTime;
}
}
}
catch(e) {
// give up
return backupPath;
}
// expiry is used to tell if it's an 'old' one. Eg, if the month is June and there is a
// June file on disk that's more than an month old then it must be stale so overwrite
// note that "latest" should be always written because the expiration period is zero (see above)
var expiry = new Date(modDate + modes[i][1]);
if (!fileExists || now > expiry)
return specialBackupPath;
}
}
// hijack the core function
window.getBackupPath_mptw_orig = window.getBackupPath;
window.getBackupPath = function(localPath) {
return getSpecialBackupPath(getBackupPath_mptw_orig(localPath));
}
//}}}
MPTW is a distribution or edition of TiddlyWiki that includes a standard TiddlyWiki core packaged with some plugins designed to improve usability and provide a better way to organise your information. For more information see http://mptw.tiddlyspot.com/.
[[Principal|A verdade sobre os males da vacinação]] [[Contato]]
<html>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3038072-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</html>
<html>
<center>
<!-- AddThis Button BEGIN -->
<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&username=xa-4c64b07109304bce"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4c64b07109304bce"></script>
<!-- AddThis Button END -->
</center>
</html>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Name: MptwBlack
Background: #000
Foreground: #fff
PrimaryPale: #333
PrimaryLight: #555
PrimaryMid: #888
PrimaryDark: #aaa
SecondaryPale: #111
SecondaryLight: #222
SecondaryMid: #555
SecondaryDark: #888
TertiaryPale: #222
TertiaryLight: #666
TertiaryMid: #888
TertiaryDark: #aaa
Error: #300
This is in progress. Help appreciated.
Name: MptwBlue
Background: #fff
Foreground: #000
PrimaryPale: #cdf
PrimaryLight: #57c
PrimaryMid: #114
PrimaryDark: #012
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
(function($){
merge(config.macros,{
mptwCollapse: {
handler: function(place,macroName,params) {
createTiddlyButton(place, params[0] == '+' ? '\u25AD' : '\u25AC', 'collapse/uncollapse', function(){
$(story.findContainingTiddler(place)).toggleClass('collapsed');
});
}
}
});
/* this doesn't work unless you have a modified ViewTempate */
config.shadowTiddlers["MptwCollapsePluginStyles"] = ""
+".collapsed .uncollapsedView { display:none; }"
+".collapsedView { display:none; }"
+".collapsed .collapsedView { display:block; }"
+".tiddler.collapsed { padding-bottom:1em; }"
+".tiddler.collapsed .title { font-size:100%; }"
;
store.addNotification("MptwCollapsePluginStyles",refreshStyles);
})(jQuery);
/***
|Name:|MptwConfigPlugin|
|Description:|Miscellaneous tweaks used by MPTW|
|Version:|1.0 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#MptwConfigPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#MptwConfigPlugin|
!!Note: instead of editing this you should put overrides in MptwUserConfigPlugin
***/
//{{{
var originalReadOnly = readOnly;
var originalShowBackstage = showBackstage;
config.options.chkHttpReadOnly = false; // means web visitors can experiment with your site by clicking edit
readOnly = false; // needed because the above doesn't work any more post 2.1 (??)
showBackstage = true; // show backstage for same reason
config.options.chkInsertTabs = true; // tab inserts a tab when editing a tiddler
config.views.wikified.defaultText = ""; // don't need message when a tiddler doesn't exist
config.views.editor.defaultText = ""; // don't need message when creating a new tiddler
config.options.chkSaveBackups = true; // do save backups
config.options.txtBackupFolder = 'twbackup'; // put backups in a backups folder
config.options.chkAutoSave = (window.location.protocol == "file:"); // do autosave if we're in local file
config.mptwVersion = "2.5.3";
config.macros.mptwVersion={handler:function(place){wikify(config.mptwVersion,place);}};
if (config.options.txtTheme == '')
config.options.txtTheme = 'MptwTheme';
// add to default GettingStarted
config.shadowTiddlers.GettingStarted += "\n\nSee also [[MPTW]].";
// add select theme and palette controls in default OptionsPanel
config.shadowTiddlers.OptionsPanel = config.shadowTiddlers.OptionsPanel.replace(/(\n\-\-\-\-\nAlso see AdvancedOptions)/, "{{select{<<selectTheme>>\n<<selectPalette>>}}}$1");
// these are used by ViewTemplate
config.mptwDateFormat = 'DD/MM/YY';
config.mptwJournalFormat = 'Journal DD/MM/YY';
//}}}
Name: MptwGreen
Background: #fff
Foreground: #000
PrimaryPale: #9b9
PrimaryLight: #385
PrimaryMid: #031
PrimaryDark: #020
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
Name: MptwRed
Background: #fff
Foreground: #000
PrimaryPale: #eaa
PrimaryLight: #c55
PrimaryMid: #711
PrimaryDark: #500
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
|Name|MptwRounded|
|Description|Mptw Theme with some rounded corners (Firefox only)|
|ViewTemplate|MptwTheme##ViewTemplate|
|EditTemplate|MptwTheme##EditTemplate|
|PageTemplate|MptwTheme##PageTemplate|
|StyleSheet|##StyleSheet|
!StyleSheet
/*{{{*/
[[MptwTheme##StyleSheet]]
.tiddler,
.sliderPanel,
.button,
.tiddlyLink,
.tabContents
{ -moz-border-radius: 1em; }
.tab {
-moz-border-radius-topleft: 0.5em;
-moz-border-radius-topright: 0.5em;
}
#topMenu {
-moz-border-radius-bottomleft: 2em;
-moz-border-radius-bottomright: 2em;
}
/*}}}*/
Name: MptwSmoke
Background: #fff
Foreground: #000
PrimaryPale: #aaa
PrimaryLight: #777
PrimaryMid: #111
PrimaryDark: #000
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
|Name|MptwStandard|
|Description|Mptw Theme with the default TiddlyWiki PageLayout and Styles|
|ViewTemplate|MptwTheme##ViewTemplate|
|EditTemplate|MptwTheme##EditTemplate|
Name: MptwTeal
Background: #fff
Foreground: #000
PrimaryPale: #B5D1DF
PrimaryLight: #618FA9
PrimaryMid: #1a3844
PrimaryDark: #000
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #f8f8f8
TertiaryLight: #bbb
TertiaryMid: #999
TertiaryDark: #888
Error: #f88
|Name|MptwTheme|
|Description|Mptw Theme including custom PageLayout|
|PageTemplate|##PageTemplate|
|ViewTemplate|##ViewTemplate|
|EditTemplate|##EditTemplate|
|StyleSheet|##StyleSheet|
http://mptw.tiddlyspot.com/#MptwTheme ($Rev: 1829 $)
!PageTemplate
<!--{{{-->
<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>
<!-- horizontal MainMenu -->
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
<!-- original MainMenu menu -->
<!-- <div id='mainMenu' refresh='content' tiddler='MainMenu'></div> -->
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
!ViewTemplate
<!--{{{-->
[[MptwTheme##ViewTemplateToolbar]]
<div class="tagglyTagged" macro="tags"></div>
<div class='titleContainer'>
<span class='title' macro='view title'></span>
<span macro="miniTag"></span>
</div>
<div class='subtitle'>
(updated <span macro='view modified date {{config.mptwDateFormat?config.mptwDateFormat:"MM/0DD/YY"}}'></span>
by <span macro='view modifier link'></span>)
<!--
(<span macro='message views.wikified.createdPrompt'></span>
<span macro='view created date {{config.mptwDateFormat?config.mptwDateFormat:"MM/0DD/YY"}}'></span>)
-->
</div>
<div macro="showWhen tiddler.tags.containsAny(['css','html','pre','systemConfig']) && !tiddler.text.match('{{'+'{')">
<div class='viewer'><pre macro='view text'></pre></div>
</div>
<div macro="else">
<div class='viewer' macro='view text wikified'></div>
</div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<!--}}}-->
!ViewTemplateToolbar
<!--{{{-->
<div class='toolbar'>
<span macro="showWhenTagged systemConfig">
<span macro="toggleTag systemConfigDisable . '[[disable|systemConfigDisable]]'"></span>
</span>
<span macro="showWhenTagged systemTheme"><span macro="applyTheme"></span></span>
<span macro="showWhenTagged systemPalette"><span macro="applyPalette"></span></span>
<span macro="showWhen tiddler.tags.contains('css') || tiddler.title == 'StyleSheet'"><span macro="refreshAll"></span></span>
<span style="padding:1em;"></span>
<span macro='toolbar closeTiddler closeOthers +editTiddler deleteTiddler > fields syncing permalink references jump'></span> <span macro='newHere label:"new here"'></span>
<span macro='newJournalHere {{config.mptwJournalFormat?config.mptwJournalFormat:"MM/0DD/YY"}}'></span>
</div>
<!--}}}-->
!EditTemplate
<!--{{{-->
<div class="toolbar" macro="toolbar +saveTiddler saveCloseTiddler closeOthers -cancelTiddler cancelCloseTiddler deleteTiddler"></div>
<div class="title" macro="view title"></div>
<div class="editLabel">Title</div><div class="editor" macro="edit title"></div>
<div macro='annotations'></div>
<div class="editLabel">Content</div><div class="editor" macro="edit text"></div>
<div class="editLabel">Tags</div><div class="editor" macro="edit tags"></div>
<div class="editorFooter"><span macro="message views.editor.tagPrompt"></span><span macro="tagChooser"></span></div>
<!--}}}-->
!StyleSheet
/*{{{*/
/* a contrasting background so I can see where one tiddler ends and the other begins */
body {
background: [[ColorPalette::TertiaryLight]];
}
/* sexy colours and font for the header */
.headerForeground {
color: [[ColorPalette::PrimaryPale]];
}
.headerShadow, .headerShadow a {
color: [[ColorPalette::PrimaryMid]];
}
/* separate the top menu parts */
.headerForeground, .headerShadow {
padding: 1em 1em 0;
}
.headerForeground, .headerShadow {
font-family: 'Trebuchet MS' sans-serif;
font-weight:bold;
}
.headerForeground .siteSubtitle {
color: [[ColorPalette::PrimaryLight]];
}
.headerShadow .siteSubtitle {
color: [[ColorPalette::PrimaryMid]];
}
/* make shadow go and down right instead of up and left */
.headerShadow {
left: 1px;
top: 1px;
}
/* prefer monospace for editing */
.editor textarea, .editor input {
font-family: 'Consolas' monospace;
background-color:[[ColorPalette::TertiaryPale]];
}
/* sexy tiddler titles */
.title {
font-size: 250%;
color: [[ColorPalette::PrimaryLight]];
font-family: 'Trebuchet MS' sans-serif;
}
/* more subtle tiddler subtitle */
.subtitle {
padding:0px;
margin:0px;
padding-left:1em;
font-size: 90%;
color: [[ColorPalette::TertiaryMid]];
}
.subtitle .tiddlyLink {
color: [[ColorPalette::TertiaryMid]];
}
/* a little bit of extra whitespace */
.viewer {
padding-bottom:3px;
}
/* don't want any background color for headings */
h1,h2,h3,h4,h5,h6 {
background-color: transparent;
color: [[ColorPalette::Foreground]];
}
/* give tiddlers 3d style border and explicit background */
.tiddler {
background: [[ColorPalette::Background]];
border-right: 2px [[ColorPalette::TertiaryMid]] solid;
border-bottom: 2px [[ColorPalette::TertiaryMid]] solid;
margin-bottom: 1em;
padding:1em 2em 2em 1.5em;
}
/* make options slider look nicer */
#sidebarOptions .sliderPanel {
border:solid 1px [[ColorPalette::PrimaryLight]];
}
/* the borders look wrong with the body background */
#sidebar .button {
border-style: none;
}
/* this means you can put line breaks in SidebarOptions for readability */
#sidebarOptions br {
display:none;
}
/* undo the above in OptionsPanel */
#sidebarOptions .sliderPanel br {
display:inline;
}
/* horizontal main menu stuff */
#displayArea {
margin: 1em 15.7em 0em 1em; /* use the freed up space */
}
#topMenu br {
display: none;
}
#topMenu {
background: [[ColorPalette::PrimaryMid]];
color:[[ColorPalette::PrimaryPale]];
}
#topMenu {
padding:2px;
}
#topMenu .button, #topMenu .tiddlyLink, #topMenu a {
margin-left: 0.5em;
margin-right: 0.5em;
padding-left: 3px;
padding-right: 3px;
color: [[ColorPalette::PrimaryPale]];
font-size: 115%;
}
#topMenu .button:hover, #topMenu .tiddlyLink:hover {
background: [[ColorPalette::PrimaryDark]];
}
/* make 2.2 act like 2.1 with the invisible buttons */
.toolbar {
visibility:hidden;
}
.selected .toolbar {
visibility:visible;
}
/* experimental. this is a little borked in IE7 with the button
* borders but worth it I think for the extra screen realestate */
.toolbar { float:right; }
/* fix for TaggerPlugin. from sb56637. improved by FND */
.popup li .tagger a {
display:inline;
}
/* makes theme selector look a little better */
#sidebarOptions .sliderPanel .select .button {
padding:0.5em;
display:block;
}
#sidebarOptions .sliderPanel .select br {
display:none;
}
/* make it print a little cleaner */
@media print {
#topMenu {
display: none ! important;
}
/* not sure if we need all the importants */
.tiddler {
border-style: none ! important;
margin:0px ! important;
padding:0px ! important;
padding-bottom:2em ! important;
}
.tagglyTagging .button, .tagglyTagging .hidebutton {
display: none ! important;
}
.headerShadow {
visibility: hidden ! important;
}
.tagglyTagged .quickopentag, .tagged .quickopentag {
border-style: none ! important;
}
.quickopentag a.button, .miniTag {
display: none ! important;
}
}
/* get user styles specified in StyleSheet */
[[StyleSheet]]
/*}}}*/
|Name|MptwTrim|
|Description|Mptw Theme with a reduced header to increase useful space|
|ViewTemplate|MptwTheme##ViewTemplate|
|EditTemplate|MptwTheme##EditTemplate|
|StyleSheet|MptwTheme##StyleSheet|
|PageTemplate|##PageTemplate|
!PageTemplate
<!--{{{-->
<!-- horizontal MainMenu -->
<div id='topMenu' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<span refresh='content' tiddler='SiteTitle' style="padding-left:1em;font-weight:bold;"></span>:
<span refresh='content' tiddler='MainMenu'></span>
</div>
<div id='sidebar'>
<div id='sidebarOptions'>
<div refresh='content' tiddler='SideBarOptions'></div>
<div style="margin-left:0.1em;"
macro='slider chkTabSliderPanel SideBarTabs {{"tabs \u00bb"}} "Show Timeline, All, Tags, etc"'></div>
</div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
For upgrading. See [[ImportTiddlers]].
URL: http://mptw.tiddlyspot.com/upgrade.html
/***
|Description:|A place to put your config tweaks so they aren't overwritten when you upgrade MPTW|
See http://www.tiddlywiki.org/wiki/Configuration_Options for other options you can set. In some cases where there are clashes with other plugins it might help to rename this to zzMptwUserConfigPlugin so it gets executed last.
***/
//{{{
// example: set your preferred date format
//config.mptwDateFormat = 'MM/0DD/YY';
//config.mptwJournalFormat = 'Journal MM/0DD/YY';
// example: set the theme you want to start with
//config.options.txtTheme = 'MptwRoundTheme';
// example: switch off autosave, switch on backups and set a backup folder
//config.options.chkSaveBackups = true;
//config.options.chkAutoSave = false;
//config.options.txtBackupFolder = 'backups';
// uncomment to disable 'new means new' functionality for the new journal macro
//config.newMeansNewForJournalsToo = false;
//}}}
/***
|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:|NewMeansNewPlugin|
|Description:|If 'New Tiddler' already exists then create 'New Tiddler (1)' and so on|
|Version:|1.1.1 ($Rev: 2263 $)|
|Date:|$Date: 2007-06-13 04:22:32 +1000 (Wed, 13 Jun 2007) $|
|Source:|http://mptw.tiddlyspot.com/empty.html#NewMeansNewPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Note: I think this should be in the core
***/
//{{{
// change this or set config.newMeansNewForJournalsToo it in MptwUuserConfigPlugin
if (config.newMeansNewForJournalsToo == undefined) config.newMeansNewForJournalsToo = true;
String.prototype.getNextFreeName = function() {
var numberRegExp = / \(([0-9]+)\)$/;
var match = numberRegExp.exec(this);
if (match) {
var num = parseInt(match[1]) + 1;
return this.replace(numberRegExp," ("+num+")");
}
else {
return this + " (1)";
}
}
config.macros.newTiddler.checkForUnsaved = function(newName) {
var r = false;
story.forEachTiddler(function(title,element) {
if (title == newName)
r = true;
});
return r;
}
config.macros.newTiddler.getName = function(newName) {
while (store.getTiddler(newName) || config.macros.newTiddler.checkForUnsaved(newName))
newName = newName.getNextFreeName();
return newName;
}
config.macros.newTiddler.onClickNewTiddler = function()
{
var title = this.getAttribute("newTitle");
if(this.getAttribute("isJournal") == "true") {
title = new Date().formatString(title.trim());
}
// ---- these three lines should be the only difference between this and the core onClickNewTiddler
if (config.newMeansNewForJournalsToo || this.getAttribute("isJournal") != "true")
title = config.macros.newTiddler.getName(title);
var params = this.getAttribute("params");
var tags = params ? params.split("|") : [];
var focus = this.getAttribute("newFocus");
var template = this.getAttribute("newTemplate");
var customFields = this.getAttribute("customFields");
if(!customFields && !store.isShadowTiddler(title))
customFields = String.encodeHashMap(config.defaultCustomFields);
story.displayTiddler(null,title,template,false,null,null);
var tiddlerElem = story.getTiddler(title);
if(customFields)
story.addCustomFields(tiddlerElem,customFields);
var text = this.getAttribute("newText");
if(typeof text == "string")
story.getTiddlerField(title,"text").value = text.format([title]);
for(var t=0;t<tags.length;t++)
story.setTiddlerTag(title,tags[t],+1);
story.focusTiddler(title,focus);
return false;
};
//}}}
/***
|Name:|PrettyDatesPlugin|
|Description:|Provides a new date format ('pppp') that displays times such as '2 days ago'|
|Version:|1.0 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#PrettyDatesPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Notes
* If you want to you can rename this plugin. :) Some suggestions: LastUpdatedPlugin, RelativeDatesPlugin, SmartDatesPlugin, SexyDatesPlugin.
* Inspired by http://ejohn.org/files/pretty.js
***/
//{{{
Date.prototype.prettyDate = function() {
var diff = (((new Date()).getTime() - this.getTime()) / 1000);
var day_diff = Math.floor(diff / 86400);
if (isNaN(day_diff)) return "";
else if (diff < 0) return "in the future";
else if (diff < 60) return "just now";
else if (diff < 120) return "1 minute ago";
else if (diff < 3600) return Math.floor(diff/60) + " minutes ago";
else if (diff < 7200) return "1 hour ago";
else if (diff < 86400) return Math.floor(diff/3600) + " hours ago";
else if (day_diff == 1) return "Yesterday";
else if (day_diff < 7) return day_diff + " days ago";
else if (day_diff < 14) return "a week ago";
else if (day_diff < 31) return Math.ceil(day_diff/7) + " weeks ago";
else if (day_diff < 62) return "a month ago";
else if (day_diff < 365) return "about " + Math.ceil(day_diff/31) + " months ago";
else if (day_diff < 730) return "a year ago";
else return Math.ceil(day_diff/365) + " years ago";
}
Date.prototype.formatString_orig_mptw = Date.prototype.formatString;
Date.prototype.formatString = function(template) {
return this.formatString_orig_mptw(template).replace(/pppp/,this.prettyDate());
}
// for MPTW. otherwise edit your ViewTemplate as required.
// config.mptwDateFormat = 'pppp (DD/MM/YY)';
config.mptwDateFormat = 'pppp';
//}}}
/***
|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:|RenameTagsPlugin|
|Description:|Allows you to easily rename or delete tags across multiple tiddlers|
|Version:|3.0 ($Rev: 5501 $)|
|Date:|$Date: 2008-06-10 23:11:55 +1000 (Tue, 10 Jun 2008) $|
|Source:|http://mptw.tiddlyspot.com/#RenameTagsPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
Rename a tag and you will be prompted to rename it in all its tagged tiddlers.
***/
//{{{
config.renameTags = {
prompts: {
rename: "Rename the tag '%0' to '%1' in %2 tidder%3?",
remove: "Remove the tag '%0' from %1 tidder%2?"
},
removeTag: function(tag,tiddlers) {
store.suspendNotifications();
for (var i=0;i<tiddlers.length;i++) {
store.setTiddlerTag(tiddlers[i].title,false,tag);
}
store.resumeNotifications();
store.notifyAll();
},
renameTag: function(oldTag,newTag,tiddlers) {
store.suspendNotifications();
for (var i=0;i<tiddlers.length;i++) {
store.setTiddlerTag(tiddlers[i].title,false,oldTag); // remove old
store.setTiddlerTag(tiddlers[i].title,true,newTag); // add new
}
store.resumeNotifications();
store.notifyAll();
},
storeMethods: {
saveTiddler_orig_renameTags: TiddlyWiki.prototype.saveTiddler,
saveTiddler: function(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created) {
if (title != newTitle) {
var tagged = this.getTaggedTiddlers(title);
if (tagged.length > 0) {
// then we are renaming a tag
if (confirm(config.renameTags.prompts.rename.format([title,newTitle,tagged.length,tagged.length>1?"s":""])))
config.renameTags.renameTag(title,newTitle,tagged);
if (!this.tiddlerExists(title) && newBody == "")
// dont create unwanted tiddler
return null;
}
}
return this.saveTiddler_orig_renameTags(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created);
},
removeTiddler_orig_renameTags: TiddlyWiki.prototype.removeTiddler,
removeTiddler: function(title) {
var tagged = this.getTaggedTiddlers(title);
if (tagged.length > 0)
if (confirm(config.renameTags.prompts.remove.format([title,tagged.length,tagged.length>1?"s":""])))
config.renameTags.removeTag(title,tagged);
return this.removeTiddler_orig_renameTags(title);
}
},
init: function() {
merge(TiddlyWiki.prototype,this.storeMethods);
}
}
config.renameTags.init();
//}}}
/***
|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: 'done/close',
tooltip: 'Save changes to this tiddler and close it',
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: 'cancel/close',
tooltip: 'Undo changes to this tiddler and close it',
handler: function(ev,src,title) {
// the same as closeTiddler now actually
return config.commands.closeTiddler.handler(ev,src,title);
}
}
});
//}}}
/***
|Name:|SelectThemePlugin|
|Description:|Lets you easily switch theme and palette|
|Version:|1.0.1 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#SelectThemePlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
* Borrows largely from ThemeSwitcherPlugin by Martin Budden http://www.martinswiki.com/#ThemeSwitcherPlugin
* Theme is cookie based. But set a default by setting config.options.txtTheme in MptwConfigPlugin (for example)
* Palette is not cookie based. It actually overwrites your ColorPalette tiddler when you select a palette, so beware.
!Usage
* {{{<<selectTheme>>}}} makes a dropdown selector
* {{{<<selectPalette>>}}} makes a dropdown selector
* {{{<<applyTheme>>}}} applies the current tiddler as a theme
* {{{<<applyPalette>>}}} applies the current tiddler as a palette
* {{{<<applyTheme TiddlerName>>}}} applies TiddlerName as a theme
* {{{<<applyPalette TiddlerName>>}}} applies TiddlerName as a palette
***/
//{{{
config.macros.selectTheme = {
label: {
selectTheme:"select theme",
selectPalette:"select palette"
},
prompt: {
selectTheme:"Select the current theme",
selectPalette:"Select the current palette"
},
tags: {
selectTheme:'systemTheme',
selectPalette:'systemPalette'
}
};
config.macros.selectTheme.handler = function(place,macroName)
{
var btn = createTiddlyButton(place,this.label[macroName],this.prompt[macroName],this.onClick);
// want to handle palettes and themes with same code. use mode attribute to distinguish
btn.setAttribute('mode',macroName);
};
config.macros.selectTheme.onClick = function(ev)
{
var e = ev ? ev : window.event;
var popup = Popup.create(this);
var mode = this.getAttribute('mode');
var tiddlers = store.getTaggedTiddlers(config.macros.selectTheme.tags[mode]);
// for default
if (mode == "selectPalette") {
var btn = createTiddlyButton(createTiddlyElement(popup,'li'),"(default)","default color palette",config.macros.selectTheme.onClickTheme);
btn.setAttribute('theme',"(default)");
btn.setAttribute('mode',mode);
}
for(var i=0; i<tiddlers.length; i++) {
var t = tiddlers[i].title;
var name = store.getTiddlerSlice(t,'Name');
var desc = store.getTiddlerSlice(t,'Description');
var btn = createTiddlyButton(createTiddlyElement(popup,'li'), name?name:t, desc?desc:config.macros.selectTheme.label['mode'], config.macros.selectTheme.onClickTheme);
btn.setAttribute('theme',t);
btn.setAttribute('mode',mode);
}
Popup.show();
return stopEvent(e);
};
config.macros.selectTheme.onClickTheme = function(ev)
{
var mode = this.getAttribute('mode');
var theme = this.getAttribute('theme');
if (mode == 'selectTheme')
story.switchTheme(theme);
else // selectPalette
config.macros.selectTheme.updatePalette(theme);
return false;
};
config.macros.selectTheme.updatePalette = function(title)
{
if (title != "") {
store.deleteTiddler("ColorPalette");
if (title != "(default)")
store.saveTiddler("ColorPalette","ColorPalette",store.getTiddlerText(title),
config.options.txtUserName,undefined,"");
refreshAll();
if(config.options.chkAutoSave)
saveChanges(true);
}
};
config.macros.applyTheme = {
label: "apply",
prompt: "apply this theme or palette" // i'm lazy
};
config.macros.applyTheme.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var useTiddler = params[0] ? params[0] : tiddler.title;
var btn = createTiddlyButton(place,this.label,this.prompt,config.macros.selectTheme.onClickTheme);
btn.setAttribute('theme',useTiddler);
btn.setAttribute('mode',macroName=="applyTheme"?"selectTheme":"selectPalette"); // a bit untidy here
}
config.macros.selectPalette = config.macros.selectTheme;
config.macros.applyPalette = config.macros.applyTheme;
config.macros.refreshAll = { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
createTiddlyButton(place,"refresh","refresh layout and styles",function() { refreshAll(); });
}};
//}}}
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
<<tabs txtMainTab "Timeline" "Timeline" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>
A verdade sobre os males da vacinação
.viewer div.centeredTable {
text-align: center;
}
.viewer div.centeredTable table {
margin: 0 auto;
text-align: left;
}
.justifyright {
text-align: right;
}
.justifyleft {
text-align: left;
}
<<tabs txtMoreTab "Tags" "All Tags" TabAllTags "Miss" "Missing tiddlers" TabMoreMissing "Orph" "Orphaned tiddlers" TabMoreOrphans "Shad" "Shadowed tiddlers" TabMoreShadowed>>
<<allTags excludeLists [a-z]>>
/***
|Name|SectionLinksPlugin|
|Source|http://www.TiddlyTools.com/#SectionLinksPlugin|
|Documentation|http://www.TiddlyTools.com/#SectionLinksPlugin|
|Version|1.3.4|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|allow tiddler sections in TiddlyLinks to be used as anchor points|
This plugin enhances the processing of section references so they can be used in links to auto-scroll to the indicated heading within a tiddler (i.e., similar to the 'anchor' behavior provided in HTML by {{{<a name="foo">}}} and {{{<a href="#foo">...</a>}}})
!!!Usage
<<<
!!!!!{{{<<tiddler>>}}} macro
>The {{{<<tiddler SomeTiddler##SomeSection>>}}} syntax has been extended so that when the tiddler title is omitted or the 'here' keyword is used (e.g., {{{<<tiddler ##SomeSection>>}}} or {{{<<tiddler here##SomeSection>>}}}), then the current containing tiddler is implied by default.
!!!!!~TiddlyLink syntax
>the standard link syntax has been extended so that a section name can included in a tiddler link (e.g., {{{[[SomeTiddler##SomeSection]]}}}). When clicked, the tiddler is displayed and the specified section heading will be automatically scrolled into view. If the tiddler title is omitted or the 'here' keyword is used (e.g., {{{[[##SomeSection]]}}} or {{{[[here##SomeSection]]>>}}}), then the current containing tiddler is implied by default.
!!!!!"""<<sectionTOC>>""" macro
>This macro generates a 'Table of Contents'-style numbered-bullet list with links to all sections within the current tiddler. Simply place the following macro at the //end of the tiddler content// (i.e., following all section headings):
{{{
<<sectionTOC>> or <<sectionTOC className>>
}}}
>Note: The macro must occur at the end of the tiddler in order to locate the rendered section headings that precede it. In addition, to position the macro's //output// within the tiddler, you must create a special 'target element' that uses a specified classname (default='sectionTOC'), like this:
{{{
{{sectionTOC{}}}
}}}
>When the {{{<<sectionTOC>>}}} macro is rendered, it will find the matching 'sectionTOC'-classed element and writes it's output there. You can also add the macro and/or target elements directly to the [[ViewTemplate]] definition, so that every tiddler can automatically display the table of contents:
{{{
<span class='sectionTOC'></span> <!-- target element -->
...
<span macro='sectionTOC'></span> <!-- must be at end of tiddler -->
}}}
<<<
!!!Revisions
<<<
2009.08.21 [1.3.4] added handling to ignore leading/trailing whitespace in section references
2009.08.21 [1.3.3] in createTiddlyLink(), add tiddlyLinkNonExistingSection class if matching section is not found
2009.08.14 [1.3.2] in createTiddlyLink(), don't override core value for ~TiddlyLink attribute
2009.08.02 [1.3.1] in sectionTOC.handler(), trim leading/trailing whitespace from generated section links
2009.08.01 [1.3.0] in scrollToSection(), apply 3-tier section matching (exact, startsWith, contains)
2009.07.06 [1.2.2] fixed displayTiddler() hijack
2009.07.03 [1.2.1] in {{{<<sectionTOC>>}}}, suppress output if target is not found
2009.06.02 [1.2.0] added support for 'here' keyword in {{{[[here##section]]}}} links and {{{<<tiddler here##section>>}}} macro
2009.04.09 [1.1.1] in sectionTOC macro, make target visible when TOC is rendered.
2009.01.18 [1.1.0] added {{{<<sectionTOC>>}}} macro to generate numbered-bullet links to sections of current tiddler
2009.01.06 [1.0.0] converted to stand-alone plugin
2008.10.14 [0.0.0] initial release (as [[CoreTweaks]] #784 - http://trac.tiddlywiki.org/ticket/784)
<<<
!!!Code
***/
//{{{
version.extensions.SectionLinksPlugin= {major: 1, minor: 3, revision: 4, date: new Date(2009,8,21)};
Story.prototype.scrollToSection = function(title,section) {
if (!title||!section) return; var t=this.getTiddler(title); if (!t) return null;
var elems=t.getElementsByTagName('*'); var heads=[];
for (var i=0; i<elems.length; i++)
if (['H1','H2','H3','H4','H5'].contains(elems[i].nodeName)) heads.push(elems[i]);
for (var i=0; i<heads.length; i++)
if (getPlainText(heads[i]).trim()==section) break;
if (i==heads.length) for (var i=0; i<heads.length; i++)
if (getPlainText(heads[i]).trim().startsWith(section)) break;
if (i==heads.length) for (var i=0; i<heads.length; i++)
if (getPlainText(heads[i]).trim().indexOf(section)!=-1) break;
if (i<heads.length) { var h=heads[i];
// if section heading is collapsed, click to expand it - see [[FoldHeadingsPlugin]]
if (hasClass(h,'foldable') && h.nextSibling.style.display=='none') h.onclick();
// scroll *after* tiddler animation
var delay=config.options.chkAnimate?config.animDuration+100:0;
setTimeout('window.scrollTo('+findPosX(h)+','+findPosY(h)+')',delay);
return h;
}
}
//}}}
/***
!!!!core hijacks
***/
/***
!!!!!createTiddlyLink
***/
//{{{
// [[tiddlername##section]] and [[##section]]
if (!window.createTiddlyLink_section)
window.createTiddlyLink_section=window.createTiddlyLink;
window.createTiddlyLink=function(place,title) {
var t=story.findContainingTiddler(place); var tid=t?t.getAttribute('tiddler'):'';
var parts=title.split(config.textPrimitives.sectionSeparator);
var title=parts[0]; var section=parts[1]; if (section) section=section.trim();
if (!title.length || title.toLowerCase()=='here') title=tid; // default=current tiddler
arguments[1]=title;
var btn=createTiddlyLink_section.apply(this,arguments);
if (section) {
btn.setAttribute('section',section);
if (store.getTiddlerText(title+config.textPrimitives.sectionSeparator+section)===null)
addClass(btn,'tiddlyLinkNonExistingSection');
}
return btn;
}
//}}}
/***
!!!!!onClickTiddlerLink
***/
//{{{
if (!window.onClickTiddlerLink_section)
window.onClickTiddlerLink_section=window.onClickTiddlerLink;
window.onClickTiddlerLink=function(ev) {
var e=ev||window.event; var target=resolveTarget(e); var title=null;
while (target!=null && title==null) {
title=target.getAttribute('tiddlyLink');
section=target.getAttribute('section');
target=target.parentNode;
}
var t=story.findContainingTiddler(target); var tid=t?t.getAttribute('tiddler'):'';
if (title!=tid||!section) // avoid excess scrolling for intra-tiddler links
onClickTiddlerLink_section.apply(this,arguments);
story.scrollToSection(title,section);
return false;
}
//}}}
/***
!!!!! displayTiddler
***/
//{{{
if (!Story.prototype.displayTiddler_section)
Story.prototype.displayTiddler_section=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler)
{
var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
var parts=title.split(config.textPrimitives.sectionSeparator);
var title=parts[0]; var section=parts[1]; if (section) section=section.trim();
if (!title.length || title.toLowerCase()=='here') {
var t=story.findContainingTiddler(place);
title=t?t.getAttribute('tiddler'):'';
}
arguments[1]=title; // default=current tiddler
this.displayTiddler_section.apply(this,arguments);
story.scrollToSection(title,section);
}
//}}}
/***
!!!!!isExternalLink
***/
//{{{
if (!config.formatterHelpers.isExternalLink_section)
config.formatterHelpers.isExternalLink_section=config.formatterHelpers.isExternalLink;
config.formatterHelpers.isExternalLink=function(link) {
if (link.indexOf(config.textPrimitives.sectionSeparator)!=-1) return false;
return config.formatterHelpers.isExternalLink_section.apply(this,arguments);
}
//}}}
/***
!!!!!tiddler.handler
***/
//{{{
if (!config.macros.tiddler.handler_section)
config.macros.tiddler.handler_section=config.macros.tiddler.handler;
config.macros.tiddler.handler=function(place,macroName,params,wikifier,paramString,tiddler)
{
if (!params[0]) return;
var sep=config.textPrimitives.sectionSeparator;
var parts=params[0].split(sep); var tid=parts[0]; var sec=parts[1]; if (sec) sec=sec.trim();
if ((tid.toLowerCase()=='here'||!tid.length) && sec) { // fixup for 'here##section' and '##section'
var here=story.findContainingTiddler(place)
var tid=here?here.getAttribute('tiddler'):tiddler?tiddler.title:'';
arguments[2][0]=tid+sep+sec;
arguments[4]=paramString.replace(new RegExp('(here)?'+sep+sec),tid+sep+sec);
}
config.macros.tiddler.handler_section.apply(this,arguments);
}
//}}}
/***
!!!!sectionTOC macro
***/
//{{{
config.macros.sectionTOC = {
targetClass: 'sectionTOC',
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var out=[];
var targetClass=params[0]||this.targetClass;
var t=story.findContainingTiddler(place); if (!t) return;
var elems=t.getElementsByTagName('*');
var level=5; // topmost heading level
for (var i=0; i<elems.length; i++) {
var txt=getPlainText(elems[i]).trim();
var link='[['+txt+'|##'+txt+']]';
switch(elems[i].nodeName) {
case 'H1': out.push('#'+link); level=1; break;
case 'H2': out.push('##'+link); level=level<2?level:2; break;
case 'H3': out.push('###'+link); level=level<3?level:3; break;
case 'H4': out.push('####'+link); level=level<4?level:4; break;
case 'H5': out.push('#####'+link); level=level<5?level:5; break;
default: if (hasClass(elems[i],targetClass)) var target=elems[i];
}
}
// trim excess bullet levels
if (level>1) for (var i=0; i<out.length; i++) out[i]=out[i].substr(level-1);
// show numbered list
if (out.length && target) {
if (target.style.display=='none') target.style.display='block';
wikify(out.join('\n'),target);
}
}
}
//}}}
/***
!!!Invoke macro
{{{
<<sectionTOC>>
}}}
***/
// //<<sectionTOC>>
/***
|Name:|TagglyTaggingPlugin|
|Description:|tagglyTagging macro is a replacement for the builtin tagging macro in your ViewTemplate|
|Version:|3.3.1 ($Rev: 9828 $)|
|Date:|$Date: 2009-06-03 21:38:41 +1000 (Wed, 03 Jun 2009) $|
|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: "title",
modified: "modified",
created: "created",
show: "+",
hide: "-",
normal: "normal",
group: "group",
commas: "commas",
sitemap: "sitemap",
numCols: "cols\u00b1", // plus minus sign
label: "Tagged as '%0':",
exprLabel: "Matching tag expression '%0':",
excerpts: "excerpts",
descr: "descr",
slices: "slices",
contents: "contents",
sliders: "sliders",
noexcerpts: "title only",
noneFound: "(none)"
},
tooltips: {
title: "Click to sort by title",
modified: "Click to sort by modified date",
created: "Click to sort by created date",
show: "Click to show tagging list",
hide: "Click to hide tagging list",
normal: "Click to show a normal ungrouped list",
group: "Click to show list grouped by tag",
sitemap: "Click to show a sitemap style list",
commas: "Click to show a comma separated list",
numCols: "Click to change number of columns",
excerpts: "Click to show excerpts",
descr: "Click to show the description slice",
slices: "Click to show all slices",
contents: "Click to show entire tiddler contents",
sliders: "Click to show tiddler contents in sliders",
noexcerpts: "Click to show entire title only"
},
tooDeepMessage: "* //sitemap too deep...//"
},
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) {
// create it silently if it doesn't exist
if (!store.tiddlerExists(title)) {
store.saveTiddler(title,title,config.views.editor.defaultText.format([title]),config.options.txtUserName,new Date(),"");
// <<tagglyTagging expr:"...">> creates a tiddler to store its display settings
// Make those tiddlers less noticeable by tagging as excludeSearch and excludeLists
// Because we don't want to hide real tags, check that they aren't actually tags before doing so
// Also tag them as tagglyExpression for manageability
// (contributed by RA)
if (!store.getTaggedTiddlers(title).length) {
store.setTiddlerTag(title,true,"excludeSearch");
store.setTiddlerTag(title,true,"excludeLists");
store.setTiddlerTag(title,true,"tagglyExpression");
}
}
// 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);
// supposed to automagically don't let cols cycle up past the number of items
// currently broken in some situations, eg when using an expression
// lets fix it later when we rewrite for jquery
// the columns thing should be jquery table manipulation probably
var limit = (opt == "numCols" ? store.getTaggedTiddlers(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;
}
});
//}}}
/***
|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;
});
}
}
});
//}}}
if(config.options.txtUserName != "Kadargo") {
readOnly = true;
showBackstage = false;
}